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" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 #if !defined(__E32STD_H__)
22 #if !defined(__E32BASE_H__)
27 class CApaSystemControl;
28 class CApaSystemControlList;
30 // classes referenced:
32 class CApaMaskedBitmap;
36 Calls the control DLL's first ordinal function to create and run the control.
38 The function leaves with KErrBadLibraryEntryPoint if the ordinal 1 function
44 typedef TInt (*ApaRunSystemControl)(const TDesC&);
51 #define KUidSystemControlDll KUidSystemControlDll16
53 #define KUidSystemControlDll KUidSystemControlDll8
60 const TInt KSystemControlDllUidValue8=0x10000297;
66 const TUid KUidSystemControlDll8={KSystemControlDllUidValue8};
72 const TUid KUidSystemControlDll16={0x10003A34};
75 class CApaSystemControl : public CBase
76 /** Wrapper to a control panel application.
78 An instance of the class represents a control panel application. It is also a cache for the control's icon and caption.
80 An instance of the wrapper can only be constructed by the control panel application list, which
81 is a CApaSystemControlList object.
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;
94 static CApaSystemControl* NewL(RFs& aFs,const TDesC& aFullPath,const TUidType aUidType);
97 CApaSystemControl(RFs& aFs);
98 void ConstructL(const TDesC& aFullPath,const TUidType aUidType);
100 CApaSystemControl* iNext;
102 HBufC* iShortCaption;
103 CApaMaskedBitmap* iIcon;
104 TBool iExists; // used during updating
109 friend class CApaSystemControlList;
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.
120 @see CApaSystemControl
126 IMPORT_C static CApaSystemControlList* NewL(RFs& aFs);
127 IMPORT_C ~CApaSystemControlList();
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;
134 IMPORT_C void UpdateL();
135 inline TInt UpdateCount()const;
137 CApaSystemControlList(RFs& aFs);
138 CApaSystemControl* PreviousControl(const CApaSystemControl* aControl) const;
142 CApaSystemControl* iControl;
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.
155 @return The number of times the control panel application list has been changed. */
156 { return iUpdateCount; }