1.1 --- a/epoc32/include/apgctl.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/apgctl.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,160 @@
1.4 -apgctl.h
1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __APGCTL_H__
1.21 +#define __APGCTL_H__
1.22 +
1.23 +#if !defined(__E32STD_H__)
1.24 +#include <e32std.h>
1.25 +#endif
1.26 +#if !defined(__E32BASE_H__)
1.27 +#include <e32base.h>
1.28 +#endif
1.29 +
1.30 +// classes defined:
1.31 +class CApaSystemControl;
1.32 +class CApaSystemControlList;
1.33 +//
1.34 +// classes referenced:
1.35 +class RFs;
1.36 +class CApaMaskedBitmap;
1.37 +//
1.38 +
1.39 +/**
1.40 +Calls the control DLL's first ordinal function to create and run the control.
1.41 +
1.42 +The function leaves with KErrBadLibraryEntryPoint if the ordinal 1 function
1.43 +cannot be found.
1.44 +
1.45 +@publishedAll
1.46 +@released
1.47 +*/
1.48 +typedef TInt (*ApaRunSystemControl)(const TDesC&);
1.49 +
1.50 +/**
1.51 +@publishedAll
1.52 +@released
1.53 +*/
1.54 +#ifdef _UNICODE
1.55 +#define KUidSystemControlDll KUidSystemControlDll16
1.56 +#else
1.57 +#define KUidSystemControlDll KUidSystemControlDll8
1.58 +#endif
1.59 +
1.60 +/**
1.61 +@publishedAll
1.62 +@deprecated
1.63 +*/
1.64 +const TInt KSystemControlDllUidValue8=0x10000297;
1.65 +
1.66 +/**
1.67 +@publishedAll
1.68 +@deprecated
1.69 +*/
1.70 +const TUid KUidSystemControlDll8={KSystemControlDllUidValue8};
1.71 +
1.72 +/**
1.73 +@publishedAll
1.74 +@released
1.75 +*/
1.76 +const TUid KUidSystemControlDll16={0x10003A34};
1.77 +
1.78 +
1.79 +class CApaSystemControl : public CBase
1.80 +/** Wrapper to a control panel application.
1.81 +
1.82 +An instance of the class represents a control panel application. It is also a cache for the control's icon and caption.
1.83 +
1.84 +An instance of the wrapper can only be constructed by the control panel application list, which
1.85 +is a CApaSystemControlList object.
1.86 +
1.87 +@publishedAll
1.88 +@released */
1.89 + {
1.90 +public:
1.91 + IMPORT_C void CreateL();
1.92 + IMPORT_C TUid Type()const;
1.93 + IMPORT_C TFileName FileName()const;
1.94 + IMPORT_C CApaMaskedBitmap* Icon()const; // one size of icon, 48x48?
1.95 + IMPORT_C TPtrC Caption()const;
1.96 + IMPORT_C TPtrC ShortCaption()const;
1.97 +private:
1.98 + static CApaSystemControl* NewL(RFs& aFs,const TDesC& aFullPath,const TUidType aUidType);
1.99 + ~CApaSystemControl();
1.100 +
1.101 + CApaSystemControl(RFs& aFs);
1.102 + void ConstructL(const TDesC& aFullPath,const TUidType aUidType);
1.103 +private:
1.104 + CApaSystemControl* iNext;
1.105 + HBufC* iCaption;
1.106 + HBufC* iShortCaption;
1.107 + CApaMaskedBitmap* iIcon;
1.108 + TBool iExists; // used during updating
1.109 + TFileName iFullPath;
1.110 + TUidType iUidType;
1.111 + RFs& iFs;
1.112 +
1.113 + friend class CApaSystemControlList;
1.114 + };
1.115 +
1.116 +
1.117 +
1.118 +class CApaSystemControlList : public CBase
1.119 +/** Provides a list of all available control panel applications present on the phone.
1.120 +This class is implemented as a linked list of CApaSystemControl. Updates the control panel application list by removing
1.121 +control panels that no longer exist, adding new control panels found to the control panel application list and replacing
1.122 +a control panel if found in an earlier drive.
1.123 +
1.124 +@see CApaSystemControl
1.125 +@publishedPartner
1.126 +@released
1.127 +*/
1.128 + {
1.129 +public:
1.130 + IMPORT_C static CApaSystemControlList* NewL(RFs& aFs);
1.131 + IMPORT_C ~CApaSystemControlList();
1.132 +
1.133 + IMPORT_C TInt Count()const;
1.134 + IMPORT_C TInt Index(TUid aType)const;
1.135 + IMPORT_C CApaSystemControl* Control(TInt aIndex)const;
1.136 + IMPORT_C CApaSystemControl* Control(TUid aType)const;
1.137 +
1.138 + IMPORT_C void UpdateL();
1.139 + inline TInt UpdateCount()const;
1.140 +private:
1.141 + CApaSystemControlList(RFs& aFs);
1.142 + CApaSystemControl* PreviousControl(const CApaSystemControl* aControl) const;
1.143 +private:
1.144 + TInt iUpdateCount;
1.145 + RFs& iFs;
1.146 + CApaSystemControl* iControl;
1.147 + };
1.148 +
1.149 +
1.150 +//
1.151 +// inlines
1.152 +//
1.153 +
1.154 +
1.155 +inline TInt CApaSystemControlList::UpdateCount()const
1.156 +/** Gets the number of times the control panel application list has been
1.157 +updated (by calling UpdateL()). It returns 1 for a newly created list.
1.158 +
1.159 +@return The number of times the control panel application list has been changed. */
1.160 + { return iUpdateCount; }
1.161 +
1.162 +
1.163 +
1.164 +#endif