AknCheckBoxSettingPage.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name     : AknCheckBoxSettingPage.h
00004 *  Part of  : Avkon
00005 *
00006 *  Description:
00007 *  Check box list support for setting page in editable state
00008 *
00009 *  Version:
00010 *
00011 *  Copyright © 2002 Nokia Corporation.
00012 *  This material, including documentation and any related 
00013 *  computer programs, is protected by copyright controlled by 
00014 *  Nokia Corporation. All rights are reserved. Copying, 
00015 *  including reproducing, storing,  adapting or translating, any 
00016 *  or all of this material requires the prior written consent of 
00017 *  Nokia Corporation. This material also contains confidential 
00018 *  information which may not be disclosed to others without the 
00019 *  prior written consent of Nokia Corporation.
00020 */
00021 
00022 #ifndef __AKNCHECKBOXSETTINGPAGE_H__
00023 #define __AKNCHECKBOXSETTINGPAGE_H__ 
00024 
00025 
00026 #include <aknlistboxsettingpage.h>
00027 
00028 // forward declare
00029 class CAknCheckBoxSettingPageExtension;
00030 
00037 class CSelectableItem : public CBase
00038 {
00039 public :
00045         IMPORT_C CSelectableItem( TDesC& aItemText, TBool aSelected  );
00049         virtual ~CSelectableItem();
00050 
00055         IMPORT_C void ConstructL();
00056 
00062         IMPORT_C void SetSelectionStatus( TBool aSelected );
00063 
00068         IMPORT_C TBool SelectionStatus();
00069 
00074         IMPORT_C TPtrC ItemText();
00075 
00076 private:
00077         TDesC& iDesC;   // Holds the reference to the descriptor prior to construction
00078         HBufC* iItem;   // This is on the heap and is used post constuction
00079         TBool iSelected;
00080 };
00081 
00082 
00087 class CSelectionItemList : public CArrayPtrFlat<CSelectableItem>, public MDesCArray
00088         {
00089 public:
00093         IMPORT_C CSelectionItemList( TInt Granularity );
00094 // from MDesCArray
00095 
00101         IMPORT_C TInt MdcaCount() const;
00102 
00107         IMPORT_C TPtrC MdcaPoint(TInt aIndex) const;
00108         };
00109 
00110 
00111 
00118 class CAknCheckBoxSettingPage : public CAknListBoxSettingPage
00119 {
00120 public:
00121         IMPORT_C CAknCheckBoxSettingPage(TInt aResourceID, CSelectionItemList* aItemArray );
00149         IMPORT_C CAknCheckBoxSettingPage(       const TDesC* aSettingTitleText, 
00150                                                                 TInt aSettingNumber, 
00151                                                                 TInt aControlType,
00152                                                                 TInt aEditorResourceId, 
00153                                                                 TInt aSettingPageResourceId,
00154                                                                 CSelectionItemList* aItemArray );
00155 
00156 
00161         IMPORT_C virtual void ConstructL();
00162 
00169         IMPORT_C CAknSetStyleListBox* ListBoxControl() const;
00170 
00176         IMPORT_C void SetSelectionItemArrayL( CSelectionItemList* aItemArray );
00177 
00178 // From MEikListBoxObserver
00185         IMPORT_C virtual void HandleListBoxEventL(CEikListBox* aListBox,
00186                                  MEikListBoxObserver::TListBoxEvent aEventType);
00187 
00192     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00193     
00194     IMPORT_C void HandleResourceChange(TInt aType);
00195 
00196 protected:
00200         IMPORT_C virtual ~CAknCheckBoxSettingPage();
00201 
00206         IMPORT_C virtual void UpdateSettingL();
00207 
00212         IMPORT_C void DynamicInitL();
00213 
00214         // From MEikCommandObserver
00215         IMPORT_C virtual void ProcessCommandL(TInt aCommandId);
00216         /*
00217         * This method is called upon Select command id.  It should change the setting but not exit in
00218         * this case.
00219         */
00220         IMPORT_C virtual void SelectCurrentItemL();
00221 
00222 //
00223 // CoeControl Framework and reserved methods
00224 //
00225 protected:
00226 
00234         IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
00235 private:
00239     IMPORT_C void* ExtensionInterface( TUid aInterface );
00240 
00241 private:
00245         IMPORT_C virtual void Reserved_2();
00246 
00250 private: 
00251         IMPORT_C virtual void CAknSettingPage_Reserved_1();
00252         IMPORT_C virtual void CAknSettingPage_Reserved_2();
00253 
00254 private:
00259         IMPORT_C virtual void CAknListBoxSettingPage_Reserved_1();
00260 
00261 private:
00262         void UpdateAllSelections();
00263         void SetAllSelectionsL();
00264         void ToggleSelectionL();
00265 
00270         void GenerateInternalArrayAndGiveToListBoxL();
00271         
00272         void CreateCheckBoxBitmapsL();
00273 
00274         CDesCArrayFlat* iInternalItemArray;     
00275 
00276         // the following are not owned
00277         CSelectionItemList* iItemArray; 
00278 
00279     CAknCheckBoxSettingPageExtension* iExtension; // owned
00280 };
00281 
00282 #endif 

Copyright © Nokia Corporation 2001-2007
Back to top