|
1 /* |
|
2 * Copyright (c) 2006-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: CFContextSourceSettingsManagerImpl class declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CFCONTEXTSOURCESETTINGSMANAGERIMPL_H |
|
21 #define C_CFCONTEXTSOURCESETTINGSMANAGERIMPL_H |
|
22 |
|
23 |
|
24 #include "cfcontextsourcesettingsmanager.h" |
|
25 |
|
26 #include <GMXMLParser.h> |
|
27 |
|
28 class RFs; |
|
29 class CMDXMLNode; |
|
30 class CCFContextSourceSettingImpl; |
|
31 class CCFContextSourceSettingArrayImpl; |
|
32 |
|
33 /** |
|
34 * Context source settings manager. |
|
35 * Provides an interface through from a specified file can be parsed |
|
36 * XML format context source settings. |
|
37 * Returns settings fully parsed in an array. |
|
38 * |
|
39 * @lib CFContextSourceSettingsManagerImpl.lib |
|
40 * @since S60 4.0 |
|
41 */ |
|
42 NONSHARABLE_CLASS( CCFContextSourceSettingsManagerImpl ): |
|
43 public CCFContextSourceSettingsManager, |
|
44 public MMDXMLParserObserver |
|
45 { |
|
46 public: |
|
47 |
|
48 // Two phased constrcutors |
|
49 IMPORT_C static CCFContextSourceSettingsManagerImpl* NewL( RFs& aFs ); |
|
50 IMPORT_C static CCFContextSourceSettingsManagerImpl* NewLC( RFs& aFs ); |
|
51 |
|
52 // Destructor |
|
53 ~CCFContextSourceSettingsManagerImpl(); |
|
54 |
|
55 private: // From base classes |
|
56 |
|
57 // @see CCFContextSourceSettingsManager |
|
58 void ParseSettingsL( const TDesC& aSettingsFile, |
|
59 CCFContextSourceSettingArray& aSettings ); |
|
60 |
|
61 // @see CCFContextSourceSettingsManager |
|
62 void ParseSettingsL( RFile& aSettingsFile, |
|
63 CCFContextSourceSettingArray& aSettings ); |
|
64 |
|
65 // @see MMDXMLParserObserver |
|
66 void ParseFileCompleteL(); |
|
67 |
|
68 private: // New methods |
|
69 |
|
70 // Parses setting block |
|
71 void ParseSettingBlockL( CMDXMLElement& aElement ); |
|
72 |
|
73 // Parses attributes |
|
74 void ParseAttributesL( CMDXMLElement& aElement, |
|
75 CCFContextSourceSettingImpl& aSetting ); |
|
76 |
|
77 // Parse parameters |
|
78 void ParseParametersL( CMDXMLElement& aElement, |
|
79 CCFContextSourceSettingImpl& aSetting ); |
|
80 |
|
81 private: |
|
82 |
|
83 CCFContextSourceSettingsManagerImpl( RFs& aFs ); |
|
84 void ConstructL(); |
|
85 |
|
86 private: // Data |
|
87 |
|
88 // Own: Wait to synchronize async XML file parsing |
|
89 CActiveSchedulerWait* iWait; |
|
90 |
|
91 // Own: Fs Session |
|
92 RFs& iFs; |
|
93 |
|
94 // Own: XML parser |
|
95 CMDXMLParser* iParser; |
|
96 |
|
97 // Ref: Pointer to settings array to fill |
|
98 CCFContextSourceSettingArrayImpl* iSettings; |
|
99 }; |
|
100 |
|
101 #endif |