diff -r 4697dfb2d7ad -r 238255e8b033 messagingapp/msgui/conversationview/inc/msgconversationviewitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/conversationview/inc/msgconversationviewitem.h Fri Apr 16 14:56:15 2010 +0300 @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description:Message chat View decorator item prototype + * + */ + +#ifndef MSG_CONVERSATION_VIEW_ITEM_H +#define MSG_CONVERSATION_VIEW_ITEM_H + +// INCLUDES +#include + +//Forward Declarations +class MsgConversationWidget; +class HbTextItem; +class HbIconItem; + +/** + * This class represents the item decorator of + * the conversation view. + */ +class MsgConversationViewItem : public HbListViewItem +{ +Q_OBJECT + + Q_PROPERTY(bool isIncoming READ isIncoming WRITE setIncoming) + +public: + /** + * Constructor + * @param parent, reference of QGraphicsItem + * default set to 0 + */ + MsgConversationViewItem(QGraphicsItem* parent = 0); + + /** + * Destructor + */ + virtual ~MsgConversationViewItem(); + + /** + * Factory method to the items + */ + virtual MsgConversationViewItem* createItem(); + + /** + * Overridden method to draw the custom item in the list view + */ + void updateChildItems(); + + /** + * Checks if point in question is within bubble frame or not. + * @param point, point to be checked. + * @return returns true is point is within bubble frame geometry. + */ + bool containsPoint(const QPointF& point); + + /** + * Specify if this widget's message is incoming + * @param incoming + */ + void setIncoming(bool incoming = true); + + /** + * Get to find if this is incoming message + * @return bool + */ + bool isIncoming(); + +private: + + void setMessageStateIcon(int messageState); + +private: + + /** + * Info about received or outgoing message. + * true if received message else false. + */ + bool mIncoming; + + /* + * The chat custom control to show the conversation item + * Owned + */ + MsgConversationWidget *mConversation; + + /** + * Graphics Item to hold message sending state. + * Owned + */ + HbIconItem *mMessageStateIconItem; +}; + +#endif // MSG_CONVERSATION_VIEW_ITEM_H +// EOF