00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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:
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:
00101 IMPORT_C void Reserved_MAknQueryValue();
00102 private:
00103
00104 TInt iQueryCaptionId;
00105 TTimeIntervalSeconds iDuration;
00106 TInt iCurrentIndex;
00107
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 #endif // __WINS__
00182
00191 IMPORT_C void FormatDuration(TPtr& aText, TTimeIntervalSeconds aDuration) const;
00192
00193 public:
00194
00199 IMPORT_C virtual TInt MdcaCount() const;
00200
00209 IMPORT_C virtual TPtrC MdcaPoint(TInt aIndex) const;
00210
00211 protected:
00212 CAknQueryValueDurationArray();
00213
00218 void ConstructL(TInt aResourceId);
00219
00220 private:
00221
00222 HBufC* iLastGeneratedTextValue;
00223 HBufC* iFormatString;
00224
00225 DurationArray* iArray;
00226 TInt iFormattedStringSize;
00227 };
00228
00229
00230 #endif // __AKNQUERYVALUEDURATION_H__
00231