|
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: Converts Symbian resources PhoneAction objects. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef PHONERESOURCEADAPTER_H |
|
19 #define PHONERESOURCEADAPTER_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <QMap> |
|
23 #include "phoneaction.h" |
|
24 |
|
25 #ifdef BUILD_PHONEUIQTVIEWADAPTER |
|
26 #define PHONEURESOURCEADAPTER_EXPORT Q_DECL_EXPORT |
|
27 #else |
|
28 #define PHONEURESOURCEADAPTER_EXPORT Q_DECL_IMPORT |
|
29 #endif |
|
30 |
|
31 class PhoneUIQtButtonsController; |
|
32 class HbAction; |
|
33 |
|
34 class PHONEURESOURCEADAPTER_EXPORT PhoneResourceAdapter : public QObject |
|
35 { |
|
36 Q_OBJECT |
|
37 |
|
38 public: |
|
39 |
|
40 /*! |
|
41 \fn Instance (QObject *parent) |
|
42 |
|
43 This method is a Singleton Design Pattern's way to get |
|
44 instance of this class. |
|
45 */ |
|
46 static PhoneResourceAdapter* Instance (QObject *parent = 0); |
|
47 |
|
48 /*! |
|
49 Destructor |
|
50 */ |
|
51 virtual ~PhoneResourceAdapter (); |
|
52 |
|
53 /*! |
|
54 \fn PhoneUIQtButtonsController* buttonsController () |
|
55 |
|
56 This method returns the pointer to buttons controller object |
|
57 |
|
58 Returns pointer to buttons controller. |
|
59 */ |
|
60 PhoneUIQtButtonsController* buttonsController (); |
|
61 |
|
62 /*! |
|
63 \fn QMap<PhoneAction::ActionType, PhoneAction *> PhoneResourceAdapter::convert (int symbianResourceId) |
|
64 |
|
65 This method converts given Symbian resource id to mapping of translated |
|
66 texts, actions etc. |
|
67 |
|
68 Returns map of actions. |
|
69 */ |
|
70 QMap<PhoneAction::ActionType, PhoneAction *> convert (int symbianResourceId, ...); |
|
71 |
|
72 /*! |
|
73 \fn QString PhoneResourceAdapter::convert (int symbianResourceId) |
|
74 |
|
75 This method converts given Symbian resource id to QString. |
|
76 |
|
77 Returns QString. |
|
78 */ |
|
79 QString convertToString(int symbianResourceId, |
|
80 const QString &causeCode = QString("")) const; |
|
81 |
|
82 /*! |
|
83 \fn QString PhoneResourceAdapter::convert (int symbianResourceId, QString text ) |
|
84 |
|
85 Converts given Symbian resource id to QString and formats given text to |
|
86 resource converted text. |
|
87 |
|
88 Returns QString. |
|
89 */ |
|
90 QString convertToStringWithParam(int symbianResourceId, const QString &text) const; |
|
91 |
|
92 /*! |
|
93 \fn int PhoneResourceAdapter::defaultToolbarResourceId () |
|
94 |
|
95 Returns default toolbar resource id. |
|
96 */ |
|
97 int defaultToolbarResourceId() const; |
|
98 |
|
99 /*! |
|
100 \fn QString PhoneResourceAdapter::convertCommandToString() |
|
101 |
|
102 Converts given Symbian command id to QString. |
|
103 |
|
104 Returns QString. |
|
105 */ |
|
106 QString convertCommandToString(int symbianCommandId) const; |
|
107 |
|
108 /*! |
|
109 \fn QString PhoneResourceAdapter::convertToHbActions() |
|
110 |
|
111 Converts given Symbian command id to HbAction list. |
|
112 |
|
113 Returns HbAction list. |
|
114 */ |
|
115 QList<HbAction*> convertToHbActions(int symbianResourceId) const; |
|
116 |
|
117 /*! |
|
118 \fn QString PhoneResourceAdapter::convertToToolBarCommandList() |
|
119 |
|
120 Converts given Symbian command id to tool bar command list. |
|
121 |
|
122 Returns command list. |
|
123 */ |
|
124 QList<PhoneAction::ToolBarItem> convertToToolBarCommandList( |
|
125 int symbianResourceId ) const; |
|
126 |
|
127 protected: |
|
128 |
|
129 /*! |
|
130 Constructor |
|
131 */ |
|
132 PhoneResourceAdapter (QObject *parent = 0); |
|
133 |
|
134 private: |
|
135 |
|
136 PhoneUIQtButtonsController* m_buttonsCtrl; // Own |
|
137 |
|
138 }; |
|
139 |
|
140 #endif // PHONERESOURCEADAPTER_H |