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