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 00048 00057 class CAknSettingItem : public CBase, public MAknSettingPageObserver 00058 { 00059 00060 friend class CAknSettingItemArray; 00061 00062 public: 00063 enum TFlags 00064 { 00065 EIsHidden = 0x1, 00066 EHasIcon = 0x2, 00067 EIsNumberedStyle = 0x4 00068 #start_since SINCE_3_1_SDK 00069 ,ENoProtection = 0x8, 00070 EViewOnly = 0x10, 00071 EProtected = 0x20 00072 #end_since SINCE_3_1_SDK 00073 }; 00074 00075 #start_since SINCE_3_1_SDK 00076 00080 enum TSettingItemProtection 00081 { 00082 ENoSettingItemProtection, 00083 ESettingItemViewOnly, 00084 ESettingItemProtected 00085 }; 00086 #end_since SINCE_3_1_SDK 00087 00088 public: 00094 IMPORT_C CAknSettingItem( TInt identifier ); 00095 00099 IMPORT_C ~CAknSettingItem(); 00100 00106 IMPORT_C void ConstructL( 00107 const TBool aIsNumberedStyle, 00108 const TInt aOrdinal, 00109 const TDesC& aSettingTitle, 00110 CArrayPtr<CGulIcon>* aIconArray, 00111 const TInt aSettingPageResource, 00112 const TInt aEditorControlType, 00113 const TInt aSettingEditorResource = 0, 00114 const TInt aAssociatedResource = 0 ); 00115 00123 IMPORT_C virtual void StoreL(); 00124 /* 00125 * The external value is transferred to the internal value 00126 * This occurs at construction, but may be called by client code when required. 00127 */ 00128 IMPORT_C virtual void LoadL(); 00136 IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); 00143 IMPORT_C virtual void UpdateListBoxTextL(); 00144 00149 IMPORT_C TPtrC SettingName(); 00154 IMPORT_C TInt SettingNumber() const; 00159 IMPORT_C TBool IsHidden() const; 00164 IMPORT_C TBool IsNumberedStyle() const; 00172 IMPORT_C void SetHidden(TBool aHidden ); 00173 /* 00174 * This method obtains the current value's setting text 00175 * 00176 * @return Reference to descriptor with the text 00177 */ 00178 IMPORT_C virtual const TDesC& SettingTextL(); 00184 IMPORT_C HBufC* ListBoxText(); 00191 IMPORT_C TInt Identifier() const; 00196 IMPORT_C TBool HasIcon() const; 00202 IMPORT_C void SetEmptyItemTextL( const TDesC& aEmptyItemText ); 00203 IMPORT_C void SetCompulsoryIndTextL( const TDesC& aCompulsoryInd ); 00204 00205 // From MAknSettingPageObserver 00206 IMPORT_C virtual void HandleSettingPageEventL(CAknSettingPage* aSettingPage,TAknSettingPageEvent aEventType ); 00212 IMPORT_C TInt VisibleIndex(); 00213 00219 IMPORT_C void SetSettingPageFlags( TInt aFlagPattern); 00220 00225 IMPORT_C TInt SettingPageFlags( ) const; 00226 00233 void SetParentListBox( const CEikFormattedCellListBox* aListBox ); 00234 00235 #start_since SINCE_3_1_SDK 00236 00254 IMPORT_C void SetProtectionState( CAknSettingItem::TSettingItemProtection aProtected ); 00255 #end_since SINCE_3_1_SDK 00256 #start_since SINCE_3_1_SDK 00257 00266 IMPORT_C CAknSettingItem::TSettingItemProtection ProtectionState(); 00267 #end_since SINCE_3_1_SDK 00268 protected: 00269 00270 00276 IMPORT_C virtual void CompleteConstructionL(); 00285 IMPORT_C virtual CFbsBitmap* CreateBitmapL(); 00286 00287 // Utilities 00296 IMPORT_C void SetSettingPage( CAknSettingPage* aSettingPage ); 00297 /* 00298 * Access to the current setting page 00299 * 00300 * @return pointer to the currently executing setting page. 0 if there is none 00301 */ 00302 IMPORT_C CAknSettingPage* SettingPage() const; 00307 IMPORT_C void SetUpStandardSettingPageL(); 00313 IMPORT_C TDesC& EmptyItemText() const; // Assumed only needs to be used by SettingTextL 00314 00321 IMPORT_C TInt SettingPageResourceId() const; 00328 IMPORT_C TInt SettingEditorResourceId() const; 00335 IMPORT_C TInt AssociatedResourceId() const; 00341 TInt EditorControlType() const; 00342 00356 IMPORT_C TBool SetIconMask( CFbsBitmap* aMask ); 00357 00368 CFbsBitmap* SetIconMaskAndReturnBitmap( CGulIcon* aIcon ); 00369 private: 00374 void UpdateBitmapL(); 00375 00380 void SetVisibleIndex( TInt aVisibleIndex ); 00381 00387 void SetOrdinal( TInt aOrdinal ); 00388 00395 TPtrC ReplaceNonPrintingCharacters( TDes& aTextToClean ); 00396 private: 00397 IMPORT_C void CAknSettingItem_Reserved(); 00398 00399 private: 00400 TUint iFlags; 00401 TInt iIdentifier; 00402 TInt iOrdinal; 00403 TInt iSettingIdentifier; 00404 TInt iSettingPageResourceId; 00405 TInt iEditorControlType; 00406 TInt iSettingEditorResourceId; 00407 TInt iAssociatedResourceId; 00408 TInt iIconIndex; // Only valid if relevant bit is set in iFlags 00409 HBufC* iEmptyItemText; // Owned 00410 00411 HBufC* iSettingName; // Owned 00412 HBufC* iListBoxText; // Owned 00413 HBufC* iCompulsoryText; // Owned 00414 00415 00416 // Following are not owned 00417 CAknSettingPage* iSettingPage; // This is a ref that is valid when non-0 - when the SP is "up" 00418 CArrayPtr<CGulIcon>* iIconArray; // Reference to the array only ! 00419 00420 TInt iVisibleIndex; 00421 // Set flags that are in the Setting pages' constructors 00422 TInt iSettingPageFlags; 00423 00424 // Pointer to the listbox that the setting item is providing data to 00425 const CEikFormattedCellListBox* iParentListBox; // Not owned 00426 00427 CAknSettingItemExtension* iExtension; 00428 }; 00429 00434 class CAknTextSettingItem : public CAknSettingItem 00435 { 00436 public: 00437 /* 00438 * Constructor 00439 * 00440 * @param resource identifier for this setting item 00441 * @param Setting text 00442 * 00443 */ 00444 IMPORT_C CAknTextSettingItem( TInt aIdentifier, TDes& aText ); 00445 00449 IMPORT_C ~CAknTextSettingItem(); 00450 00458 IMPORT_C virtual void StoreL(); 00459 00460 /* 00461 * The external value is transferred to the internal value 00462 * This occurs at construction, but may be called by client code when required. 00463 */ 00464 IMPORT_C virtual void LoadL(); // Called from 2nd stage constructors 00465 00466 /* 00467 * This method obtains the current value's setting text. 00468 * 00469 * The reference is returned and is not a copy of the text, but refers to the current 00470 * internal text value. This is the value that would be externalized if StoreL were called. 00471 * An exception to this is if the current text is zero length. In that case a reference to the 00472 * empty text is returned (which would not be externalized if StoreL is called). 00473 * 00474 * @return Reference to descriptor with the current internal text 00475 */ 00476 IMPORT_C virtual const TDesC& SettingTextL(); 00477 00485 IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); 00486 00487 protected: 00488 00494 IMPORT_C TPtr& InternalTextPtr(); 00495 00501 IMPORT_C TPtrC ExternalText(); 00502 00510 IMPORT_C void SetExternalText( TDesC& aNewExternalText ); 00511 private: 00512 IMPORT_C void CAknSettingItem_Reserved(); 00513 00514 private: 00515 TDes& iExternalText; 00516 HBufC* iInternalText; // Owned 00517 TPtr iInternalTextPtr; 00518 TInt iSpare_Text_1; 00519 }; 00520 00521 00529 class CAknIntegerSettingItem : public CAknSettingItem 00530 { 00531 public: 00532 /* 00533 * Constructor 00534 * 00535 * @param resource identifier for this setting item 00536 * @param integer value to edit. 00537 * 00538 */ 00539 IMPORT_C CAknIntegerSettingItem( TInt aIdentifier, TInt& aValue ); 00540 IMPORT_C ~CAknIntegerSettingItem(); 00541 00549 IMPORT_C virtual void StoreL(); 00550 /* 00551 * The external value is transferred to the internal value 00552 * This occurs at construction, but may be called by client code when required. 00553 */ 00554 IMPORT_C virtual void LoadL(); 00555 00556 /* 00557 * This method obtains the current value's setting text 00558 * 00559 * @return Reference to descriptor with the text 00560 */ 00561 IMPORT_C virtual const TDesC& SettingTextL(); 00562 00570 virtual void EditItemL( TBool aCalledFromMenu ) = 0; 00571 00572 protected: 00578 IMPORT_C virtual void CompleteConstructionL(); 00579 00585 IMPORT_C TInt& InternalValueRef(); 00586 00593 IMPORT_C TInt& ExternalValueRef(); 00594 00600 IMPORT_C void SetExternalValue( TInt& aValue ); 00601 private: 00602 IMPORT_C void CAknSettingItem_Reserved(); 00603 00604 private: 00605 TInt iInternalValue; 00606 TInt& iExternalValue; 00607 HBufC* iInternalText; // Owned 00608 TPtr iInternalTextPtr; 00609 }; 00610 00611 00612 class CAknIntegerEdwinSettingItem : public CAknIntegerSettingItem 00613 { 00614 public: 00615 IMPORT_C CAknIntegerEdwinSettingItem( TInt aIdentifier, TInt& aValue ); 00623 IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); 00624 private: 00625 IMPORT_C void CAknSettingItem_Reserved(); 00626 }; 00627 00633 class CAknPasswordSettingItem : public CAknTextSettingItem 00634 { 00635 public: 00636 enum TAknPasswordSettingItemMode 00637 { 00638 EAlpha, // password held is alphanumeric 00639 ENumeric // password is numeric ( digits 0 - 9 only used ) 00640 }; 00641 00642 /* 00643 * Constructor 00644 * 00645 * @param resource identifier for this setting item 00646 * @param password mode; text or numeric 00647 * @param password to change 00648 */ 00649 IMPORT_C CAknPasswordSettingItem( TInt aIdentifier, enum TAknPasswordSettingItemMode aMode, TDes& aPassword ); 00650 00651 /* 00652 * This method obtains the current value's setting text 00653 * 00654 * @return Reference to descriptor with the text 00655 */ 00656 IMPORT_C virtual const TDesC& SettingTextL(); 00664 IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); 00665 00666 protected: 00667 00673 IMPORT_C virtual void CompleteConstructionL(); 00674 private: 00675 IMPORT_C void CAknSettingItem_Reserved(); 00676 00677 private: 00678 TAknPasswordSettingItemMode iPasswordMode; 00679 // For holding the text to blank the setting item text 00680 TBuf<KMaxPasswordBlankingTextLength> iBlankingText; 00681 // For holding the resouce for a password query 00682 TInt iOldPasswordQueryResourceId; 00683 }; 00684 00685 00690 class CAknVolumeSettingItem : public CAknSettingItem 00691 { 00692 public: 00693 /* 00694 * Constructor 00695 * 00696 * @param resource identifier for this setting item 00697 * @param volume value. Must be in range 0 to 10, inclusive 00698 * 00699 */ 00700 IMPORT_C CAknVolumeSettingItem( TInt aIdentifier, TInt& aExternalVolume ); 00701 00709 IMPORT_C virtual void StoreL(); 00710 /* 00711 * The external value is transferred to the internal value 00712 * This occurs at construction, but may be called by client code when required. 00713 */ 00714 IMPORT_C virtual void LoadL(); 00715 /* 00716 * This method obtains the current value's setting text 00717 * 00718 * @return Reference to descriptor with the text 00719 */ 00720 IMPORT_C virtual const TDesC& SettingTextL(); 00728 IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); 00729 00730 protected: 00736 IMPORT_C TInt& InternalVolumeValue(); // For access to internal value for derived classes 00737 00738 //From CAknSettingItem 00744 IMPORT_C virtual CFbsBitmap* CreateBitmapL(); 00745 private: 00746 IMPORT_C void CAknSettingItem_Reserved(); 00747 00748 private: 00749 TInt& iExternalVolume; 00750 TInt iInternalVolume; 00751 00752 }; 00753 00760 class CAknSliderSettingItem : public CAknSettingItem 00761 { 00762 public: 00763 /* 00764 * Constructor 00765 * 00766 * @param resource identifier for this setting item 00767 * @param Slider value; must be within the minimum and maximum values in resource 00768 * 00769 */ 00770 IMPORT_C CAknSliderSettingItem( TInt aIdentifier, TInt& aExternalSliderValue ); 00771 00779 IMPORT_C virtual void StoreL(); 00780 /* 00781 * The external value is transferred to the internal value 00782 * This occurs at construction, but may be called by client code when required. 00783 */ 00784 IMPORT_C virtual void LoadL(); 00785 /* 00786 * This method obtains the current value's setting text 00787 * 00788 * @return Reference to descriptor with the text 00789 */ 00790 IMPORT_C virtual const TDesC& SettingTextL(); 00798 IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); 00799 00800 protected: 00804 IMPORT_C virtual CAknSettingPage* CreateSettingPageL(); 00805 00809 IMPORT_C virtual void CreateAndExecuteSettingPageL(); 00810 00816 IMPORT_C TInt& InternalSliderValue(); 00817 00818 // From CAknSettingItem 00824 IMPORT_C virtual CFbsBitmap* CreateBitmapL(); 00825 private: 00826 IMPORT_C void CAknSettingItem_Reserved(); 00827 00828 private: 00829 TInt& iExternalSliderValue; 00830 TInt iInternalSliderValue; // required for use in derived classes 00831 00832 }; 00833 00834 00846 class CAknTimeOrDateSettingItem : public CAknSettingItem 00847 { 00848 public: 00849 enum TAknTimeOrDateSettingItemMode 00850 { 00851 ETime, 00852 EDate 00853 }; 00854 /* 00855 * Constructor 00856 * 00857 * @param resource identifier for this setting item 00858 * @param construct a Time or a Date setting item 00859 * @param IP address to be controlled by the setting editing 00860 * 00861 */ 00862 IMPORT_C CAknTimeOrDateSettingItem( TInt aIdentifier, enum TAknTimeOrDateSettingItemMode aMode, TTime& aTime ); 00866 IMPORT_C ~CAknTimeOrDateSettingItem(); 00872 IMPORT_C void CompleteConstructionL( ); 00873 00881 IMPORT_C virtual void StoreL(); 00882 /* 00883 * The external value is transferred to the internal value 00884 * This occurs at construction, but may be called by client code when required. 00885 */ 00886 IMPORT_C virtual void LoadL(); 00887 /* 00888 * This method obtains the current value's setting text 00889 * 00890 * @return Reference to descriptor with the text 00891 */ 00892 IMPORT_C virtual const TDesC& SettingTextL(); 00900 IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); 00907 IMPORT_C void SetTimeFormatStringL( const TDesC& aTimeFormat ); 00914 IMPORT_C const TPtrC TimeFormatString(); 00915 private: 00916 IMPORT_C void CAknSettingItem_Reserved(); 00917 private: 00918 TTime& iExternalTime; 00919 TTime iInternalTime; 00920 HBufC* iInternalText; // Owned 00921 TPtr iInternalTextPtr; 00922 HBufC* iTimeFormat; 00923 TPtr iTimeFormatPtr; 00924 TAknTimeOrDateSettingItemMode iTimeOrDateMode; 00925 }; 00926 00927 00928 00940 class CAknTimeOffsetSettingItem : public CAknSettingItem 00941 { 00942 public: 00943 /* 00944 * Constructor 00945 * 00946 * @param resource identifier for this setting item 00947 * @param construct a Time offset setting item 00948 * 00949 */ 00950 IMPORT_C CAknTimeOffsetSettingItem( TInt aIdentifier, TTimeIntervalSeconds& aTime ); 00954 IMPORT_C ~CAknTimeOffsetSettingItem(); 00961 IMPORT_C void CompleteConstructionL( ); 00962 00972 IMPORT_C virtual void StoreL(); 00973 /* 00974 * The external value is transferred to the internal value 00975 * This occurs at construction, but may be called by client code when required. 00976 * 00977 * 00978 */ 00979 IMPORT_C virtual void LoadL(); 00980 /* 00981 * This method obtains the current value's setting text 00982 * 00983 * 00984 * @return Reference to descriptor with the text 00985 */ 00986 IMPORT_C virtual const TDesC& SettingTextL(); 00995 IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); 01003 IMPORT_C void SetTimeFormatStringL( const TDesC& aTimeFormat ); 01011 IMPORT_C const TPtrC TimeFormatString(); 01012 private: 01013 IMPORT_C void CAknSettingItem_Reserved(); 01014 private: 01015 TTimeIntervalSeconds iExternalTime; 01016 TTimeIntervalSeconds iInternalTime; 01017 HBufC* iInternalText; // Owned 01018 TPtr iInternalTextPtr; 01019 HBufC* iTimeFormat; 01020 TPtr iTimeFormatPtr; 01021 01022 TInt iSpare; 01023 }; 01024 01025 01034 class CAknIpFieldSettingItem : public CAknSettingItem 01035 { 01036 public: 01037 /* 01038 * Constructor 01039 * 01040 * @param resource identifier for this setting item 01041 * @param IP address to be controlled by the setting editing 01042 * 01043 */ 01044 IMPORT_C CAknIpFieldSettingItem( TInt aIdentifier, TInetAddr& aIpAddress ); 01050 IMPORT_C ~CAknIpFieldSettingItem(); 01051 01057 IMPORT_C void CompleteConstructionL( ); 01058 01066 IMPORT_C virtual void StoreL(); 01067 /* 01068 * The external value is transferred to the internal value 01069 * This occurs at construction, but may be called by client code when required. 01070 * 01071 */ 01072 IMPORT_C virtual void LoadL(); // Called from 2nd stage constructors 01073 /* 01074 * This method obtains the current value's setting text 01075 * 01076 * @return Reference to descriptor with the text 01077 */ 01078 IMPORT_C virtual const TDesC& SettingTextL(); 01086 IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); 01087 private: 01088 IMPORT_C void CAknSettingItem_Reserved(); 01089 01090 private: 01091 TInetAddr& iExternalIpAddress; 01092 TInetAddr iInternalIpAddress; 01093 HBufC* iInternalText; // Owned 01094 TPtr iInternalTextPtr; 01095 }; 01096 01102 class CAknEnumeratedItemBase : public CBase 01103 { 01104 public: 01108 IMPORT_C CAknEnumeratedItemBase( TInt aEnumeratedValue, TAny* aValue ); 01112 IMPORT_C ~CAknEnumeratedItemBase(); 01118 IMPORT_C TInt EnumerationValue() const; 01124 IMPORT_C void SetEnumerationValue( TInt aNewValue ); 01130 IMPORT_C TAny* Value() const; 01136 IMPORT_C void SetValue( TAny* aPtr ); 01137 private: 01138 TInt iEnumerationValue; 01139 TAny* iValue; 01140 }; 01141 01142 01147 template <class T> 01148 class CAknEnumeratedItem : public CAknEnumeratedItemBase 01149 { 01150 public: 01151 inline CAknEnumeratedItem( TInt aEnumeratedValue, T* aValue ); 01152 inline ~CAknEnumeratedItem(); 01153 inline T* Value(); 01154 inline void SetValue( T* ); 01155 }; 01156 01157 01158 template <class T> 01159 inline CAknEnumeratedItem<T>::CAknEnumeratedItem( TInt aEnumValue, T* aValue ) : 01160 CAknEnumeratedItemBase( aEnumValue, (TAny*)aValue) 01161 { 01162 } 01163 01164 template <class T> 01165 inline CAknEnumeratedItem<T>::~CAknEnumeratedItem() 01166 { 01167 delete (T*)Value(); 01168 } 01169 01170 template <class T> 01171 inline T* CAknEnumeratedItem<T>::Value() 01172 { 01173 return ( ( T* ) CAknEnumeratedItemBase::Value() ); 01174 } 01175 01176 template <class T> 01177 inline void CAknEnumeratedItem<T>::SetValue( T* aNewValue ) 01178 { 01179 CAknEnumeratedItemBase::SetValue( aNewValue ); 01180 } 01181 01182 01183 01187 typedef CAknEnumeratedItem<HBufC> CAknEnumeratedText; 01188 01189 01190 01203 class CAknEnumeratedTextSettingItem : public CAknSettingItem 01204 { 01205 public: 01210 IMPORT_C CAknEnumeratedTextSettingItem( TInt aResourceId ); 01211 01215 IMPORT_C ~CAknEnumeratedTextSettingItem(); 01216 01217 // 01218 // From CAknSettingItem 01219 // 01220 protected: 01221 01229 IMPORT_C void CompleteConstructionL(); 01230 01231 private: 01232 IMPORT_C void CAknSettingItem_Reserved(); 01233 01234 public: 01235 01243 IMPORT_C CArrayPtr<CAknEnumeratedText>* EnumeratedTextArray() const; 01244 01253 IMPORT_C CArrayPtr<HBufC>* PoppedUpTextArray() const; 01254 01275 IMPORT_C void SetEnumeratedTextArrays( CArrayPtr<CAknEnumeratedText>* aEnumeratedTextArray, 01276 CArrayPtr<HBufC>* PoppedUpTextArray ); 01282 IMPORT_C virtual void HandleTextArrayUpdateL(); 01283 01289 IMPORT_C TInt NumberOfItems() const; 01290 01299 IMPORT_C TInt IndexFromValue( TInt aInputValue ) const; 01300 01301 protected: 01302 01310 IMPORT_C void SetSettingPageTextL(); 01311 01315 IMPORT_C CDesCArray* SettingPageTextArray() const; 01316 01317 private: 01318 01323 void DeleteAndZeroPrimaryArrays(); 01324 01325 private: 01326 TInt iTextPopupFlags; 01327 CArrayPtr<CAknEnumeratedText>* iEnumeratedTextArray; // Owned and pointed to objects are owned 01328 CArrayPtr<HBufC>* iPoppedUpTextArray; // Owned and the HBufCs are owned here 01329 TInt iEnumeratedTextArrayResourceId; 01330 TInt iPoppedUpTextArrayResourceId; 01331 CDesCArrayFlat* iSettingPageText; // Owned 01332 HBufC* iSpare; // Formerly space was used by iEmptyText; 01333 }; 01334 01335 01336 01348 class CAknEnumeratedTextPopupSettingItem : public CAknEnumeratedTextSettingItem 01349 { 01350 public: 01356 IMPORT_C CAknEnumeratedTextPopupSettingItem( TInt aResourceId, TInt& aValue ); 01357 01361 IMPORT_C ~CAknEnumeratedTextPopupSettingItem(); 01362 01370 IMPORT_C virtual void StoreL(); 01371 01372 /* 01373 * The external value is transferred to the internal value 01374 * This occurs at construction, but may be called by client code when required. 01375 */ 01376 IMPORT_C virtual void LoadL(); 01377 01378 /* 01379 * This method obtains the current value's setting text 01380 * 01381 * @return Reference to descriptor with the text 01382 */ 01383 IMPORT_C virtual const TDesC& SettingTextL(); 01391 IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); 01392 01393 public: 01400 IMPORT_C CArrayPtr<CAknEnumeratedText>* EnumeratedTextArray() const; 01401 01408 IMPORT_C CArrayPtr<HBufC>* PoppedUpTextArray() const; 01409 01410 protected: 01415 IMPORT_C virtual CAknSettingPage* CreateSettingPageL(); 01416 01420 IMPORT_C virtual void CreateAndExecuteSettingPageL(); 01421 01427 IMPORT_C virtual void CompleteConstructionL(); 01428 01436 IMPORT_C void SetExternalValue( TInt aNewValue ); 01442 IMPORT_C void SetInternalValue( TInt aNewValue ); 01443 01450 IMPORT_C void SetSelectedIndex( TInt aNewIndex ); 01451 01457 IMPORT_C TInt IndexFromValue( TInt aInputValue ) const ; 01458 01463 IMPORT_C TInt ExternalValue() const; 01468 IMPORT_C TInt InternalValue() const; 01473 IMPORT_C MAknQueryValue* QueryValue() const; 01474 private: 01475 IMPORT_C void CAknSettingItem_Reserved(); 01476 01477 private: 01478 void SetSettingPageTextL(); 01479 void CreateTextArrayL(); 01480 void CreateQueryValueL(); 01481 void UpdateInternalValuesL(); 01490 TInt FindNextEnumerationValue() const; 01491 01492 private: 01493 TInt& iExternalValue; 01494 TInt iInternalValue; 01495 TInt iNumberOfItems; 01496 TInt iSelectedIndex; 01497 CAknQueryValueText* iQueryValue; 01498 CAknQueryValueTextArray* iQueryTextArray; 01499 TInt iSpare_EnumeratedTextPopup_1; 01500 }; 01501 01502 01503 class CAknBinaryPopupSettingItem : public CAknEnumeratedTextPopupSettingItem 01504 { 01505 public: 01514 IMPORT_C CAknBinaryPopupSettingItem( TInt aIdentifier, TBool& aBinaryValue ); 01515 01523 IMPORT_C virtual void StoreL(); 01524 /* 01525 * The external value is transferred to the internal value 01526 * This occurs at construction, but may be called by client code when required. 01527 */ 01528 IMPORT_C virtual void LoadL(); 01537 IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); 01538 01539 protected: 01545 IMPORT_C virtual void CompleteConstructionL(); 01546 private: 01547 IMPORT_C void CAknSettingItem_Reserved(); 01548 private: 01549 TAny* iUnused; 01550 }; 01551 01552 01562 class CAknBigSettingItemBase : public CAknSettingItem 01563 { 01564 public: 01569 IMPORT_C CAknBigSettingItemBase( TInt aIdentifier ); 01570 01571 protected: 01572 /* 01573 * This method obtains the current value's setting text 01574 * 01575 * @return Reference to descriptor with the text 01576 */ 01577 IMPORT_C virtual const TDesC& SettingTextL(); 01578 private: 01579 IMPORT_C void CAknSettingItem_Reserved(); 01580 01581 private: 01582 const TDesC& iEmptyString; 01583 01584 }; 01585 01586 01590 class CAknSettingItemArray : public CArrayPtrFlat<CAknSettingItem>, public MDesCArray 01591 { 01592 public: 01599 IMPORT_C CAknSettingItemArray( TInt aGranularity, TBool aIsNumbered, TInt aInitialOrdinal ); 01603 IMPORT_C virtual ~CAknSettingItemArray(); 01604 01605 // from MDesC16Array 01610 IMPORT_C TInt MdcaCount() const; 01618 IMPORT_C TPtrC16 MdcaPoint(TInt aIndex) const; 01619 // For hidden item support 01627 IMPORT_C TInt ItemIndexFromVisibleIndex( TInt aVisibleIndex ) const; 01633 IMPORT_C virtual void RecalculateVisibleIndicesL(); 01639 IMPORT_C void SetInitialOrdinal( TInt aInitialOrdinal ); 01640 /* 01641 * Method used to transfer flags from the CAknSettingItemList to this array 01642 */ 01643 IMPORT_C void SetFlags( TInt aFlags ); 01644 protected: 01645 01650 IMPORT_C void SetVisibleCount( TInt aCount ); 01656 IMPORT_C TInt VisibleCount() const; 01657 01658 private: 01659 TBool iIsNumbered; 01660 TInt iInitialOrdinal; 01661 TInt iVisibleCount; 01662 TInt iFlags; 01663 }; 01664 01665 01666 class CAknSettingItemList : public CAknControl , public MEikListBoxObserver 01667 { 01668 public: 01669 enum TAknSettingItemStyle 01670 { 01671 ENumberedStyle, // The setting item list displays number 01672 EUnnumberedStyle // The setting item list does not disply number 01673 }; 01674 01675 public: 01679 IMPORT_C CAknSettingItemList(); 01683 IMPORT_C ~CAknSettingItemList(); 01684 01685 // From CCoeControl 01689 IMPORT_C void ConstructFromResourceL(TInt aResourceId ); 01693 IMPORT_C void ConstructFromResourceL( TResourceReader& aReader ); 01694 01698 IMPORT_C TInt CountComponentControls() const; 01703 IMPORT_C CCoeControl* ComponentControl(TInt aId ) const; 01704 01708 IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); 01712 IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow); 01713 01721 IMPORT_C void HandleResourceChange(TInt aType); 01722 01723 // from MEikListBoxObserver 01724 IMPORT_C virtual void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); 01725 01726 public: 01727 // Framework methods 01736 IMPORT_C virtual void EditItemL(TInt aIndex, TBool aCalledFromMenu); 01742 IMPORT_C virtual void LoadSettingsL(); 01748 IMPORT_C virtual void StoreSettingsL(); // call StoreL() on each item in MAknSettingItemArray 01749 01754 IMPORT_C void SetIncludeHiddenInOrdinal( TBool aInclude ); 01755 01759 IMPORT_C TBool IsNumberedStyle(); 01763 IMPORT_C CEikFormattedCellListBox* ListBox(); // get the listbox 01767 IMPORT_C CAknSettingItemArray* SettingItemArray() const; 01773 IMPORT_C void HandleChangeInItemArrayOrVisibilityL(); 01778 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); 01779 01780 protected: 01789 IMPORT_C virtual CAknSettingItem* CreateSettingItemL( TInt aSettingId ); 01790 private: 01794 IMPORT_C void* ExtensionInterface( TUid aInterface ); 01795 01796 private: 01797 void UpdateAllListBoxTextsL() const; 01798 01799 private: 01800 01801 // Owned objects: 01802 CEikFormattedCellListBox* iSettingItemListBox; 01803 CAknSettingItemArray* iSettingItemArray; 01804 01805 // Other non-CBase classes 01806 HBufC* iSettingItemListTitle; // Owned 01807 01808 // Internal information 01809 TInt iFlags; 01810 TInt iInitialOrdinal; 01811 01812 TInt iSpare_1; 01813 TInt iSpare_2; 01814 }; 01815 01816 01817 01818 01819 #endif