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) const; |
|
80 |
|
81 /*! |
|
82 \fn QString PhoneResourceAdapter::convert (int symbianResourceId, QString text ) |
|
83 |
|
84 Converts given Symbian resource id to QString and formats given text to |
|
85 resource converted text. |
|
86 |
|
87 Returns QString. |
|
88 */ |
|
89 QString convertToString(int symbianResourceId, const QString &text) const; |
|
90 |
|
91 /*! |
|
92 \fn int PhoneResourceAdapter::defaultToolbarResourceId () |
|
93 |
|
94 Returns default toolbar resource id. |
|
95 */ |
|
96 int defaultToolbarResourceId() const; |
|
97 |
|
98 /*! |
|
99 \fn QString PhoneResourceAdapter::convertCommandToString() |
|
100 |
|
101 Converts given Symbian command id to QString. |
|
102 |
|
103 Returns QString. |
|
104 */ |
|
105 QString convertCommandToString(int symbianCommandId) const; |
|
106 |
|
107 /*! |
|
108 \fn QString PhoneResourceAdapter::convertToHbActions() |
|
109 |
|
110 Converts given Symbian command id to HbAction list. |
|
111 |
|
112 Returns HbAction list. |
|
113 */ |
|
114 QList<HbAction*> convertToHbActions(int symbianResourceId) const; |
|
115 |
|
116 protected: |
|
117 |
|
118 /*! |
|
119 Constructor |
|
120 */ |
|
121 PhoneResourceAdapter (QObject *parent = 0); |
|
122 |
|
123 private: |
|
124 |
|
125 PhoneUIQtButtonsController* m_buttonsCtrl; // Own |
|
126 |
|
127 }; |
|
128 |
|
129 #endif // PHONERESOURCEADAPTER_H |
|