phonebookui/pbkcommonui/inc/cnthistoryviewitemwidget.h
changeset 31 2a11b5b00470
parent 27 de1630741fbe
child 33 e1c7b0febd15
child 37 fd64c38c277d
equal deleted inserted replaced
27:de1630741fbe 31:2a11b5b00470
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CNTHISTORYVIEWITEMWIDGET_H
       
    19 #define CNTHISTORYVIEWITEMWIDGET_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <hbwidget.h>
       
    23 
       
    24 class HbIconItem;
       
    25 class HbTextItem;
       
    26 class HbFrameItem;
       
    27 
       
    28 class CntHistoryViewItemWidget : public HbWidget
       
    29 {
       
    30     Q_OBJECT
       
    31     Q_PROPERTY( bool titleExist READ isTitleExist )
       
    32     Q_PROPERTY( bool bodyTextExist READ isBodyTextExist )
       
    33     Q_PROPERTY( bool incoming READ getIncoming )
       
    34 
       
    35 public:
       
    36     CntHistoryViewItemWidget(QGraphicsItem *parent = 0);
       
    37     ~CntHistoryViewItemWidget();
       
    38 
       
    39 public:
       
    40     void createPrimitives();
       
    41     void recreatePrimitives();
       
    42     void updatePrimitives();
       
    43     void setDetails(QString title, QString bodyText, QString timeStamp, QString iconName, bool incoming, bool newMessage);
       
    44 
       
    45     bool isTitleExist() const { return !mTitle.isNull(); }
       
    46     bool isBodyTextExist() const { return !mBodyText.isNull(); }
       
    47     bool getIncoming() const { return mIncoming; }
       
    48 
       
    49 private:
       
    50 
       
    51     HbIconItem              *mIconLabel;
       
    52     HbTextItem              *mTitleLabel;
       
    53     HbTextItem              *mBodyTextLabel;
       
    54     HbTextItem              *mTimeStampLabel;
       
    55     HbFrameItem             *mFrameLabel;
       
    56     HbFrameItem             *mNewItemLabel;
       
    57 
       
    58     QString                 mTitle;
       
    59     QString                 mBodyText;
       
    60     QString                 mTimeStamp;
       
    61     HbIcon                  mIcon;
       
    62     bool                    mIncoming;
       
    63     bool                    mNewMessage;
       
    64 };
       
    65 
       
    66 #endif // CNTHISTORYVIEWITEMWIDGET_H