aknsettingitemlist.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name     : AknSettingItemList.h
00004 *  Part of  : Avkon
00005 *
00006 *  Description:
00007 *     Support for Setting Item Lists (See Selection Service specification)
00008 *               Contains setting item classes (whole hierarchy) and the 
00009 *               array classes used to set up the setting item listbox
00010 *  Version:
00011 *
00012 *  Copyright © 2002 Nokia Corporation.
00013 *  This material, including documentation and any related 
00014 *  computer programs, is protected by copyright controlled by 
00015 *  Nokia Corporation. All rights are reserved. Copying, 
00016 *  including reproducing, storing,  adapting or translating, any 
00017 *  or all of this material requires the prior written consent of 
00018 *  Nokia Corporation. This material also contains confidential 
00019 *  information which may not be disclosed to others without the 
00020 *  prior written consent of Nokia Corporation.
00021 * ============================================================================
00022 */
00023 
00024 #if !defined(__AKNSETTINGITEMLIST_H__)
00025 #define __AKNSETTINGITEMLIST_H__
00026 
00027 #include <in_sock.h>
00028 
00029 #include <AknControl.h>
00030 
00031 // For graphics API
00032 #include <gulicon.h>
00033 
00034 // For CEikFormattedListBox
00035 #include <eikfrlb.h>
00036 
00037 // For setting page
00038 #include <aknsettingpage.h>
00039 
00040 // For query stuff
00041 #include <aknqueryvaluetext.h>
00042 
00043 
00044 // Maximum length of the blanking text
00045 const TInt KMaxPasswordBlankingTextLength = 10;
00046 
00047 class CAknSettingItemExtension;
00048 
00049 
00058 class CAknSettingItem : public CBase, public MAknSettingPageObserver
00059         {
00060 
00061 friend class CAknSettingItemArray;
00062 
00063 public:
00064         enum TFlags
00065                 {
00066                 EIsHidden = 0x1,
00067                 EHasIcon = 0x2,
00068                 EIsNumberedStyle = 0x4,
00069         ENoProtection = 0x8,
00070         EViewOnly = 0x10,
00071         EProtected = 0x20
00072         };
00073         
00074         // Setting item protection states
00075    enum TSettingItemProtection
00076         {
00077         ENoSettingItemProtection,
00078         ESettingItemViewOnly,
00079         ESettingItemProtected
00080         };
00081 public:
00087         IMPORT_C CAknSettingItem( TInt identifier );
00088 
00092         IMPORT_C ~CAknSettingItem();
00093 
00099         IMPORT_C void ConstructL( 
00100                 const TBool aIsNumberedStyle,
00101                 const TInt aOrdinal, 
00102                 const TDesC& aSettingTitle, 
00103                 CArrayPtr<CGulIcon>* aIconArray,
00104                 const TInt aSettingPageResource, 
00105                 const TInt aEditorControlType,
00106                 const TInt aSettingEditorResource = 0, 
00107                 const TInt aAssociatedResource = 0 );
00108         
00116         IMPORT_C virtual void StoreL();
00117         /*
00118         * The external value is transferred to the internal value
00119         * This occurs at construction, but may be called by client code when required.
00120         */
00121         IMPORT_C virtual void LoadL(); 
00129         IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
00136         IMPORT_C virtual void UpdateListBoxTextL();
00137 
00142         IMPORT_C TPtrC SettingName();
00147         IMPORT_C TInt SettingNumber() const;
00152         IMPORT_C TBool IsHidden() const;
00157         IMPORT_C TBool IsNumberedStyle() const;
00165         IMPORT_C void SetHidden(TBool aHidden );
00166         /*
00167         * This method obtains the current value's setting text
00168         *
00169         * @return       Reference to descriptor with the text 
00170         */
00171         IMPORT_C virtual const TDesC& SettingTextL();
00177         IMPORT_C HBufC* ListBoxText();
00184         IMPORT_C TInt Identifier() const;
00189         IMPORT_C TBool HasIcon() const;
00195         IMPORT_C void SetEmptyItemTextL( const TDesC& aEmptyItemText );
00196         IMPORT_C void SetCompulsoryIndTextL( const TDesC& aCompulsoryInd );
00197 
00198         // From MAknSettingPageObserver
00199         IMPORT_C virtual void HandleSettingPageEventL(CAknSettingPage* aSettingPage,TAknSettingPageEvent aEventType );
00205         IMPORT_C TInt VisibleIndex();
00206 
00212         IMPORT_C void SetSettingPageFlags( TInt aFlagPattern);
00213 
00218         IMPORT_C TInt SettingPageFlags( ) const;
00219 
00226     void SetParentListBox( const CEikFormattedCellListBox* aListBox );
00227 
00245     IMPORT_C void SetProtectionState( CAknSettingItem::TSettingItemProtection aProtected );
00246 
00255     IMPORT_C CAknSettingItem::TSettingItemProtection ProtectionState();
00256 
00257 protected:
00258 
00259 
00265         IMPORT_C virtual void CompleteConstructionL();
00274         IMPORT_C virtual CFbsBitmap* CreateBitmapL();
00275 
00276 // Utilities
00285         IMPORT_C void SetSettingPage( CAknSettingPage* aSettingPage );
00286         /*
00287         * Access to the current setting page
00288         *
00289         * @return       pointer to the currently executing setting page. 0 if there is none
00290         */
00291         IMPORT_C CAknSettingPage* SettingPage() const;
00296         IMPORT_C void SetUpStandardSettingPageL();
00302         IMPORT_C TDesC& EmptyItemText() const; // Assumed only needs to be used by SettingTextL
00303 
00310         IMPORT_C TInt SettingPageResourceId() const;
00317         IMPORT_C TInt SettingEditorResourceId() const;
00324         IMPORT_C TInt AssociatedResourceId() const;
00330         TInt EditorControlType() const;
00331 
00345     IMPORT_C TBool SetIconMask( CFbsBitmap* aMask );
00346 
00357     CFbsBitmap* SetIconMaskAndReturnBitmap( CGulIcon* aIcon );
00358 private:
00363         void UpdateBitmapL();
00364 
00369         void SetVisibleIndex( TInt aVisibleIndex );
00370 
00376         void SetOrdinal( TInt aOrdinal );
00377 
00384         TPtrC ReplaceNonPrintingCharacters( TDes& aTextToClean );
00385 private:
00386         IMPORT_C void CAknSettingItem_Reserved();
00387 
00388 private:
00389         TUint iFlags;
00390         TInt iIdentifier;
00391         TInt iOrdinal;
00392         TInt iSettingIdentifier;
00393         TInt iSettingPageResourceId;
00394         TInt iEditorControlType;
00395         TInt iSettingEditorResourceId;
00396         TInt iAssociatedResourceId;
00397         TInt iIconIndex; // Only valid if relevant bit is set in iFlags
00398         HBufC* iEmptyItemText; // Owned 
00399 
00400         HBufC* iSettingName;  // Owned
00401         HBufC* iListBoxText;  // Owned
00402         HBufC* iCompulsoryText; // Owned
00403 
00404 
00405         // Following are not owned
00406         CAknSettingPage* iSettingPage; // This is a ref that is valid when non-0 - when the SP is "up"
00407         CArrayPtr<CGulIcon>* iIconArray;        // Reference to the array only !
00408 
00409         TInt iVisibleIndex;
00410         // Set flags that are in the Setting pages' constructors 
00411         TInt iSettingPageFlags;
00412 
00413     // Pointer to the listbox that the setting item is providing data to
00414     const CEikFormattedCellListBox* iParentListBox; // Not owned
00415 
00416         CAknSettingItemExtension* iExtension;
00417         };
00418 
00423 class CAknTextSettingItem : public CAknSettingItem
00424 {
00425 public:
00426         /*
00427         * Constructor 
00428         *
00429         * @param                resource identifier for this setting item
00430         * @param                Setting text
00431         *
00432         */
00433         IMPORT_C CAknTextSettingItem( TInt aIdentifier, TDes& aText );
00434 
00438         IMPORT_C ~CAknTextSettingItem();
00439 
00447         IMPORT_C virtual void StoreL();
00448 
00449         /*
00450         * The external value is transferred to the internal value
00451         * This occurs at construction, but may be called by client code when required.
00452         */
00453         IMPORT_C virtual void LoadL(); // Called from 2nd stage constructors
00454 
00455         /*
00456         * This method obtains the current value's setting text.
00457         * 
00458         * The reference is returned and is not a copy of the text, but refers to the current
00459         * internal text value. This is the value that would be externalized if StoreL were called. 
00460         * An exception to this is if the current text is zero length. In that case a reference to the 
00461         * empty text is returned (which would not be externalized if StoreL is called).
00462         *
00463         * @return       Reference to descriptor with the current internal text 
00464         */
00465         IMPORT_C virtual const TDesC& SettingTextL();
00466 
00474         IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
00475 
00476 protected:
00477 
00483         IMPORT_C TPtr& InternalTextPtr();
00484 
00490         IMPORT_C TPtrC ExternalText();
00491 
00499         IMPORT_C void SetExternalText( TDesC& aNewExternalText );
00500 private:
00501         IMPORT_C void CAknSettingItem_Reserved();
00502 
00503 private:
00504         TDes& iExternalText;
00505         HBufC* iInternalText;   // Owned
00506         TPtr iInternalTextPtr;
00507         TInt iSpare_Text_1;
00508 };
00509 
00510 
00518 class CAknIntegerSettingItem : public CAknSettingItem 
00519         {
00520         public:
00521         /*
00522         * Constructor 
00523         *
00524         * @param                resource identifier for this setting item
00525         * @param                integer value to edit. 
00526         *
00527         */
00528         IMPORT_C CAknIntegerSettingItem( TInt aIdentifier, TInt& aValue );
00529         IMPORT_C ~CAknIntegerSettingItem();
00530         
00538         IMPORT_C virtual void StoreL();
00539         /*
00540         * The external value is transferred to the internal value
00541         * This occurs at construction, but may be called by client code when required.
00542         */
00543         IMPORT_C virtual void LoadL();
00544 
00545         /*
00546         * This method obtains the current value's setting text
00547         *
00548         * @return       Reference to descriptor with the text 
00549         */
00550         IMPORT_C virtual const TDesC& SettingTextL();
00551 
00559         virtual void EditItemL( TBool aCalledFromMenu ) = 0;
00560 
00561         protected:
00567         IMPORT_C virtual void CompleteConstructionL();
00568 
00574         IMPORT_C TInt& InternalValueRef();
00575 
00582         IMPORT_C TInt& ExternalValueRef();
00583         
00589         IMPORT_C void SetExternalValue( TInt& aValue );
00590 private:
00591         IMPORT_C void CAknSettingItem_Reserved();
00592 
00593         private:
00594         TInt iInternalValue;
00595         TInt& iExternalValue;
00596         HBufC* iInternalText;   // Owned
00597         TPtr iInternalTextPtr;
00598         };
00599 
00600 
00601 class CAknIntegerEdwinSettingItem : public CAknIntegerSettingItem 
00602         {
00603         public:
00604         IMPORT_C CAknIntegerEdwinSettingItem( TInt aIdentifier, TInt& aValue );
00612         IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
00613 private:
00614         IMPORT_C void CAknSettingItem_Reserved();
00615         };
00616 
00622 class CAknPasswordSettingItem : public CAknTextSettingItem
00623 {
00624 public:
00625         enum TAknPasswordSettingItemMode
00626                 {
00627                 EAlpha,         // password held is alphanumeric
00628                 ENumeric        // password is numeric ( digits 0 - 9 only used )
00629                 };
00630 
00631         /*
00632         * Constructor 
00633         *
00634         * @param                resource identifier for this setting item
00635         * @param                password mode; text or numeric
00636         * @param                password to change
00637         */
00638         IMPORT_C CAknPasswordSettingItem( TInt aIdentifier, enum TAknPasswordSettingItemMode aMode, TDes& aPassword );
00639 
00640         /*
00641         * This method obtains the current value's setting text
00642         *
00643         * @return       Reference to descriptor with the text 
00644         */
00645         IMPORT_C virtual const TDesC& SettingTextL();
00653         IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
00654 
00655 protected:
00656 
00662         IMPORT_C virtual void CompleteConstructionL();
00663 private:
00664         IMPORT_C void CAknSettingItem_Reserved();
00665 
00666 private:
00667         TAknPasswordSettingItemMode iPasswordMode;
00668         // For holding the text to blank the setting item text
00669         TBuf<KMaxPasswordBlankingTextLength> iBlankingText;
00670         // For holding the resouce for a password query
00671         TInt iOldPasswordQueryResourceId;
00672 };
00673 
00674 
00679 class CAknVolumeSettingItem : public CAknSettingItem
00680         {
00681 public:
00682         /*
00683         * Constructor 
00684         *
00685         * @param                resource identifier for this setting item
00686         * @param                volume value. Must be in range 0 to 10, inclusive
00687         *
00688         */
00689         IMPORT_C CAknVolumeSettingItem( TInt aIdentifier, TInt& aExternalVolume );
00690         
00698         IMPORT_C virtual void StoreL();
00699         /*
00700         * The external value is transferred to the internal value
00701         * This occurs at construction, but may be called by client code when required.
00702         */
00703         IMPORT_C virtual void LoadL();
00704         /*
00705         * This method obtains the current value's setting text
00706         *
00707         * @return       Reference to descriptor with the text 
00708         */
00709         IMPORT_C virtual const TDesC& SettingTextL();
00717         IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
00718 
00719 protected:
00725         IMPORT_C TInt& InternalVolumeValue(); // For access to internal value for derived classes
00726 
00727         //From CAknSettingItem
00733         IMPORT_C virtual CFbsBitmap* CreateBitmapL();
00734 private:
00735         IMPORT_C void CAknSettingItem_Reserved();
00736 
00737 private:
00738         TInt& iExternalVolume;
00739         TInt iInternalVolume;
00740 
00741         };
00742 
00749 class CAknSliderSettingItem : public CAknSettingItem
00750         {
00751 public:
00752         /*
00753         * Constructor 
00754         *
00755         * @param                resource identifier for this setting item
00756         * @param                Slider value; must be within the minimum and maximum values in resource
00757         *
00758         */
00759         IMPORT_C CAknSliderSettingItem( TInt aIdentifier, TInt& aExternalSliderValue );
00760 
00768         IMPORT_C virtual void StoreL();
00769         /*
00770         * The external value is transferred to the internal value
00771         * This occurs at construction, but may be called by client code when required.
00772         */
00773         IMPORT_C virtual void LoadL(); 
00774         /*
00775         * This method obtains the current value's setting text
00776         *
00777         * @return       Reference to descriptor with the text 
00778         */
00779         IMPORT_C virtual const TDesC& SettingTextL();
00787         IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
00788 
00789 protected:
00793         IMPORT_C virtual CAknSettingPage* CreateSettingPageL();
00794 
00798         IMPORT_C virtual void CreateAndExecuteSettingPageL();
00799 
00805         IMPORT_C TInt& InternalSliderValue();
00806 
00807         // From CAknSettingItem
00813         IMPORT_C virtual CFbsBitmap* CreateBitmapL();
00814 private:
00815         IMPORT_C void CAknSettingItem_Reserved();
00816 
00817 private:
00818         TInt& iExternalSliderValue;
00819         TInt iInternalSliderValue; // required for use in derived classes
00820 
00821         };
00822 
00823         
00835 class CAknTimeOrDateSettingItem : public CAknSettingItem
00836         {
00837 public:
00838         enum TAknTimeOrDateSettingItemMode
00839                 {
00840                 ETime,
00841                 EDate
00842                 };
00843         /*
00844         * Constructor 
00845         *
00846         * @param                resource identifier for this setting item
00847         * @param                construct a Time or a Date setting item
00848         * @param                IP address to be controlled by the setting editing
00849         *
00850         */
00851         IMPORT_C CAknTimeOrDateSettingItem( TInt aIdentifier, enum TAknTimeOrDateSettingItemMode aMode, TTime& aTime );
00855         IMPORT_C ~CAknTimeOrDateSettingItem();
00861         IMPORT_C void CompleteConstructionL( );
00862         
00870         IMPORT_C virtual void StoreL();
00871         /*
00872         * The external value is transferred to the internal value
00873         * This occurs at construction, but may be called by client code when required.
00874         */
00875         IMPORT_C virtual void LoadL(); 
00876         /*
00877         * This method obtains the current value's setting text
00878         *
00879         * @return       Reference to descriptor with the text 
00880         */
00881         IMPORT_C virtual const TDesC& SettingTextL();
00889         IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
00896         IMPORT_C void SetTimeFormatStringL( const TDesC& aTimeFormat );
00903         IMPORT_C const TPtrC TimeFormatString();
00904 private:
00905         IMPORT_C void CAknSettingItem_Reserved();
00906 private:
00907         TTime& iExternalTime;
00908         TTime iInternalTime;
00909         HBufC* iInternalText; // Owned
00910         TPtr iInternalTextPtr;
00911         HBufC* iTimeFormat;
00912         TPtr iTimeFormatPtr;
00913         TAknTimeOrDateSettingItemMode iTimeOrDateMode;
00914         };
00915 
00916 
00917         
00929 class CAknTimeOffsetSettingItem : public CAknSettingItem
00930         {
00931 public:
00932         /*
00933         * Constructor 
00934         *
00935         * @param                resource identifier for this setting item
00936         * @param                construct a Time offset setting item
00937         *
00938         */
00939         IMPORT_C CAknTimeOffsetSettingItem( TInt aIdentifier, TTimeIntervalSeconds& aTime );
00943         IMPORT_C ~CAknTimeOffsetSettingItem();
00950         IMPORT_C void CompleteConstructionL( );
00951         
00961         IMPORT_C virtual void StoreL();
00962         /*
00963         * The external value is transferred to the internal value
00964         * This occurs at construction, but may be called by client code when required.
00965     *
00966     * 
00967         */
00968         IMPORT_C virtual void LoadL(); 
00969         /*
00970         * This method obtains the current value's setting text
00971         *
00972     * 
00973         * @return       Reference to descriptor with the text 
00974         */
00975         IMPORT_C virtual const TDesC& SettingTextL();
00984         IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
00992         IMPORT_C void SetTimeFormatStringL( const TDesC& aTimeFormat );
01000         IMPORT_C const TPtrC TimeFormatString();
01001 private:
01002         IMPORT_C void CAknSettingItem_Reserved();
01003 private:
01004         TTimeIntervalSeconds iExternalTime;
01005         TTimeIntervalSeconds iInternalTime;
01006         HBufC* iInternalText; // Owned
01007         TPtr iInternalTextPtr;
01008         HBufC* iTimeFormat;
01009         TPtr iTimeFormatPtr;
01010 
01011         TInt iSpare;
01012         };
01013 
01014 
01023 class CAknIpFieldSettingItem : public CAknSettingItem
01024         {
01025 public:
01026         /*
01027         * Constructor 
01028         *
01029         * @param                resource identifier for this setting item
01030         * @param                IP address to be controlled by the setting editing
01031         *
01032         */
01033         IMPORT_C CAknIpFieldSettingItem( TInt aIdentifier, TInetAddr& aIpAddress );
01039         IMPORT_C ~CAknIpFieldSettingItem();
01040         
01046         IMPORT_C void CompleteConstructionL( );
01047         
01055         IMPORT_C virtual void StoreL();
01056         /*
01057         * The external value is transferred to the internal value
01058         * This occurs at construction, but may be called by client code when required.
01059         *
01060         */
01061         IMPORT_C virtual void LoadL(); // Called from 2nd stage constructors
01062         /*
01063         * This method obtains the current value's setting text
01064         *
01065         * @return       Reference to descriptor with the text 
01066         */
01067         IMPORT_C virtual const TDesC& SettingTextL();
01075         IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
01076 private:
01077         IMPORT_C void CAknSettingItem_Reserved();
01078 
01079 private:
01080         TInetAddr& iExternalIpAddress;
01081         TInetAddr iInternalIpAddress;
01082         HBufC* iInternalText; // Owned
01083         TPtr iInternalTextPtr;
01084         };
01085 
01091 class CAknEnumeratedItemBase : public CBase
01092         {
01093 public:
01097         IMPORT_C CAknEnumeratedItemBase( TInt aEnumeratedValue, TAny* aValue );
01101         IMPORT_C ~CAknEnumeratedItemBase();
01107         IMPORT_C TInt EnumerationValue() const;
01113         IMPORT_C void SetEnumerationValue( TInt aNewValue );
01119         IMPORT_C TAny* Value() const;
01125         IMPORT_C void SetValue( TAny* aPtr );
01126 private:
01127         TInt iEnumerationValue;
01128         TAny* iValue;
01129         };
01130 
01131 
01136 template <class T>
01137 class CAknEnumeratedItem : public CAknEnumeratedItemBase
01138         {
01139 public:
01140         inline CAknEnumeratedItem( TInt aEnumeratedValue, T* aValue );
01141         inline ~CAknEnumeratedItem();
01142         inline T* Value();
01143         inline void SetValue( T* );
01144         };
01145 
01146 
01147 template <class T>
01148 inline CAknEnumeratedItem<T>::CAknEnumeratedItem( TInt aEnumValue, T* aValue ) : 
01149         CAknEnumeratedItemBase( aEnumValue, (TAny*)aValue)
01150         {
01151         }
01152 
01153 template <class T>
01154 inline CAknEnumeratedItem<T>::~CAknEnumeratedItem()
01155         {
01156         delete (T*)Value();
01157         }
01158 
01159 template <class T>
01160 inline T* CAknEnumeratedItem<T>::Value()
01161         {
01162         return ( ( T* ) CAknEnumeratedItemBase::Value() );
01163         }
01164 
01165 template <class T>
01166 inline void CAknEnumeratedItem<T>::SetValue( T* aNewValue )
01167         {
01168         CAknEnumeratedItemBase::SetValue( aNewValue );
01169         }
01170 
01171 
01172 
01176 typedef CAknEnumeratedItem<HBufC> CAknEnumeratedText;
01177 
01178 
01179 
01192 class CAknEnumeratedTextSettingItem : public CAknSettingItem
01193         {
01194 public:
01199         IMPORT_C CAknEnumeratedTextSettingItem( TInt aResourceId );
01200 
01204         IMPORT_C ~CAknEnumeratedTextSettingItem();
01205 
01206 //
01207 // From CAknSettingItem
01208 //
01209 protected:
01210 
01218         IMPORT_C void CompleteConstructionL();
01219 
01220 private:
01221         IMPORT_C void CAknSettingItem_Reserved();
01222 
01223 public:
01224 
01232         IMPORT_C CArrayPtr<CAknEnumeratedText>* EnumeratedTextArray() const;
01233 
01242         IMPORT_C CArrayPtr<HBufC>* PoppedUpTextArray() const;
01243 
01264         IMPORT_C void SetEnumeratedTextArrays( CArrayPtr<CAknEnumeratedText>* aEnumeratedTextArray,
01265                                                                                                         CArrayPtr<HBufC>* PoppedUpTextArray );
01271         IMPORT_C virtual void HandleTextArrayUpdateL();
01272         
01278         IMPORT_C TInt NumberOfItems() const;
01279 
01288         IMPORT_C TInt IndexFromValue( TInt aInputValue ) const;
01289 
01290 protected:
01291 
01299         IMPORT_C void SetSettingPageTextL();
01300 
01304         IMPORT_C CDesCArray* SettingPageTextArray() const;
01305 
01306 private:
01307 
01312         void DeleteAndZeroPrimaryArrays();
01313 
01314 private:
01315         TInt iTextPopupFlags;
01316         CArrayPtr<CAknEnumeratedText>* iEnumeratedTextArray; // Owned and pointed to objects are owned
01317         CArrayPtr<HBufC>* iPoppedUpTextArray; // Owned and the HBufCs are owned here
01318         TInt iEnumeratedTextArrayResourceId;
01319         TInt iPoppedUpTextArrayResourceId;
01320         CDesCArrayFlat* iSettingPageText; // Owned
01321         HBufC* iSpare; // Formerly space was used by iEmptyText;
01322         };
01323 
01324 
01325 
01337 class CAknEnumeratedTextPopupSettingItem : public CAknEnumeratedTextSettingItem
01338         {
01339 public:
01345         IMPORT_C CAknEnumeratedTextPopupSettingItem( TInt aResourceId, TInt& aValue );
01346 
01350         IMPORT_C ~CAknEnumeratedTextPopupSettingItem();
01351         
01359         IMPORT_C virtual void StoreL();
01360 
01361         /*
01362         * The external value is transferred to the internal value
01363         * This occurs at construction, but may be called by client code when required.
01364         */
01365         IMPORT_C virtual void LoadL(); 
01366 
01367         /*
01368         * This method obtains the current value's setting text
01369         *
01370         * @return       Reference to descriptor with the text 
01371         */
01372         IMPORT_C virtual const TDesC& SettingTextL();
01380         IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
01381 
01382 public:
01389         IMPORT_C CArrayPtr<CAknEnumeratedText>* EnumeratedTextArray() const;
01390 
01397         IMPORT_C CArrayPtr<HBufC>* PoppedUpTextArray() const;
01398 
01399 protected:
01404         IMPORT_C virtual CAknSettingPage* CreateSettingPageL();
01405 
01409         IMPORT_C virtual void CreateAndExecuteSettingPageL();
01410 
01416         IMPORT_C virtual void CompleteConstructionL();
01417 
01425         IMPORT_C void SetExternalValue( TInt aNewValue );
01431         IMPORT_C void SetInternalValue( TInt aNewValue );
01432 
01439         IMPORT_C void SetSelectedIndex( TInt aNewIndex );
01440 
01446         IMPORT_C TInt IndexFromValue( TInt aInputValue ) const ;
01447         
01452         IMPORT_C TInt ExternalValue() const;
01457         IMPORT_C TInt InternalValue() const;
01462         IMPORT_C MAknQueryValue* QueryValue() const;
01463 private:
01464         IMPORT_C void CAknSettingItem_Reserved();
01465 
01466 private:
01467         void SetSettingPageTextL();
01468         void CreateTextArrayL();
01469         void CreateQueryValueL();
01470         void UpdateInternalValuesL();
01479         TInt FindNextEnumerationValue() const;
01480 
01481 private:
01482         TInt& iExternalValue;
01483         TInt iInternalValue;
01484         TInt iNumberOfItems;
01485         TInt iSelectedIndex;
01486         CAknQueryValueText* iQueryValue;
01487         CAknQueryValueTextArray* iQueryTextArray; 
01488         TInt iSpare_EnumeratedTextPopup_1;
01489         };
01490 
01491 
01492 class CAknBinaryPopupSettingItem : public CAknEnumeratedTextPopupSettingItem
01493         {
01494 public:
01503         IMPORT_C CAknBinaryPopupSettingItem( TInt aIdentifier, TBool& aBinaryValue );
01504 
01512         IMPORT_C virtual void StoreL();
01513         /*
01514         * The external value is transferred to the internal value
01515         * This occurs at construction, but may be called by client code when required.
01516         */
01517         IMPORT_C virtual void LoadL(); 
01526         IMPORT_C virtual void EditItemL( TBool aCalledFromMenu );
01527 
01528 protected:
01534         IMPORT_C virtual void CompleteConstructionL();
01535 private:
01536         IMPORT_C void CAknSettingItem_Reserved();
01537 private:
01538         TAny* iUnused;
01539         };
01540 
01541 
01551 class CAknBigSettingItemBase : public CAknSettingItem
01552         {
01553 public:
01558         IMPORT_C CAknBigSettingItemBase( TInt aIdentifier );
01559 
01560 protected: 
01561         /*
01562         * This method obtains the current value's setting text
01563         *
01564         * @return       Reference to descriptor with the text 
01565         */
01566         IMPORT_C virtual const TDesC& SettingTextL();
01567 private:
01568         IMPORT_C void CAknSettingItem_Reserved();
01569 
01570 private:
01571         const TDesC& iEmptyString;
01572 
01573         };
01574 
01575 
01579 class CAknSettingItemArray : public CArrayPtrFlat<CAknSettingItem>, public MDesCArray
01580         {
01581 public:
01588         IMPORT_C CAknSettingItemArray( TInt aGranularity, TBool aIsNumbered, TInt aInitialOrdinal );
01592         IMPORT_C virtual ~CAknSettingItemArray();
01593 
01594         // from MDesC16Array
01599         IMPORT_C TInt MdcaCount() const;
01607         IMPORT_C TPtrC16 MdcaPoint(TInt aIndex) const;
01608         // For hidden item support
01616         IMPORT_C TInt ItemIndexFromVisibleIndex( TInt aVisibleIndex ) const;
01622         IMPORT_C virtual void RecalculateVisibleIndicesL();
01628         IMPORT_C void SetInitialOrdinal( TInt aInitialOrdinal );
01629         /*
01630         * Method used to transfer flags from the CAknSettingItemList to this array
01631         */
01632         IMPORT_C void SetFlags( TInt aFlags );
01633 protected:
01634 
01639         IMPORT_C void SetVisibleCount( TInt aCount );
01645         IMPORT_C TInt VisibleCount() const;
01646 
01647 private:
01648         TBool iIsNumbered;
01649         TInt iInitialOrdinal;
01650         TInt iVisibleCount;
01651         TInt iFlags;
01652         };
01653 
01654 
01655 class CAknSettingItemList : public CAknControl , public MEikListBoxObserver
01656     {
01657 public:
01658         enum TAknSettingItemStyle
01659         {
01660         ENumberedStyle,         // The setting item list displays number
01661         EUnnumberedStyle        // The setting item list does not disply number
01662         };
01663 
01664 public:
01668         IMPORT_C CAknSettingItemList();
01672         IMPORT_C ~CAknSettingItemList();
01673 
01674         // From CCoeControl
01678         IMPORT_C void ConstructFromResourceL(TInt aResourceId );
01682         IMPORT_C void ConstructFromResourceL( TResourceReader& aReader );
01683 
01687         IMPORT_C TInt CountComponentControls() const;
01692         IMPORT_C CCoeControl* ComponentControl(TInt aId ) const;
01693 
01697         IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
01701         IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow);
01702 
01710         IMPORT_C void HandleResourceChange(TInt aType);
01711 
01712 // from MEikListBoxObserver
01713         IMPORT_C virtual void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
01714 
01715 public:
01716         // Framework methods
01725         IMPORT_C virtual void EditItemL(TInt aIndex, TBool aCalledFromMenu);
01731         IMPORT_C virtual void LoadSettingsL();
01737         IMPORT_C virtual void StoreSettingsL(); //  call StoreL() on each item in MAknSettingItemArray
01738 
01743         IMPORT_C void SetIncludeHiddenInOrdinal( TBool aInclude );
01744 
01748         IMPORT_C TBool IsNumberedStyle();
01752         IMPORT_C CEikFormattedCellListBox* ListBox(); // get the listbox
01756         IMPORT_C CAknSettingItemArray* SettingItemArray() const;
01762         IMPORT_C void HandleChangeInItemArrayOrVisibilityL();
01767     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
01768 
01769 protected:
01778         IMPORT_C virtual CAknSettingItem* CreateSettingItemL( TInt aSettingId );
01779 private:
01783     IMPORT_C void* ExtensionInterface( TUid aInterface );
01784 
01785 private:
01786     void UpdateAllListBoxTextsL() const;
01787 
01788 private:
01789 
01790         // Owned objects:
01791         CEikFormattedCellListBox* iSettingItemListBox;
01792         CAknSettingItemArray* iSettingItemArray;
01793 
01794         // Other non-CBase classes 
01795         HBufC* iSettingItemListTitle;   // Owned
01796 
01797         // Internal information
01798         TInt iFlags;
01799         TInt iInitialOrdinal;
01800 
01801         TInt iSpare_1;
01802         TInt iSpare_2;
01803 };
01804 
01805 
01806 
01807 
01808 #endif

Copyright © Nokia Corporation 2001-2008
Back to top