epoc32/include/mw/aknqueryvaluephone.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* 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
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description: 
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
// AknQueryValuePhone.h
williamr@2
    19
//
williamr@2
    20
// Copyright (c) 2001 Symbian Ltd.  All rights reserved.
williamr@2
    21
//
williamr@2
    22
williamr@2
    23
#if !defined(__AKNQUERYVALUEPHONE_H__)
williamr@2
    24
#define __AKNQUERYVALUEPHONE_H__
williamr@2
    25
williamr@2
    26
#include <bamdesca.h>
williamr@2
    27
#include <eikdialg.h>
williamr@2
    28
#include "AknQueryValue.h"
williamr@2
    29
williamr@2
    30
class CAknQueryValuePhoneArray;
williamr@2
    31
williamr@2
    32
/**
williamr@2
    33
 * Encapsulates a string. Provides an interface to create a dialog
williamr@2
    34
 * containing a phone number query control, which will edit the value. Optionally 
williamr@2
    35
 * allows the value to be changed by selecting from a list of values. 
williamr@2
    36
 *
williamr@2
    37
 */
williamr@2
    38
NONSHARABLE_CLASS(CAknQueryValuePhone) : public CAknQueryValue
williamr@2
    39
    {
williamr@2
    40
public:
williamr@2
    41
    /**
williamr@2
    42
     * First stage of two stage construction.
williamr@2
    43
     *
williamr@2
    44
    */
williamr@2
    45
	IMPORT_C static CAknQueryValuePhone* NewL();
williamr@2
    46
	
williamr@2
    47
	/**
williamr@2
    48
     * First stage of two stage construction.
williamr@2
    49
     *
williamr@2
    50
    */
williamr@2
    51
	IMPORT_C static CAknQueryValuePhone* NewLC();
williamr@2
    52
	
williamr@2
    53
    IMPORT_C virtual ~CAknQueryValuePhone();
williamr@2
    54
	
williamr@2
    55
	/**
williamr@2
    56
     * Set the array.
williamr@2
    57
     * 
williamr@2
    58
     * @param aArray pointer to array, ownership is not passed
williamr@2
    59
    */
williamr@2
    60
	IMPORT_C void SetArrayL(const CAknQueryValuePhoneArray* aArray);
williamr@2
    61
	
williamr@2
    62
	/**
williamr@2
    63
     * Set the string used for the query caption to be a string other than the default.
williamr@2
    64
     *
williamr@2
    65
     * @param aResourceId		resource id of string to use for caption.
williamr@2
    66
     *
williamr@2
    67
    */
williamr@2
    68
	IMPORT_C void SetQueryCaption(TInt aResourceId);
williamr@2
    69
	
williamr@2
    70
    /**
williamr@2
    71
     * Return the current value, which may have been set by the user
williamr@2
    72
     *
williamr@2
    73
     * @return The current value, ownership is not passed
williamr@2
    74
     *
williamr@2
    75
    */	
williamr@2
    76
	IMPORT_C HBufC* Value() const;
williamr@2
    77
	
williamr@2
    78
public: // from MAknQueryValue
williamr@2
    79
    IMPORT_C virtual const MDesCArray* MdcArray() const;
williamr@2
    80
    IMPORT_C virtual HBufC* CurrentValueTextLC();
williamr@2
    81
    IMPORT_C virtual TInt CurrentValueIndex() const;
williamr@2
    82
    IMPORT_C virtual void SetCurrentValueIndex(const TInt aIndex);
williamr@2
    83
    IMPORT_C virtual TBool CreateEditorL();
williamr@2
    84
    
williamr@2
    85
protected:
williamr@2
    86
	CAknQueryValuePhone();
williamr@2
    87
	
williamr@2
    88
    /**
williamr@2
    89
     * Two stage construction
williamr@2
    90
     *
williamr@2
    91
    */	
williamr@2
    92
	void ConstructL();
williamr@2
    93
	
williamr@2
    94
	/**
williamr@2
    95
     * Search for the current value in the list, and set the curent index 
williamr@2
    96
     * to be the found index. If not found, set current index to 1 after the size of the array.
williamr@2
    97
     *
williamr@2
    98
    */
williamr@2
    99
	void CalculateCurrentIndex();
williamr@2
   100
	
williamr@2
   101
	virtual void AppendValueIfNewL();
williamr@2
   102
	
williamr@2
   103
private: // from MAknQueryValue
williamr@2
   104
	IMPORT_C void Reserved_MAknQueryValue();
williamr@2
   105
	
williamr@2
   106
private:
williamr@2
   107
	// the following are member variables
williamr@2
   108
	TInt iQueryCaptionId;
williamr@2
   109
	HBufC* iText;
williamr@2
   110
	TInt iCurrentIndex;
williamr@2
   111
	// the following are not owned
williamr@2
   112
	const CAknQueryValuePhoneArray* iArray;
williamr@2
   113
    };
