34
|
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: stub hbaction
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef HBACTION_H
|
|
19 |
#define HBACTION_H
|
|
20 |
|
|
21 |
#include <QObject>
|
|
22 |
#include <QString>
|
|
23 |
#include <qpointer.h>
|
|
24 |
#include <qaction.h>
|
|
25 |
#include "hbnamespace.h"
|
|
26 |
#include "hbicon.h"
|
|
27 |
#include "hbmenu.h"
|
|
28 |
|
35
|
29 |
class HbAction : public QObject
|
34
|
30 |
{
|
|
31 |
Q_OBJECT
|
35
|
32 |
|
34
|
33 |
public:
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Constructor
|
|
37 |
*/
|
35
|
38 |
explicit HbAction(QObject *parent = 0)
|
34
|
39 |
{
|
|
40 |
Q_UNUSED(parent);
|
|
41 |
initializeCount++;
|
35
|
42 |
mTriggeredCount = 0;
|
34
|
43 |
}
|
|
44 |
|
|
45 |
/**
|
|
46 |
* Contructor.
|
|
47 |
*/
|
35
|
48 |
explicit HbAction(const QString &txt, QObject *parent = 0) : mTxt(txt)
|
34
|
49 |
{
|
|
50 |
Q_UNUSED(parent);
|
|
51 |
initializeCount++;
|
35
|
52 |
mTriggeredCount = 0;
|
34
|
53 |
}
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Contructor.
|
|
57 |
*/
|
35
|
58 |
explicit HbAction(Hb::SoftKeyAction actType, QObject *parent = 0) : mTxt("")
|
34
|
59 |
{
|
|
60 |
Q_UNUSED(parent);
|
|
61 |
Q_UNUSED(actType);
|
|
62 |
initializeCount++;
|
35
|
63 |
mTriggeredCount = 0;
|
34
|
64 |
}
|
|
65 |
|
35
|
66 |
explicit HbAction(Hb::NavigationAction action, QObject* parent = 0) : mTxt("")
|
34
|
67 |
{
|
|
68 |
Q_UNUSED(parent);
|
|
69 |
Q_UNUSED(action);
|
|
70 |
initializeCount++;
|
35
|
71 |
mTriggeredCount = 0;
|
34
|
72 |
}
|
|
73 |
|
|
74 |
/**
|
|
75 |
* destructor
|
|
76 |
*/
|
35
|
77 |
virtual ~HbAction(){initializeCount--;}
|
34
|
78 |
|
|
79 |
/**
|
|
80 |
* sets mDisable;
|
|
81 |
*/
|
|
82 |
void setDisabled(bool disable){mDisable = disable;}
|
|
83 |
|
|
84 |
/**
|
|
85 |
* sets mVisible;
|
|
86 |
*/
|
|
87 |
void setVisible(bool visible){mVisible = visible;}
|
|
88 |
|
|
89 |
/**
|
|
90 |
* not stubbed yet.
|
|
91 |
*/
|
|
92 |
void setIcon(const HbIcon &icon) { Q_UNUSED(icon); }
|
|
93 |
|
|
94 |
/**
|
|
95 |
* not stubbed yet.
|
|
96 |
*/
|
|
97 |
HbIcon icon() const { return HbIcon(); }
|
|
98 |
|
|
99 |
/**
|
|
100 |
* not stubbed yet.
|
|
101 |
*/
|
|
102 |
HbMenu *menu() const { return 0; }
|
|
103 |
|
|
104 |
/**
|
35
|
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 |
/**
|
34
|
124 |
* dummy member
|
|
125 |
*/
|
|
126 |
bool mDisable;
|
|
127 |
|
|
128 |
/**
|
|
129 |
* dummy member
|
|
130 |
*/
|
|
131 |
bool mVisible;
|
|
132 |
|
|
133 |
/**
|
|
134 |
* text setted
|
|
135 |
*/
|
|
136 |
QString mTxt;
|
|
137 |
|
|
138 |
/**
|
|
139 |
* counter to make sure alloc dealloc match
|
|
140 |
*/
|
|
141 |
static int initializeCount;
|
|
142 |
|
35
|
143 |
/**
|
|
144 |
* Count how many times this was triggered.
|
|
145 |
*/
|
|
146 |
int mTriggeredCount;
|
34
|
147 |
|
|
148 |
/**
|
35
|
149 |
* Set text.
|
34
|
150 |
*/
|
35
|
151 |
QString mText;
|
34
|
152 |
};
|
|
153 |
|
|
154 |
#endif
|