|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 */ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <e32std.h> |
|
23 #include <e32debug.h> |
|
24 #include <bacntf.h> |
|
25 #include <bautils.h> |
|
26 #include <e32const.h> |
|
27 #include <centralrepository.h> |
|
28 |
|
29 |
|
30 // |
|
31 // UID to identify a publish/subscribe used to indicate |
|
32 // progress of locale initialisation and prevent repeated |
|
33 //initialisation. |
|
34 const TInt32 KUidLocalePersistProperties = 0x1020E4D2 ; |
|
35 |
|
36 _LIT(KLocaleInitPanic, "Locale Initialisation: "); |
|
37 |
|
38 // |
|
39 // Publish subscribe keys associated with locale initialisation. |
|
40 enum LocalePersistPropertyKeys |
|
41 { |
|
42 EInitialisationState // Only one property in use at the moment |
|
43 }; |
|
44 |
|
45 // |
|
46 // Possible values of publish subscribe key EInitialisationState |
|
47 enum LocalePersistInitialisationState |
|
48 { |
|
49 ELocaleInitialisationInProgress, |
|
50 ELocaleInitialisationComplete, |
|
51 ELocaleInitialisationFailed |
|
52 }; |
|
53 |
|
54 |
|
55 |
|
56 // |
|
57 // class CExtendedLocaleManager |
|
58 // |
|
59 // Initialises system-wide locale data and then persists |
|
60 // new values to a repository on changes. |
|
61 class CExtendedLocaleManager : CBase |
|
62 { |
|
63 public: |
|
64 static CExtendedLocaleManager* NewL(); |
|
65 static CExtendedLocaleManager* NewLC(); |
|
66 CExtendedLocaleManager(); |
|
67 ~CExtendedLocaleManager(); |
|
68 |
|
69 |
|
70 private: |
|
71 void ConstructL(); |
|
72 static TInt LocaleChanged(TAny*) ; |
|
73 void PersistLocaleL() ; |
|
74 void InitialiseLocaleL(CRepository& aRepository) ; |
|
75 |
|
76 private: |
|
77 CEnvironmentChangeNotifier* iChangeNotifier ; |
|
78 CActiveScheduler* iActiveScheduler ; |
|
79 TExtendedLocale iExtendedLocale; |
|
80 }; |