|
1 // Copyright (c) 1997-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 the License "Symbian Foundation License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __APGCTL_H__ |
|
17 #define __APGCTL_H__ |
|
18 |
|
19 #if !defined(__E32STD_H__) |
|
20 #include <e32std.h> |
|
21 #endif |
|
22 #if !defined(__E32BASE_H__) |
|
23 #include <e32base.h> |
|
24 #endif |
|
25 |
|
26 // classes defined: |
|
27 class CApaSystemControl; |
|
28 class CApaSystemControlList; |
|
29 // |
|
30 // classes referenced: |
|
31 class RFs; |
|
32 class CApaMaskedBitmap; |
|
33 // |
|
34 |
|
35 /** |
|
36 Calls the control DLL's first ordinal function to create and run the control. |
|
37 |
|
38 The function leaves with KErrBadLibraryEntryPoint if the ordinal 1 function |
|
39 cannot be found. |
|
40 |
|
41 @publishedAll |
|
42 @released |
|
43 */ |
|
44 typedef TInt (*ApaRunSystemControl)(const TDesC&); |
|
45 |
|
46 /** |
|
47 @publishedAll |
|
48 @released |
|
49 */ |
|
50 #ifdef _UNICODE |
|
51 #define KUidSystemControlDll KUidSystemControlDll16 |
|
52 #else |
|
53 #define KUidSystemControlDll KUidSystemControlDll8 |
|
54 #endif |
|
55 |
|
56 /** |
|
57 @publishedAll |
|
58 @deprecated |
|
59 */ |
|
60 const TInt KSystemControlDllUidValue8=0x10000297; |
|
61 |
|
62 /** |
|
63 @publishedAll |
|
64 @deprecated |
|
65 */ |
|
66 const TUid KUidSystemControlDll8={KSystemControlDllUidValue8}; |
|
67 |
|
68 /** |
|
69 @publishedAll |
|
70 @released |
|
71 */ |
|
72 const TUid KUidSystemControlDll16={0x10003A34}; |
|
73 |
|
74 |
|
75 class CApaSystemControl : public CBase |
|
76 /** Wrapper to a control panel application. |
|
77 |
|
78 An instance of the class represents a control panel application. It is also a cache for the control's icon and caption. |
|
79 |
|
80 An instance of the wrapper can only be constructed by the control panel application list, which |
|
81 is a CApaSystemControlList object. |
|
82 |
|
83 @publishedAll |
|
84 @released */ |
|
85 { |
|
86 public: |
|
87 IMPORT_C void CreateL(); |
|
88 IMPORT_C TUid Type()const; |
|
89 IMPORT_C TFileName FileName()const; |
|
90 IMPORT_C CApaMaskedBitmap* Icon()const; // one size of icon, 48x48? |
|
91 IMPORT_C TPtrC Caption()const; |
|
92 IMPORT_C TPtrC ShortCaption()const; |
|
93 private: |
|
94 static CApaSystemControl* NewL(RFs& aFs,const TDesC& aFullPath,const TUidType aUidType); |
|
95 ~CApaSystemControl(); |
|
96 |
|
97 CApaSystemControl(RFs& aFs); |
|
98 void ConstructL(const TDesC& aFullPath,const TUidType aUidType); |
|
99 private: |
|
100 CApaSystemControl* iNext; |
|
101 HBufC* iCaption; |
|
102 HBufC* iShortCaption; |
|
103 CApaMaskedBitmap* iIcon; |
|
104 TBool iExists; // used during updating |
|
105 TFileName iFullPath; |
|
106 TUidType iUidType; |
|
107 RFs& iFs; |
|
108 |
|
109 friend class CApaSystemControlList; |
|
110 }; |
|
111 |
|
112 |
|
113 |
|
114 class CApaSystemControlList : public CBase |
|
115 /** Provides a list of all available control panel applications present on the phone. |
|
116 This class is implemented as a linked list of CApaSystemControl. Updates the control panel application list by removing |
|
117 control panels that no longer exist, adding new control panels found to the control panel application list and replacing |
|
118 a control panel if found in an earlier drive. |
|
119 |
|
120 @see CApaSystemControl |
|
121 @publishedPartner |
|
122 @released |
|
123 */ |
|
124 { |
|
125 public: |
|
126 IMPORT_C static CApaSystemControlList* NewL(RFs& aFs); |
|
127 IMPORT_C ~CApaSystemControlList(); |
|
128 |
|
129 IMPORT_C TInt Count()const; |
|
130 IMPORT_C TInt Index(TUid aType)const; |
|
131 IMPORT_C CApaSystemControl* Control(TInt aIndex)const; |
|
132 IMPORT_C CApaSystemControl* Control(TUid aType)const; |
|
133 |
|
134 IMPORT_C void UpdateL(); |
|
135 inline TInt UpdateCount()const; |
|
136 private: |
|
137 CApaSystemControlList(RFs& aFs); |
|
138 CApaSystemControl* PreviousControl(const CApaSystemControl* aControl) const; |
|
139 private: |
|
140 TInt iUpdateCount; |
|
141 RFs& iFs; |
|
142 CApaSystemControl* iControl; |
|
143 }; |
|
144 |
|
145 |
|
146 // |
|
147 // inlines |
|
148 // |
|
149 |
|
150 |
|
151 inline TInt CApaSystemControlList::UpdateCount()const |
|
152 /** Gets the number of times the control panel application list has been |
|
153 updated (by calling UpdateL()). It returns 1 for a newly created list. |
|
154 |
|
155 @return The number of times the control panel application list has been changed. */ |
|
156 { return iUpdateCount; } |
|
157 |
|
158 |
|
159 |
|
160 #endif |