1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
|
19 * |
|
20 */ |
|
21 |
|
22 #include "xqutils.h" |
|
23 #include "xqutils_p.h" |
|
24 |
|
25 /*! |
|
26 \class XQUtils |
|
27 \brief The XQUtils is a utility class. The class constains some |
|
28 convenience functions e.g. keeping the device backlight on, and launching files. |
|
29 */ |
|
30 |
|
31 /*! |
|
32 Constructs a XQUtils object with the given parent. |
|
33 */ |
|
34 XQUtils::XQUtils(QObject* parent) |
|
35 : QObject(parent), d(new XQUtilsPrivate(this)) |
|
36 { |
|
37 } |
|
38 |
|
39 /*! |
|
40 Destroys the XQUtils object. |
|
41 */ |
|
42 XQUtils::~XQUtils() |
|
43 { |
|
44 delete d; |
|
45 } |
|
46 |
|
47 /*! |
|
48 \enum XQUtils::Error |
|
49 |
|
50 This enum defines the possible errors for an XQUtils object. |
|
51 */ |
|
52 /*! \var XQUtils::Error XQUtils::NoError |
|
53 No error occured. |
|
54 */ |
|
55 /*! \var XQUtils::Error XQUtils::OutOfMemoryError |
|
56 Not enough memory. |
|
57 */ |
|
58 /*! \var XQUtils::Error XQUtils::UserCancelledError |
|
59 User cancelled an operation. |
|
60 */ |
|
61 /*! \var XQUtils::Error XQUtils::UnknownError |
|
62 Unknown error. |
|
63 */ |
|
64 |
|
65 /*! |
|
66 Tries to launch a file in the appropriate application based on the file type. |
|
67 |
|
68 \param filename Path to the file |
|
69 \return If false is returned, an error has occurred. Call error() to the |
|
70 XQUtils::Error value that indicates which error occurred |
|
71 \sa error() |
|
72 */ |
|
73 bool XQUtils::launchFile(const QString& filename) |
|
74 { |
|
75 return d->launchFile(filename); |
|
76 } |
|
77 |
|
78 /*! |
|
79 Resets the system inactivity timer. Calling this function regularly keeps |
|
80 the device backlight on. |
|
81 */ |
|
82 void XQUtils::resetInactivityTime() |
|
83 { |
|
84 d->resetInactivityTime(); |
|
85 } |
|
86 |
|
87 /*! |
|
88 Returns the root path in ROM. |
|
89 |
|
90 \return The root path in ROM. |
|
91 */ |
|
92 QString XQUtils::romRootPath() |
|
93 { |
|
94 return XQUtilsPrivate::romRootPath(); |
|
95 } |
|
96 |
|
97 /*! |
|
98 Returns the root path in Phone Memory. |
|
99 |
|
100 \return The root path in Phone Memory. |
|
101 */ |
|
102 QString XQUtils::phoneMemoryRootPath() |
|
103 { |
|
104 return XQUtilsPrivate::phoneMemoryRootPath(); |
|
105 } |
|
106 |
|
107 /*! |
|
108 Returns the root path in Memory Card. |
|
109 |
|
110 \return The root path in Memory Card. |
|
111 */ |
|
112 QString XQUtils::memoryCardRootPath() |
|
113 { |
|
114 return XQUtilsPrivate::memoryCardRootPath(); |
|
115 } |
|
116 |
|
117 /*! |
|
118 Returns the games path to be appended to a root path. |
|
119 |
|
120 \return The games path. |
|
121 */ |
|
122 QString XQUtils::gamesPath() |
|
123 { |
|
124 return XQUtilsPrivate::gamesPath(); |
|
125 } |
|
126 |
|
127 /*! |
|
128 Returns the installs path to be appended to a root path. |
|
129 |
|
130 \return The installs path. |
|
131 */ |
|
132 QString XQUtils::installsPath() |
|
133 { |
|
134 return XQUtilsPrivate::installsPath(); |
|
135 } |
|
136 |
|
137 /*! |
|
138 Returns the others path to be appended to a root path. |
|
139 |
|
140 \return The installs path. |
|
141 */ |
|
142 QString XQUtils::othersPath() |
|
143 { |
|
144 return XQUtilsPrivate::othersPath(); |
|
145 } |
|
146 |
|
147 /*! |
|
148 Returns the videos path to be appended to a root path. |
|
149 |
|
150 \return The videos path. |
|
151 */ |
|
152 QString XQUtils::videosPath() |
|
153 { |
|
154 return XQUtilsPrivate::videosPath(); |
|
155 } |
|
156 |
|
157 /*! |
|
158 Returns the images path to be appended to a root path. |
|
159 |
|
160 \return The images path. |
|
161 */ |
|
162 QString XQUtils::imagesPath() |
|
163 { |
|
164 return XQUtilsPrivate::imagesPath(); |
|
165 } |
|
166 |
|
167 /*! |
|
168 Returns the pictures path to be appended to a root path. |
|
169 |
|
170 \return The pictures path. |
|
171 */ |
|
172 QString XQUtils::picturesPath() |
|
173 { |
|
174 return XQUtilsPrivate::picturesPath(); |
|
175 } |
|
176 |
|
177 /*! |
|
178 Returns the GMS pictures path to be appended to a root path. |
|
179 |
|
180 \return The GMS pictures path. |
|
181 */ |
|
182 QString XQUtils::gmsPicturesPath() |
|
183 { |
|
184 return XQUtilsPrivate::gmsPicturesPath(); |
|
185 } |
|
186 |
|
187 /*! |
|
188 Returns the MMS background images path to be appended to a root path. |
|
189 |
|
190 \return The MMS background images path. |
|
191 */ |
|
192 QString XQUtils::mmsBackgroundImagesPath() |
|
193 { |
|
194 return XQUtilsPrivate::mmsBackgroundImagesPath(); |
|
195 } |
|
196 |
|
197 /*! |
|
198 Returns the presence logos path to be appended to a root path. |
|
199 |
|
200 \return The presence logos path. |
|
201 */ |
|
202 QString XQUtils::presenceLogosPath() |
|
203 { |
|
204 return XQUtilsPrivate::presenceLogosPath(); |
|
205 } |
|
206 |
|
207 /*! |
|
208 Returns the sounds path to be appended to a root path. |
|
209 |
|
210 \return The sounds path. |
|
211 */ |
|
212 QString XQUtils::soundsPath() |
|
213 { |
|
214 return XQUtilsPrivate::soundsPath(); |
|
215 } |
|
216 |
|
217 /*! |
|
218 Returns the digital sounds path to be appended to a root path. |
|
219 |
|
220 \return The digital sounds path. |
|
221 */ |
|
222 QString XQUtils::digitalSoundsPath() |
|
223 { |
|
224 return XQUtilsPrivate::digitalSoundsPath(); |
|
225 } |
|
226 |
|
227 /*! |
|
228 Returns the simple sounds path to be appended to a root path. |
|
229 |
|
230 \return The simple sound path. |
|
231 */ |
|
232 QString XQUtils::simpleSoundsPath() |
|
233 { |
|
234 return XQUtilsPrivate::simpleSoundsPath(); |
|
235 } |
|
236 |
|
237 /*! |
|
238 Returns a thumbnail images path. The thumbnail images |
|
239 directory exists under the same directory where the corresponding |
|
240 image is. Do not try to append this to a root directory. |
|
241 |
|
242 \return The thumbnail images path. |
|
243 */ |
|
244 QString XQUtils::imagesThumbnailPath() |
|
245 { |
|
246 return XQUtilsPrivate::imagesThumbnailPath(); |
|
247 } |
|
248 |
|
249 /*! |
|
250 Returns the full path of the contacts folder in |
|
251 the memory card. The path also contains the drive letter. |
|
252 Do not try to append this to any root directory. |
|
253 |
|
254 \return The full path of the contacts folder in the memory card. |
|
255 */ |
|
256 QString XQUtils::memoryCardContactsPath() |
|
257 { |
|
258 return XQUtilsPrivate::memoryCardContactsPath(); |
|
259 } |
|
260 |
|
261 /*! |
|
262 Returns the type of error that occurred if the latest function call failed; otherwise returns NoError. |
|
263 |
|
264 \return Error code |
|
265 */ |
|
266 XQUtils::Error XQUtils::error() const |
|
267 { |
|
268 return d->error(); |
|
269 } |
|
270 |
|
271 // End of file |
|