phonebookui/cntcommonui/views/cnthistoryviewitemwidget.h
changeset 81 640d30f4fb64
equal deleted inserted replaced
77:c18f9fa7f42e 81:640d30f4fb64
       
     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 #include <hbframebackground.h>
       
    24 
       
    25 class HbIconItem;
       
    26 class HbTextItem;
       
    27 class HbFrameItem;
       
    28 
       
    29 class CntHistoryViewItemWidget : public HbWidget
       
    30 {
       
    31     friend class TestCntHistoryView;
       
    32     
       
    33     Q_OBJECT
       
    34     Q_PROPERTY( QString title READ getTitle )
       
    35     Q_PROPERTY( QString bodyText READ getBodyText )
       
    36     Q_PROPERTY( QString timeStamp READ getTimeStamp )
       
    37     Q_PROPERTY( HbIcon icon READ getIcon )
       
    38     Q_PROPERTY( bool incoming READ getIncoming )
       
    39     Q_PROPERTY( bool newmessage READ isNewMessage )
       
    40 
       
    41 public:
       
    42     CntHistoryViewItemWidget(QGraphicsItem *parent = 0);
       
    43     ~CntHistoryViewItemWidget();
       
    44 
       
    45 public:
       
    46     void createPrimitives();
       
    47     void recreatePrimitives();
       
    48     
       
    49     void setModelIndex(const QModelIndex& index);
       
    50     
       
    51     void pressStateChanged(bool pressed);
       
    52 
       
    53     QString getTitle() const { return title; }
       
    54     QString getBodyText() const { return bodyText; }
       
    55     QString getTimeStamp() const { return timeStamp; }
       
    56     HbIcon getIcon() const { return icon; }
       
    57     bool getIncoming() const { return incoming; }
       
    58     bool isNewMessage() const { return newmessage; }
       
    59 
       
    60 private:
       
    61     HbIconItem              *mIcon;
       
    62     HbTextItem              *mTitle;
       
    63     HbTextItem              *mBodyText;
       
    64     HbTextItem              *mTimeStamp;
       
    65     HbFrameItem             *mFrameItem;
       
    66     HbFrameItem             *mFocusItem;
       
    67     HbFrameItem             *mNewItem;
       
    68 
       
    69     HbFrameBackground       backGround;
       
    70     QString                 title;
       
    71     QString                 bodyText;
       
    72     QString                 timeStamp;
       
    73     HbIcon                  icon;
       
    74     bool                    incoming;
       
    75     bool                    newmessage;
       
    76 };
       
    77 
       
    78 #endif /* CNTHISTORYVIEWITEMWIDGET_H */