videocollection/tsrc/stubs/inc/hbaction.h
changeset 35 3738fe97f027
parent 34 bbb98528c666
child 36 8aed59de29f9
equal deleted inserted replaced
34:bbb98528c666 35:3738fe97f027
    24 #include <qaction.h>
    24 #include <qaction.h>
    25 #include "hbnamespace.h"
    25 #include "hbnamespace.h"
    26 #include "hbicon.h"
    26 #include "hbicon.h"
    27 #include "hbmenu.h"
    27 #include "hbmenu.h"
    28 
    28 
    29 class  HbAction : public QAction
    29 class  HbAction : public QObject
    30 {
    30 {
    31     Q_OBJECT
    31     Q_OBJECT
       
    32 
    32 public:
    33 public:
    33     
    34     
    34     /**
    35     /**
    35      * Constructor
    36      * Constructor
    36      */
    37      */
    37     explicit HbAction(QObject *parent = 0) : QAction(parent)
    38     explicit HbAction(QObject *parent = 0)
    38     {
    39     {
    39         Q_UNUSED(parent);
    40         Q_UNUSED(parent);
    40         initializeCount++;
    41         initializeCount++;
       
    42         mTriggeredCount = 0;
    41     }
    43     }
    42     
    44     
    43     /**
    45     /**
    44      * Contructor.
    46      * Contructor.
    45      */       
    47      */       
    46     explicit HbAction(const QString &txt, QObject *parent = 0) : mTxt(txt), QAction(parent) 
    48     explicit HbAction(const QString &txt, QObject *parent = 0) : mTxt(txt) 
    47     {
    49     {
    48         Q_UNUSED(parent);
    50         Q_UNUSED(parent);
    49         initializeCount++;
    51         initializeCount++;
       
    52         mTriggeredCount = 0;
    50     }
    53     }
    51     
    54     
    52     /**
    55     /**
    53      * Contructor.
    56      * Contructor.
    54      */ 
    57      */ 
    55     explicit HbAction(Hb::SoftKeyAction actType, QObject *parent = 0) : mTxt(""), QAction(parent) 
    58     explicit HbAction(Hb::SoftKeyAction actType, QObject *parent = 0) : mTxt("")
    56     {
    59     {
    57         Q_UNUSED(parent);
    60         Q_UNUSED(parent);
    58         Q_UNUSED(actType);
    61         Q_UNUSED(actType);
    59         initializeCount++;
    62         initializeCount++;
       
    63         mTriggeredCount = 0;
    60     }
    64     }
    61     
    65     
    62     explicit HbAction(Hb::NavigationAction action, QObject* parent = 0) : mTxt(""), QAction(parent)
    66     explicit HbAction(Hb::NavigationAction action, QObject* parent = 0) : mTxt("")
    63     {
    67     {
    64         Q_UNUSED(parent);
    68         Q_UNUSED(parent);
    65         Q_UNUSED(action);
    69         Q_UNUSED(action);
    66         initializeCount++;
    70         initializeCount++;
       
    71         mTriggeredCount = 0;
    67     }
    72     }
    68     
    73     
    69     /**
    74     /**
    70      * destructor
    75      * destructor
    71      */
    76      */
    72    virtual ~HbAction(){initializeCount--;}
    77     virtual ~HbAction(){initializeCount--;}
    73     
    78     
    74     /**
    79     /**
    75      * sets mDisable;
    80      * sets mDisable;
    76      */
    81      */
    77     void setDisabled(bool disable){mDisable = disable;}
    82     void setDisabled(bool disable){mDisable = disable;}
    95      * not stubbed yet.
   100      * not stubbed yet.
    96      */
   101      */
    97     HbMenu *menu() const { return 0; }
   102     HbMenu *menu() const { return 0; }
    98     
   103     
    99     /**
   104     /**
       
   105      * Trigger stub
       
   106      */
       
   107     void trigger() { mTriggeredCount++; };
       
   108     
       
   109     /**
       
   110      * SetText stub
       
   111      */
       
   112     void setText(QString text) { mText = text; };
       
   113 
       
   114 signals:
       
   115         
       
   116         /**
       
   117          * dummy triggered
       
   118          */
       
   119         void triggered();
       
   120         
       
   121 public: // data
       
   122     
       
   123     /**
   100      * dummy member 
   124      * dummy member 
   101      */
   125      */
   102     bool mDisable;
   126     bool mDisable;
   103     
   127     
   104     /**
   128     /**
   114     /**
   138     /**
   115      * counter to make sure alloc dealloc match
   139      * counter to make sure alloc dealloc match
   116      */
   140      */
   117     static int initializeCount;
   141     static int initializeCount;
   118     
   142     
   119 signals:
   143     /**
       
   144      * Count how many times this was triggered.
       
   145      */
       
   146     int mTriggeredCount;
   120     
   147     
   121     /**
   148     /**
   122      * dummy triggered
   149      * Set text.
   123      */
   150      */
   124     void triggered();
   151     QString mText;    
   125         
       
   126 };
   152 };
   127 
   153 
   128 #endif
   154 #endif