|
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: hsoperatorhandler.cpp |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "hsoperatorhandler.h" |
|
19 |
|
20 #include <HbAction> |
|
21 |
|
22 #ifdef QT_EXTENSIONS |
|
23 #include "hsoperatorhandler_p.h" |
|
24 #else |
|
25 #include <HbIcon> |
|
26 #endif |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 /*! |
|
32 \class HsOperatorHandler |
|
33 \ingroup group_hsmenustateplugin |
|
34 |
|
35 \brief |
|
36 |
|
37 \sa |
|
38 */ |
|
39 |
|
40 /*! |
|
41 Constructor |
|
42 \param parent parent object |
|
43 */ |
|
44 HsOperatorHandler::HsOperatorHandler(QObject *parent): |
|
45 QObject(parent), |
|
46 #ifdef QT_EXTENSIONS |
|
47 m_q(new HsOperatorHandlerPrivate(this)) |
|
48 #else |
|
49 m_q(0) |
|
50 #endif |
|
51 { |
|
52 } |
|
53 |
|
54 /*! |
|
55 Destructor |
|
56 */ |
|
57 HsOperatorHandler::~HsOperatorHandler() |
|
58 { |
|
59 } |
|
60 |
|
61 /*! |
|
62 Returns Operators icon |
|
63 \retval icon |
|
64 */ |
|
65 HbIcon HsOperatorHandler::icon() |
|
66 { |
|
67 #ifdef QT_EXTENSIONS |
|
68 return m_q->icon(); |
|
69 #else |
|
70 return HbIcon(); |
|
71 #endif |
|
72 } |
|
73 |
|
74 /*! |
|
75 Returns Operators text |
|
76 \retval icon |
|
77 */ |
|
78 QString HsOperatorHandler::text() |
|
79 { |
|
80 #ifdef QT_EXTENSIONS |
|
81 return m_q->text(); |
|
82 #else |
|
83 return QString(); |
|
84 #endif |
|
85 } |
|
86 |
|
87 |
|
88 /*! |
|
89 Open Operator application or related url action |
|
90 */ |
|
91 void HsOperatorHandler::action() |
|
92 { |
|
93 #ifdef QT_EXTENSIONS |
|
94 m_q->action(); |
|
95 #endif |
|
96 } |
|
97 |
|
98 /*! |
|
99 Returns Operator Store presence value predefined in Central Repositoryicon |
|
100 \retval true if Operator Store should be present in toolbar |
|
101 */ |
|
102 bool HsOperatorHandler::operatorStorePresent() |
|
103 { |
|
104 #ifdef QT_EXTENSIONS |
|
105 return m_q->operatorStorePresent(); |
|
106 #else |
|
107 return false; |
|
108 #endif |
|
109 } |
|
110 |
|
111 /*! |
|
112 Returns Ovi Store presence value predefined in Central Repositoryicon |
|
113 \retval true if Ovi Store should be present in toolbar |
|
114 */ |
|
115 bool HsOperatorHandler::oviStorePresent() |
|
116 { |
|
117 #ifdef QT_EXTENSIONS |
|
118 return m_q->oviStorePresent(); |
|
119 #else |
|
120 return false; |
|
121 #endif |
|
122 } |
|
123 |
|
124 /*! |
|
125 Returns if Operator Store should first in toolbar |
|
126 \retval true if Operator Store should first in toolbar |
|
127 */ |
|
128 bool HsOperatorHandler::operatorStoreFirst() |
|
129 { |
|
130 #ifdef QT_EXTENSIONS |
|
131 return m_q->operatorStoreFirst(); |
|
132 #else |
|
133 return false; |
|
134 #endif |
|
135 } |
|
136 |
|
137 /*! |
|
138 Prepares HbAction for Operator Store |
|
139 \param HbAction to prepare |
|
140 \retval HbAction prepared action |
|
141 */ |
|
142 HbAction *HsOperatorHandler::prepareOperatorStoreAction( |
|
143 HbAction *const operatorAction) |
|
144 { |
|
145 operatorAction->setIcon(icon()); |
|
146 connect(operatorAction, SIGNAL(triggered()), this, SLOT(action())); |
|
147 return operatorAction; |
|
148 } |
|
149 |