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