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 |
|
39
|
29 |
#include "xqserviceutilstub.h"
|
|
30 |
#include "xqserviceproviderstub.h"
|
36
|
31 |
|
|
32 |
class HbAction : public QAction
|
34
|
33 |
{
|
|
34 |
Q_OBJECT
|
35
|
35 |
|
34
|
36 |
public:
|
|
37 |
|
|
38 |
/**
|
|
39 |
* Constructor
|
|
40 |
*/
|
36
|
41 |
explicit HbAction(QObject *parent = 0)
|
|
42 |
: QAction(parent),
|
|
43 |
mMenu(0)
|
34
|
44 |
{
|
|
45 |
Q_UNUSED(parent);
|
|
46 |
initializeCount++;
|
35
|
47 |
mTriggeredCount = 0;
|
34
|
48 |
}
|
|
49 |
|
|
50 |
/**
|
|
51 |
* Contructor.
|
|
52 |
*/
|
36
|
53 |
explicit HbAction(const QString &txt, QObject *parent = 0)
|
|
54 |
: QAction(txt, parent),
|
|
55 |
mMenu(0)
|
34
|
56 |
{
|
|
57 |
Q_UNUSED(parent);
|
|
58 |
initializeCount++;
|
35
|
59 |
mTriggeredCount = 0;
|
34
|
60 |
}
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Contructor.
|
|
64 |
*/
|
36
|
65 |
explicit HbAction(Hb::SoftKeyAction actType, QObject *parent = 0)
|
|
66 |
: QAction(parent),
|
|
67 |
mMenu(0)
|
34
|
68 |
{
|
|
69 |
Q_UNUSED(parent);
|
|
70 |
Q_UNUSED(actType);
|
|
71 |
initializeCount++;
|
35
|
72 |
mTriggeredCount = 0;
|
34
|
73 |
}
|
|
74 |
|
36
|
75 |
explicit HbAction(Hb::NavigationAction action, QObject* parent = 0)
|
|
76 |
: QAction(parent),
|
|
77 |
mMenu(0)
|
34
|
78 |
{
|
|
79 |
Q_UNUSED(parent);
|
|
80 |
Q_UNUSED(action);
|
|
81 |
initializeCount++;
|
36
|
82 |
mNavAction = action;
|
35
|
83 |
mTriggeredCount = 0;
|
34
|
84 |
}
|
|
85 |
|
|
86 |
/**
|
|
87 |
* destructor
|
|
88 |
*/
|
35
|
89 |
virtual ~HbAction(){initializeCount--;}
|
34
|
90 |
|
|
91 |
/**
|
36
|
92 |
* icon
|
34
|
93 |
*/
|
36
|
94 |
void setIcon(const HbIcon &icon) { mIcon = icon; }
|
34
|
95 |
|
|
96 |
/**
|
36
|
97 |
* icon
|
34
|
98 |
*/
|
36
|
99 |
HbIcon icon() const { return mIcon; }
|
34
|
100 |
|
|
101 |
/**
|
36
|
102 |
* menu
|
34
|
103 |
*/
|
36
|
104 |
void setMenu(HbMenu* menu) { mMenu = menu; }
|
34
|
105 |
|
|
106 |
/**
|
36
|
107 |
* menu
|
34
|
108 |
*/
|
36
|
109 |
HbMenu *menu() const { return mMenu; }
|
34
|
110 |
|
|
111 |
/**
|
35
|
112 |
* Trigger stub
|
|
113 |
*/
|
36
|
114 |
void trigger()
|
|
115 |
{
|
|
116 |
mTriggeredCount++;
|
|
117 |
QAction::trigger();
|
|
118 |
}
|
63
|
119 |
|
35
|
120 |
|
|
121 |
public: // data
|
|
122 |
|
|
123 |
/**
|
34
|
124 |
* counter to make sure alloc dealloc match
|
|
125 |
*/
|
|
126 |
static int initializeCount;
|
|
127 |
|
35
|
128 |
/**
|
36
|
129 |
* Hb navigation action type.
|
|
130 |
*/
|
|
131 |
static Hb::NavigationAction mNavAction;
|
|
132 |
|
|
133 |
/**
|
35
|
134 |
* Count how many times this was triggered.
|
|
135 |
*/
|
|
136 |
int mTriggeredCount;
|
34
|
137 |
|
|
138 |
/**
|
36
|
139 |
* icon
|
34
|
140 |
*/
|
36
|
141 |
HbIcon mIcon;
|
|
142 |
|
|
143 |
/**
|
|
144 |
* menu
|
|
145 |
*/
|
|
146 |
HbMenu* mMenu;
|
63
|
147 |
|
34
|
148 |
};
|
|
149 |
|
|
150 |
#endif
|