1.1 --- a/epoc32/include/mw/aknqueryvaluephone.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/aknqueryvaluephone.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,209 @@
1.4 -aknqueryvaluephone.h
1.5 +/*
1.6 +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +*
1.20 +*/
1.21 +
1.22 +// AknQueryValuePhone.h
1.23 +//
1.24 +// Copyright (c) 2001 Symbian Ltd. All rights reserved.
1.25 +//
1.26 +
1.27 +#if !defined(__AKNQUERYVALUEPHONE_H__)
1.28 +#define __AKNQUERYVALUEPHONE_H__
1.29 +
1.30 +#include <bamdesca.h>
1.31 +#include <eikdialg.h>
1.32 +#include "AknQueryValue.h"
1.33 +
1.34 +class CAknQueryValuePhoneArray;
1.35 +
1.36 +/**
1.37 + * Encapsulates a string. Provides an interface to create a dialog
1.38 + * containing a phone number query control, which will edit the value. Optionally
1.39 + * allows the value to be changed by selecting from a list of values.
1.40 + *
1.41 + */
1.42 +NONSHARABLE_CLASS(CAknQueryValuePhone) : public CAknQueryValue
1.43 + {
1.44 +public:
1.45 + /**
1.46 + * First stage of two stage construction.
1.47 + *
1.48 + */
1.49 + IMPORT_C static CAknQueryValuePhone* NewL();
1.50 +
1.51 + /**
1.52 + * First stage of two stage construction.
1.53 + *
1.54 + */
1.55 + IMPORT_C static CAknQueryValuePhone* NewLC();
1.56 +
1.57 + IMPORT_C virtual ~CAknQueryValuePhone();
1.58 +
1.59 + /**
1.60 + * Set the array.
1.61 + *
1.62 + * @param aArray pointer to array, ownership is not passed
1.63 + */
1.64 + IMPORT_C void SetArrayL(const CAknQueryValuePhoneArray* aArray);
1.65 +
1.66 + /**
1.67 + * Set the string used for the query caption to be a string other than the default.
1.68 + *
1.69 + * @param aResourceId resource id of string to use for caption.
1.70 + *
1.71 + */
1.72 + IMPORT_C void SetQueryCaption(TInt aResourceId);
1.73 +
1.74 + /**
1.75 + * Return the current value, which may have been set by the user
1.76 + *
1.77 + * @return The current value, ownership is not passed
1.78 + *
1.79 + */
1.80 + IMPORT_C HBufC* Value() const;
1.81 +
1.82 +public: // from MAknQueryValue
1.83 + IMPORT_C virtual const MDesCArray* MdcArray() const;
1.84 + IMPORT_C virtual HBufC* CurrentValueTextLC();
1.85 + IMPORT_C virtual TInt CurrentValueIndex() const;
1.86 + IMPORT_C virtual void SetCurrentValueIndex(const TInt aIndex);
1.87 + IMPORT_C virtual TBool CreateEditorL();
1.88 +
1.89 +protected:
1.90 + CAknQueryValuePhone();
1.91 +
1.92 + /**
1.93 + * Two stage construction
1.94 + *
1.95 + */
1.96 + void ConstructL();
1.97 +
1.98 + /**
1.99 + * Search for the current value in the list, and set the curent index
1.100 + * to be the found index. If not found, set current index to 1 after the size of the array.
1.101 + *
1.102 + */
1.103 + void CalculateCurrentIndex();
1.104 +
1.105 + virtual void AppendValueIfNewL();
1.106 +
1.107 +private: // from MAknQueryValue
1.108 + IMPORT_C void Reserved_MAknQueryValue();
1.109 +
1.110 +private:
1.111 + // the following are member variables
1.112 + TInt iQueryCaptionId;
1.113 + HBufC* iText;
1.114 + TInt iCurrentIndex;
1.115 + // the following are not owned
1.116 + const CAknQueryValuePhoneArray* iArray;
1.117 + };
1.118 +
1.119 +
1.120 +/**
1.121 + * Wraps a descriptor array.
1.122 + *
1.123 + */
1.124 +NONSHARABLE_CLASS(CAknQueryValuePhoneArray) : public CBase, public MDesCArray
1.125 + {
1.126 +public:
1.127 + /**
1.128 + * Typedef for array
1.129 + *
1.130 + */
1.131 + typedef CDesCArray TextArray;
1.132 +
1.133 + enum {KSafeSizeOfDescriptorForPhoneFormat = 64};
1.134 +
1.135 +public:
1.136 + /**
1.137 + * Two-phased constructor.
1.138 + *
1.139 + */
1.140 + IMPORT_C static CAknQueryValuePhoneArray* NewL();
1.141 +
1.142 + /**
1.143 + * Two-phased constructor.
1.144 + *
1.145 + */
1.146 + IMPORT_C static CAknQueryValuePhoneArray* NewLC();
1.147 +
1.148 + IMPORT_C ~CAknQueryValuePhoneArray();
1.149 +
1.150 + /**
1.151 + * Set the array of values.
1.152 + * Note that client can use any implementation of array class, but must pass in a
1.153 + * TArray generated from it (by calling the Array() method on the array class)
1.154 + *
1.155 + * @param aArray array of values, ownership is passed
1.156 + */
1.157 + IMPORT_C void SetArray(TextArray& aArray);
1.158 +
1.159 + /**
1.160 + * Get the array of values as a TArray.
1.161 + * Note that client can use any implementation of array class, but the array is
1.162 + * treated as a TArray.
1.163 + *
1.164 + * @return array of values, ownership is not passed
1.165 + */
1.166 + IMPORT_C TextArray* Array() const;
1.167 +
1.168 +/**
1.169 + * Return the size of a maximal time string formated using the format string
1.170 + * that was supplied during construction of this instance.
1.171 + * Two versions to eliminate compiler warnings.
1.172 + *
1.173 + * @return length of formatted string.
1.174 + */
1.175 +#ifdef __WINS__
1.176 + IMPORT_C const TInt FormattedStringSize() const;
1.177 +#else
1.178 + IMPORT_C TInt FormattedStringSize() const;
1.179 +#endif // __WINS__
1.180 +
1.181 +public:
1.182 + // from MDesCArray
1.183 + /**
1.184 + * @return count of contained array
1.185 + *
1.186 + */
1.187 + IMPORT_C virtual TInt MdcaCount() const;
1.188 +
1.189 + /**
1.190 + * Returns array element, pass through to contained descriptor array
1.191 + *
1.192 + * @param aIndex index of element to return
1.193 + * @return descriptor representing array element, ownership is not passed
1.194 + */
1.195 + IMPORT_C virtual TPtrC MdcaPoint(TInt aIndex) const;
1.196 +
1.197 +protected:
1.198 + CAknQueryValuePhoneArray();
1.199 +
1.200 + /**
1.201 + * 2nd stage construction.
1.202 + *
1.203 + */
1.204 + void ConstructL();
1.205 +
1.206 +private:
1.207 + // the following members are not owned
1.208 + TextArray* iArray;
1.209 + TInt iFormattedStringSize;
1.210 + };
1.211 +
1.212 +#endif // __AKNQUERYVALUEPHONE_H__
1.213 +