00001 /* 00002 * ============================================================================ 00003 * Name : AknQueryValueDuration.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 // AknQueryValueDuration.h 00021 // 00022 // Copyright (c) 2001 Symbian Ltd. All rights reserved. 00023 // 00024 00025 #if !defined(__AKNQUERYVALUEDURATION_H__) 00026 #define __AKNQUERYVALUEDURATION_H__ 00027 00028 #include <bamdesca.h> 00029 #include <eikdialg.h> 00030 #include "AknQueryValue.h" 00031 00032 class CAknQueryValueDurationArray; 00033 00040 NONSHARABLE_CLASS(CAknQueryValueDuration) : public CAknQueryValue 00041 { 00042 public: 00047 IMPORT_C static CAknQueryValueDuration* NewL(); 00048 00053 IMPORT_C static CAknQueryValueDuration* NewLC(); 00054 IMPORT_C virtual ~CAknQueryValueDuration(); 00055 00061 IMPORT_C void SetArrayL(const CAknQueryValueDurationArray* aArray); 00062 00069 IMPORT_C void SetQueryCaption(TInt aResourceId); 00070 00075 IMPORT_C TTimeIntervalSeconds Value() const; 00076 00077 public: // from MAknQueryValue 00078 IMPORT_C virtual const MDesCArray* MdcArray() const; 00079 IMPORT_C virtual HBufC* CurrentValueTextLC(); 00080 IMPORT_C virtual TInt CurrentValueIndex() const; 00081 IMPORT_C virtual void SetCurrentValueIndex(const TInt aIndex); 00082 IMPORT_C virtual TBool CreateEditorL(); 00083 protected: 00084 CAknQueryValueDuration(); 00085 00090 void ConstructL(); 00091 00097 void CalculateCurrentIndex(); 00098 00099 virtual void AppendValueIfNewL(); 00100 private: // from MAknQueryValue 00101 IMPORT_C void Reserved_MAknQueryValue(); 00102 private: 00103 // the following are member variables 00104 TInt iQueryCaptionId; 00105 TTimeIntervalSeconds iDuration; 00106 TInt iCurrentIndex; 00107 // the following are not owned 00108 const CAknQueryValueDurationArray* iArray; 00109 }; 00110 00111 00116 NONSHARABLE_CLASS(CAknQueryValueDurationArray) : public CBase, public MDesCArray 00117 { 00118 public: 00123 typedef CArrayFix<TTimeIntervalSeconds> DurationArray; 00124 00125 enum {KSafeSizeOfDescriptorForDurationFormat = 32}; 00126 00127 public: 00135 IMPORT_C static CAknQueryValueDurationArray* NewL(TInt aResourceId); 00136 00141 IMPORT_C static CAknQueryValueDurationArray* NewLC(TInt aResourceId); 00142 00143 IMPORT_C ~CAknQueryValueDurationArray(); 00144 00152 IMPORT_C void SetArray(DurationArray& aArray); 00153 00161 IMPORT_C DurationArray* Array() const; 00162 00168 IMPORT_C const HBufC* FormatString() const; 00169 00177 #ifdef __WINS__ 00178 IMPORT_C const TInt FormattedStringSize() const; 00179 #else 00180 IMPORT_C TInt FormattedStringSize() const; 00181 // __WINS__ 00182 #endif 00183 00192 IMPORT_C void FormatDuration(TPtr& aText, TTimeIntervalSeconds aDuration) const; 00193 00194 public: 00195 // from MDesCArray 00200 IMPORT_C virtual TInt MdcaCount() const; 00201 00210 IMPORT_C virtual TPtrC MdcaPoint(TInt aIndex) const; 00211 00212 protected: 00213 CAknQueryValueDurationArray(); 00214 00219 void ConstructL(TInt aResourceId); 00220 00221 private: 00222 // the following members are owned 00223 HBufC* iLastGeneratedTextValue; 00224 HBufC* iFormatString; 00225 // the following members are not owned 00226 DurationArray* iArray; 00227 TInt iFormattedStringSize; 00228 }; 00229 00230 00231 // __AKNQUERYVALUEDURATION_H__ 00232 #endif 00233