|
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: AknConf setting list component |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_AKNCONFSETTINGLIST_H |
|
20 #define C_AKNCONFSETTINGLIST_H |
|
21 |
|
22 |
|
23 #include <aknsettingitemlist.h> |
|
24 |
|
25 class CRepository; |
|
26 |
|
27 /** |
|
28 * AknConf setting list component |
|
29 */ |
|
30 class CAknConfSettingList : public CAknSettingItemList |
|
31 { |
|
32 |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Destructor. |
|
37 */ |
|
38 ~CAknConfSettingList(); |
|
39 |
|
40 /** |
|
41 * Setting item calls this when the opened setting page is closed. |
|
42 * |
|
43 * @param aOkPressed ETrue if ok was pressed. |
|
44 * @param aValue New value of the setting. |
|
45 * @param aCenRepKey The setting cen rep key. |
|
46 */ |
|
47 void SettingPageClosed( TBool aOkPressed, |
|
48 const TInt& aValue, |
|
49 const TInt& aCenRepKey ); |
|
50 |
|
51 /** |
|
52 * Resets the cenrep values to initial state. |
|
53 */ |
|
54 virtual void ResetValues() = 0; |
|
55 |
|
56 // from base class CAknSettingItemList |
|
57 |
|
58 /** |
|
59 * Framework method to create a setting item based upon the user id aSettingId. The |
|
60 * client code decides what type to contruct. new (ELeave) must then be used and the resulting |
|
61 * pointer returned. Ownership is thereafter base class's responsiblity. |
|
62 * |
|
63 * @param aSettingId ID to use to determine the type of the setting item |
|
64 * @return a constructed (not 2nd-stage constructed) setting item. |
|
65 */ |
|
66 CAknSettingItem* CreateSettingItemL( TInt aIdentifier ); |
|
67 |
|
68 protected: |
|
69 |
|
70 CAknConfSettingList(); |
|
71 |
|
72 /** |
|
73 * Symbian second phase constructor. Should be used by sub classes. |
|
74 * |
|
75 * @param aCenRepUid Central repository UID. |
|
76 * @param aResourceFile Resource file to be added to CONE. |
|
77 */ |
|
78 void ConstructL( |
|
79 const TUid& aCenRepUid, |
|
80 const TDesC& aResourceFile ); |
|
81 |
|
82 /** |
|
83 * Returns the pointer to data value that corresponds the setting id. |
|
84 * Provides also the setting cen rep key. |
|
85 * |
|
86 * @param aId ID to determine the type of the setting item. |
|
87 * @param aCenRepKey Setting cen rep key. |
|
88 * @return Pointer to data value. |
|
89 */ |
|
90 virtual TInt* DataValuePointer( const TInt& aId, TInt& aCenRepKey ) = 0; |
|
91 |
|
92 /** |
|
93 * Gets and sets setting value from cenrep according to given setting id. |
|
94 * |
|
95 * @param aId ID to determine the type of the setting item. |
|
96 * @param aCenRepKey Setting cen rep key. |
|
97 * @return Pointer to setting value. |
|
98 */ |
|
99 TInt* ValueFromCenRep( const TInt& aId, TInt& aCenRepKey ); |
|
100 |
|
101 protected: |
|
102 |
|
103 /** |
|
104 * Central repository. |
|
105 * Own. |
|
106 */ |
|
107 CRepository* iCenRep; |
|
108 |
|
109 /** |
|
110 * Resource file offset value. |
|
111 */ |
|
112 TInt iResourceOffset; |
|
113 |
|
114 }; |
|
115 |
|
116 #endif // C_AKNCONFSETTINGLIST_H |