williamr@2
   114
williamr@2
   115
williamr@2
   116
/**
williamr@2
   117
 * Wraps a descriptor array.
williamr@2
   118
 *
williamr@2
   119
 */
williamr@2
   120
NONSHARABLE_CLASS(CAknQueryValuePhoneArray) : public CBase, public MDesCArray
williamr@2
   121
	{
williamr@2
   122
public:
williamr@2
   123
    /**
williamr@2
   124
     * Typedef for array
williamr@2
   125
     *
williamr@2
   126
    */
williamr@2
   127
	typedef CDesCArray TextArray;
williamr@2
   128
	
williamr@2
   129
	enum {KSafeSizeOfDescriptorForPhoneFormat = 64};
williamr@2
   130
	
williamr@2
   131
public:
williamr@2
   132
    /**
williamr@2
   133
     * Two-phased constructor.
williamr@2
   134
     *
williamr@2
   135
    */
williamr@2
   136
	IMPORT_C static CAknQueryValuePhoneArray* NewL();
williamr@2
   137
	
williamr@2
   138
	/**
williamr@2
   139
     * Two-phased constructor.
williamr@2
   140
     *
williamr@2
   141
    */
williamr@2
   142
	IMPORT_C static CAknQueryValuePhoneArray* NewLC();
williamr@2
   143
	
williamr@2
   144
	IMPORT_C ~CAknQueryValuePhoneArray();
williamr@2
   145
	
williamr@2
   146
	/**
williamr@2
   147
     * Set the array of values. 
williamr@2
   148
     * Note that client can use any implementation of array class, but must pass in a 
williamr@2
   149
     * TArray generated from it (by calling the Array() method on the array class)
williamr@2
   150
     *
williamr@2
   151
     * @param aArray  array of values, ownership is passed
williamr@2
   152
    */
williamr@2
   153
	IMPORT_C void SetArray(TextArray& aArray);
williamr@2
   154
	
williamr@2
   155
	/**
williamr@2
   156
     * Get the array of values as a TArray. 
williamr@2
   157
     * Note that client can use any implementation of array class, but the array is 
williamr@2
   158
     * treated as a TArray.
williamr@2
   159
     *
williamr@2
   160
     * @return array of values, ownership is not passed
williamr@2
   161
    */
williamr@2
   162
	IMPORT_C TextArray* Array() const;
williamr@2
   163
williamr@2
   164
/**
williamr@2
   165
 * Return the size of a maximal time string formated using the format string 
williamr@2
   166
 * that was supplied during construction of this instance.
williamr@2
   167
 * Two versions to eliminate compiler warnings.
williamr@2
   168
 *
williamr@2
   169
 * @return length of formatted string.
williamr@2
   170
 */	
williamr@2
   171
#ifdef __WINS__
williamr@2
   172
	IMPORT_C const TInt FormattedStringSize() const;
williamr@2
   173
#else
williamr@2
   174
	IMPORT_C TInt FormattedStringSize() const;
williamr@2
   175
#endif // __WINS__
williamr@2
   176
williamr@2
   177
public:
williamr@2
   178
	// from MDesCArray
williamr@2
   179
	/**
williamr@2
   180
     * @return count of contained array
williamr@2
   181
     *
williamr@2
   182
    */
williamr@2
   183
    IMPORT_C virtual TInt MdcaCount() const;
williamr@2
   184
    
williamr@2
   185
    /**
williamr@2
   186
     * Returns array element, pass through to contained descriptor array
williamr@2
   187
     *
williamr@2
   188
     * @param aIndex   index of element to return
williamr@2
   189
     * @return descriptor representing array element, ownership is not passed
williamr@2
   190
    */
williamr@2
   191
    IMPORT_C virtual TPtrC MdcaPoint(TInt aIndex) const;
williamr@2
   192
    
williamr@2
   193
protected:
williamr@2
   194
	CAknQueryValuePhoneArray();
williamr@2
   195
	
williamr@2
   196
    /**
williamr@2
   197
     * 2nd stage construction.
williamr@2
   198
     *
williamr@2
   199
    */
williamr@2
   200
	void ConstructL();
williamr@2
   201
	
williamr@2
   202
private:
williamr@2
   203
	// the following members are not owned
williamr@2
   204
	TextArray* iArray;
williamr@2
   205
	TInt iFormattedStringSize;
williamr@2
   206
	};
williamr@2
   207
williamr@2
   208
#endif // __AKNQUERYVALUEPHONE_H__
williamr@2
   209