phonebookui/cntcommonui/views/cntactionmenubuilder.h
changeset 81 640d30f4fb64
parent 72 6abfb1094884
equal deleted inserted replaced
77:c18f9fa7f42e 81:640d30f4fb64
    13 *
    13 *
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #ifndef CNTACTIONMENUBUILDER_H_
    18 #ifndef CNTACTIONMENUBUILDER_H
    19 #define CNTACTIONMENUBUILDER_H_
    19 #define CNTACTIONMENUBUILDER_H
    20 
    20 
    21 #include <QObject>
    21 #include <QObject>
    22 #include <hbmenu.h>
    22 #include <hbmenu.h>
    23 #include <qtcontactsglobal.h>
    23 #include <qtcontactsglobal.h>
    24 #include <qtcontacts.h>
    24 #include <qtcontacts.h>
    25 
    25 
    26 class CntStringMapper;
    26 class CntStringMapper;
       
    27 
    27 QTM_BEGIN_NAMESPACE
    28 QTM_BEGIN_NAMESPACE
    28 class QContact;
    29 class QContact;
    29 class QContactDetail;
    30 class QContactDetail;
    30 QTM_END_NAMESPACE
    31 QTM_END_NAMESPACE
    31 
    32 
    32 QTM_USE_NAMESPACE
    33 QTM_USE_NAMESPACE
    33 
    34 
    34 class CntActionMenuBuilder : public QObject
    35 class CntActionMenuBuilder : public QObject
    35     {
    36 {
    36     Q_OBJECT
    37     Q_OBJECT
       
    38     friend class TestCntActionMenuBuilder;
       
    39     
    37 public:
    40 public:
    38     CntActionMenuBuilder( QContactLocalId aMyCardId );
    41     CntActionMenuBuilder( QContactLocalId aMyCardId );
    39     ~CntActionMenuBuilder();
    42     ~CntActionMenuBuilder();
    40     
    43     
    41 public:
    44 public:
    42     HbMenu* actionMenu( QContact& aContact, QContactLocalId myCardId );
    45     HbMenu* actionMenu( QContact& aContact, QContactLocalId myCardId );
    43     
       
    44 public:
       
    45     HbMenu* buildActionMenu( QContact& aContact );
    46     HbMenu* buildActionMenu( QContact& aContact );
    46     
    47     
    47 signals:
    48 signals:
    48     void openContact( QContact& aContact );
    49     void openContact( QContact& aContact );
    49     void editContact( QContact& aContact );
    50     void editContact( QContact& aContact );
    55     void emitEditContact();
    56     void emitEditContact();
    56     void emitDeleteContact();
    57     void emitDeleteContact();
    57     void emitCallContact();
    58     void emitCallContact();
    58     void emitSmsContact();
    59     void emitSmsContact();
    59     void emitMailContact();
    60     void emitMailContact();
    60     void emitContactaction(QContact& aContact, QContactDetail contactDetail, QString aAction);
    61     void emitContactAction(QContact& aContact, QContactDetail contactDetail, QString aAction);
    61     
    62     
    62 #ifdef PBK_UNIT_TEST
    63 private:    
    63 public:
       
    64 #else
       
    65 private:
       
    66 #endif
       
    67     
       
    68     void createCallAction( HbMenu& aMenu, QContact& aContact );
    64     void createCallAction( HbMenu& aMenu, QContact& aContact );
    69     void createMessageAction( HbMenu& aMenu, QContact& aContact );
    65     void createMessageAction( HbMenu& aMenu, QContact& aContact );
    70     void createEmailAction( HbMenu& aMenu, QContact& aContact );
    66     void createEmailAction( HbMenu& aMenu, QContact& aContact );
    71     bool isSupportedDetails( const QString &actionName, const QContact &contact );
    67     bool isSupportedDetails( const QString &actionName, const QContact &contact );
    72 
    68 
    73 private:
    69 private:
    74     QContactLocalId iMyCardId;
    70     QContactLocalId  iMyCardId;
    75     QContact* mContact;
    71     QContact        *mContact;
    76     CntStringMapper* mMap;
    72     CntStringMapper *mMap;
    77     };
    73 };
    78 #endif /* CNTACTIONMENUBUILDER_H_ */
    74 
       
    75 #endif /* CNTACTIONMENUBUILDER_H */