|
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: A class for storing the creation paramters for the core UI |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef JAVACOREUIPARAMS_H |
|
19 #define JAVACOREUIPARAMS_H |
|
20 |
|
21 #include <string> |
|
22 |
|
23 #include "javaosheaders.h" |
|
24 |
|
25 |
|
26 namespace java // codescanner::namespace |
|
27 { |
|
28 namespace ui // codescanner::namespace |
|
29 { |
|
30 enum UiOrientation // codescanner::enummembers::enumnames |
|
31 { |
|
32 UNDEFINED, // The default, the UI is rotated normally. |
|
33 PORTRAIT, // User wants to keep the UI always in portrait. |
|
34 LANDSCAPE // User wants to keep the UI always in landscape. |
|
35 }; |
|
36 |
|
37 enum StartScreenMode // codescanner::enummembers::enumnames |
|
38 { |
|
39 NO_START_SCREEN, // The should be no start screeen (== suppress). |
|
40 DEFAULT_START_SCREEN, // Show the default start screen. |
|
41 MIDLET_DEFINED_SCREEN, // MIDlet defined start screen should be shown. |
|
42 // In this case the image path must point to |
|
43 // root of the MIDlet from where can be found |
|
44 // the start screen image(s) created by the |
|
45 // Java installer |
|
46 USER_DEFINED_SCREEN // Application defined start screen should be |
|
47 // showed. In this case the image path must point |
|
48 // to valid gif file. |
|
49 }; |
|
50 |
|
51 OS_NONSHARABLE_CLASS(CoreUiParams) |
|
52 { |
|
53 public: |
|
54 |
|
55 /** |
|
56 * CoreUiParams default constructor. |
|
57 */ |
|
58 CoreUiParams(); |
|
59 |
|
60 /** |
|
61 * CoreUiParams destructor. |
|
62 */ |
|
63 ~CoreUiParams(); |
|
64 |
|
65 /** |
|
66 * CoreUiParams assign operator. |
|
67 */ |
|
68 CoreUiParams& operator= (const CoreUiParams&); |
|
69 |
|
70 /** |
|
71 * A setter for the requested orientation of the UI. |
|
72 */ |
|
73 inline void setOrientation(UiOrientation orientation); |
|
74 /** |
|
75 * A getter for the requested orientation of the UI. |
|
76 */ |
|
77 inline UiOrientation getOrientation() const; |
|
78 |
|
79 /** |
|
80 * A setter for the requested start screen mode. |
|
81 */ |
|
82 inline void setScreenMode(StartScreenMode screenMode); |
|
83 /** |
|
84 * A getter for the requested start screen mode. |
|
85 */ |
|
86 inline StartScreenMode getScreenMode() const; |
|
87 |
|
88 /** |
|
89 * A setter for the image path. |
|
90 */ |
|
91 inline void setImagePath(const std::wstring& path); |
|
92 /** |
|
93 * A getter for the image path. |
|
94 */ |
|
95 inline const std::wstring& getImagePath() const; |
|
96 |
|
97 /** |
|
98 * A setter for the background starting info. |
|
99 */ |
|
100 inline void setBackgroundStart(bool bg); |
|
101 /** |
|
102 * A getter for the background starting info. |
|
103 */ |
|
104 inline bool isBackgroundStart() const; |
|
105 |
|
106 private: |
|
107 |
|
108 /** |
|
109 * No copy constructor allowed |
|
110 */ |
|
111 CoreUiParams(const CoreUiParams&); |
|
112 |
|
113 private: |
|
114 UiOrientation mOrientation; |
|
115 StartScreenMode mStartScreenMode; |
|
116 std::wstring mPath; |
|
117 bool mBackgroundStart; |
|
118 }; |
|
119 |
|
120 } //end namespace ui |
|
121 } //end namespace java |
|
122 |
|
123 |
|
124 //START OF INLINE METHODS |
|
125 inline |
|
126 java::ui::CoreUiParams::CoreUiParams() : mOrientation(UNDEFINED), |
|
127 mStartScreenMode(NO_START_SCREEN), |
|
128 mBackgroundStart(false) |
|
129 { |
|
130 } |
|
131 |
|
132 inline java::ui::CoreUiParams::~CoreUiParams() |
|
133 { |
|
134 } |
|
135 |
|
136 inline |
|
137 void java::ui::CoreUiParams::setOrientation(java::ui::UiOrientation orientation) |
|
138 { |
|
139 mOrientation = orientation; |
|
140 } |
|
141 |
|
142 inline |
|
143 java::ui::UiOrientation java::ui::CoreUiParams::getOrientation() const |
|
144 { |
|
145 return mOrientation; |
|
146 } |
|
147 |
|
148 inline |
|
149 void java::ui::CoreUiParams::setScreenMode(java::ui::StartScreenMode screenMode) |
|
150 { |
|
151 mStartScreenMode = screenMode; |
|
152 } |
|
153 |
|
154 inline |
|
155 java::ui::StartScreenMode java::ui::CoreUiParams::getScreenMode() const |
|
156 { |
|
157 return mStartScreenMode; |
|
158 } |
|
159 |
|
160 inline |
|
161 void java::ui::CoreUiParams::setImagePath(const std::wstring& path) |
|
162 { |
|
163 mPath = path; |
|
164 } |
|
165 |
|
166 inline |
|
167 const std::wstring& java::ui::CoreUiParams::getImagePath() const |
|
168 { |
|
169 return mPath; |
|
170 } |
|
171 |
|
172 inline |
|
173 void java::ui::CoreUiParams::setBackgroundStart(bool bg) |
|
174 { |
|
175 mBackgroundStart = bg; |
|
176 } |
|
177 |
|
178 inline |
|
179 bool java::ui::CoreUiParams::isBackgroundStart() const |
|
180 { |
|
181 return mBackgroundStart; |
|
182 } |
|
183 |
|
184 inline |
|
185 java::ui::CoreUiParams& java::ui::CoreUiParams::operator= (const CoreUiParams& cup) |
|
186 { |
|
187 if (this != &cup) |
|
188 { |
|
189 mOrientation = cup.mOrientation; |
|
190 mStartScreenMode = cup.mStartScreenMode; |
|
191 mPath = cup.mPath; |
|
192 mBackgroundStart = cup.mBackgroundStart; |
|
193 } |
|
194 return *this; |
|
195 } |
|
196 |
|
197 #endif // JAVACOREUIPARAMS_H |