|
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: CCaLocalizerScannerProxy.h |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CALOCALSCANNERPROXY_H |
|
19 #define CALOCALSCANNERPROXY_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
|
24 #include <driveinfo.h> |
|
25 #include <QObject> |
|
26 |
|
27 #include "castorage_global.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CCaLocalizationEntry; |
|
31 class QTranslator; |
|
32 class CCaStorageProxy; |
|
33 |
|
34 |
|
35 /** |
|
36 * CCaLocalizerScannerProxy |
|
37 * |
|
38 */ |
|
39 class CCaLocalizerScannerProxy : public CBase |
|
40 { |
|
41 |
|
42 //CA_STORAGE_TEST_FRIEND_CLASS (TestCaLocalizerScanner) |
|
43 |
|
44 public: |
|
45 |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 */ |
|
50 static CCaLocalizerScannerProxy* NewL( CCaStorageProxy* storageProxy ); |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 */ |
|
55 static CCaLocalizerScannerProxy* NewLC( CCaStorageProxy* aStorageProxy ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 ~CCaLocalizerScannerProxy( ); |
|
61 |
|
62 /** |
|
63 * Performs whole localization of database, can be called at any moment |
|
64 */ |
|
65 void PerformL( ); |
|
66 |
|
67 private: |
|
68 |
|
69 /** |
|
70 * Constructor. |
|
71 */ |
|
72 CCaLocalizerScannerProxy( CCaStorageProxy* aStorageProxy ); |
|
73 |
|
74 /** |
|
75 * By default Symbian 2nd phase constructor is private. |
|
76 */ |
|
77 void ConstructL( ); |
|
78 |
|
79 private: |
|
80 /** |
|
81 * Get localization rows and updates database |
|
82 */ |
|
83 void UpdateLocalNamesL( ); |
|
84 |
|
85 /** |
|
86 * Load translations to mTranslator |
|
87 * @param aFilename file name with translations |
|
88 * @return success or failure |
|
89 */ |
|
90 TBool LoadTranslator( QString aFilename ); |
|
91 |
|
92 /** |
|
93 * Gets localization rows from database as table of CCaLocalizationEntries |
|
94 * @param aLocals pointers to localization entries |
|
95 */ |
|
96 void GetLocalizationRowsL( RPointerArray<CCaLocalizationEntry>& aLocals ); |
|
97 |
|
98 /** |
|
99 * Converts descriptor to const char* |
|
100 * @param aDescriptor descriptor with text to convert |
|
101 * @return pointer to const char containing text |
|
102 */ |
|
103 const char* DescriptorToStringL( const TDesC& aDescriptor ); |
|
104 |
|
105 /* |
|
106 * Not own |
|
107 */ |
|
108 CCaStorageProxy* iStorageProxy; |
|
109 |
|
110 /* |
|
111 * Own |
|
112 */ |
|
113 QTranslator* iTranslator; |
|
114 |
|
115 //CA_STORAGE_TEST_FRIEND_CLASS (TestCaLocalizerScanner) |
|
116 }; |
|
117 |
|
118 #endif // CALOCALSCANNERPROXY_H |