1 /* |
|
2 * Copyright (c) 2007-2008 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: Implementation for utility class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MULUTILITY_H_ |
|
20 #define MULUTILITY_H_ |
|
21 |
|
22 #include <stdexcept> |
|
23 #include <string> |
|
24 #include <e32cmn.h> |
|
25 #include <osn/osndefines.h> |
|
26 #include "mulkeyboardutility.h" |
|
27 |
|
28 namespace osncore |
|
29 { |
|
30 class UString; |
|
31 } |
|
32 |
|
33 using namespace osncore; |
|
34 |
|
35 namespace Alf |
|
36 { |
|
37 |
|
38 static void MUL_ASSERT(bool aExpression, const char* aExceptionString) |
|
39 { |
|
40 if( aExpression ) |
|
41 { |
|
42 throw std::logic_error(aExceptionString); |
|
43 } |
|
44 } |
|
45 |
|
46 class MulUtility |
|
47 { |
|
48 public: |
|
49 /** |
|
50 * Converts the relative path to the absolute path. |
|
51 * |
|
52 * @param aRelativePath Which needs to be changed to the absolutepath. |
|
53 * @return true , if aRelativepath changed to Absoulte path or else false |
|
54 */ |
|
55 OSN_IMPORT static bool AbsolutePath(UString& aRelativePath); |
|
56 |
|
57 /** |
|
58 * Checks which orienatation the application is in and returns true if it is in |
|
59 * Landscape orientation otherwise returns false |
|
60 * |
|
61 */ |
|
62 OSN_IMPORT static bool IsLandscape(); |
|
63 |
|
64 /** |
|
65 * Checks if the given string tag is a pool resource or not |
|
66 * |
|
67 * @param aImageTag Path of the image file,which needs to be checked for resource tag format. |
|
68 */ |
|
69 OSN_IMPORT static bool IsPoolResource(const UString& aImageTag); |
|
70 |
|
71 /** |
|
72 * Checks if current KeyBoard is QWERTY |
|
73 * @return true if KeyBoard is QWERTY else false. |
|
74 */ |
|
75 OSN_IMPORT static bool IsQwerty(); |
|
76 |
|
77 private: |
|
78 /** |
|
79 * Checks the file for its existence |
|
80 * |
|
81 * @param afilePath File to be checked. |
|
82 * @return true, In case file exists or else false. |
|
83 */ |
|
84 static bool IsFileExists(/*const char* afilePath*/const TDesC& aFilePath); |
|
85 |
|
86 |
|
87 |
|
88 }; |
|
89 |
|
90 } // namespace Alf |
|
91 |
|
92 #endif // MULUTILITY_H_ |
|
93 |
|
94 // End of file |
|
95 |
|