00001 /* 00002 * ============================================================================ 00003 * Name : AknQueryValue.h 00004 * Part of : Avkon 00005 * 00006 * Description: 00007 * Version: 00008 * 00009 * Copyright © 2002 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. All rights are reserved. Copying, 00013 * including reproducing, storing, adapting or translating, any 00014 * or all of this material requires the prior written consent of 00015 * Nokia Corporation. This material also contains confidential 00016 * information which may not be disclosed to others without the 00017 * prior written consent of Nokia Corporation. 00018 * ============================================================================ 00019 */ 00020 // AknQueryValue.h 00021 // 00022 // Copyright (c) 2001 Symbian Ltd. All rights reserved. 00023 // 00024 00025 #if !defined(__AKNQUERYVALUE_H__) 00026 #define __AKNQUERYVALUE_H__ 00027 00028 00029 #include <eikenv.h> 00030 #include <babitflags.h> 00031 00032 class MDesCArray; 00033 00042 class MAknQueryValue 00043 { 00044 public: 00049 enum TMode 00050 { 00051 EQueryMode, 00052 ESettingPageMode 00053 }; 00054 protected: 00059 enum TFlagBits 00060 { 00061 ESettingPageModeBitIndex = 0, 00062 EAutoAppendBitIndex 00063 }; 00064 public: 00065 virtual ~MAknQueryValue() {} 00070 virtual const MDesCArray* MdcArray() const = 0; 00071 00078 virtual HBufC* CurrentValueTextLC() = 0; 00079 00085 virtual TInt CurrentValueIndex() const = 0; 00086 00092 virtual void SetCurrentValueIndex(const TInt aIndex) = 0; 00093 00101 virtual TBool CreateEditorL() = 0; 00102 00107 virtual void SetQueryMode( MAknQueryValue::TMode aMode ) = 0; 00131 virtual void SetSettingPageResourceIds( 00132 TInt aSettingPageResourceId, 00133 TInt aSettingPageEditorResourceId ) = 0; 00138 virtual void SetAutoAppend( TBool aAppend ) = 0; 00139 00140 protected: 00146 virtual void AppendValueIfNewL() = 0; 00147 private: 00148 IMPORT_C virtual void Reserved_MAknQueryValue(); 00149 }; 00150 00155 class CAknQueryValue : public CBase, public MAknQueryValue 00156 { 00157 public: 00158 IMPORT_C virtual void SetQueryMode( MAknQueryValue::TMode aMode ); 00159 IMPORT_C virtual void SetSettingPageResourceIds( TInt aSettingPageResourceId, TInt aSettingPageEditorResourceId ); 00160 IMPORT_C virtual void SetAutoAppend( TBool aAppend ); 00161 IMPORT_C virtual void AppendValueIfNewL(); 00162 protected: 00167 TBool IsValidIndex(TInt aIndex) 00168 { 00169 if (MdcArray()->MdcaCount() < 1) return ETrue; 00170 if (aIndex < 0 || aIndex >= MdcArray()->MdcaCount()) 00171 return EFalse; 00172 return ETrue; 00173 } 00174 00175 protected: 00180 TBitFlags16 iFlags; 00185 TInt iSettingPageResourceId; 00190 TInt iSettingPageEditorResourceId; 00191 private: 00192 TInt iSpare; 00193 // from MAknQueryValue 00194 IMPORT_C void Reserved_MAknQueryValue(); 00195 }; 00196 00197 // __AKNQUERYVALUE_H__ 00198 #endif 00199