classicui_pub/editors_api/inc/EIKMFNE.H
changeset 0 2f259fa3e83a
child 18 fcdfafb36fe7
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #if !defined(__EIKMFNE_H__)
       
    20 #define __EIKMFNE_H__
       
    21 
       
    22 #if !defined(__EIKBCTRL_H__)
       
    23 #include <eikbctrl.h>
       
    24 #endif
       
    25 
       
    26 #if !defined(__COEDEF_H__)
       
    27 #include <coedef.h>
       
    28 #endif
       
    29 
       
    30 #if !defined(__COEINPUT_H__)
       
    31 #include <coeinput.h>
       
    32 #endif
       
    33 
       
    34 // For MEikCalendarObserver
       
    35 #if !defined(__EIKCAL_H__)
       
    36 #include <eikcal.h>	
       
    37 #endif
       
    38 
       
    39 #if !defined(__EIKDEF_H__)
       
    40 #include <eikdef.h>
       
    41 #endif
       
    42 
       
    43 #if !defined(__BABITFLAGS_H__)
       
    44 #include <babitflags.h>
       
    45 #endif
       
    46 
       
    47 // For MAknMfneCommandObserver
       
    48 #if !defined(__AKNMFNECOMMANDOBSERVER)
       
    49 #include <aknmfnecommandobserver.h>
       
    50 #endif //!defined(__AKNMFNECOMMANDOBSERVER)
       
    51 
       
    52 //
       
    53 // Forward Declarations
       
    54 //
       
    55 class CEikonEnv;
       
    56 class CTimeEditor;
       
    57 class CDateEditor;
       
    58 
       
    59 // Skin-related API forward declarations
       
    60 class MAknsControlContext;
       
    61 
       
    62 // Extension object within CEikMfne
       
    63 class CEikMfneExtension;
       
    64 
       
    65 //
       
    66 /**
       
    67  * Abstract base class for fields within a multi-field numeric editor.
       
    68  */
       
    69 class CEikMfneField : public CBase
       
    70 	{
       
    71 public:
       
    72     /**
       
    73      * The type of highlight.
       
    74      */
       
    75 	enum THighlightType
       
    76 		{
       
    77 		/** Inverse video. */
       
    78 		EInverseVideo,
       
    79 		/** The cursor is visible in the field so that highlighting is not used. */
       
    80 		ECursor
       
    81 		};
       
    82 protected:
       
    83     /**
       
    84      * Protected default constructor.
       
    85      *
       
    86      * Sets the minimum width of the field to zero pixels.
       
    87      */
       
    88 	IMPORT_C CEikMfneField();
       
    89 public:
       
    90 	void Draw(CWindowGc& aGc, const CFont& aFont, const TPoint& aTopLeft) const;
       
    91 	TInt WidthInPixels(const CFont& aFont) const;
       
    92 	TInt DistanceFromStartOfFieldToEndOfTextInPixels(const CFont& aFont) const;
       
    93 
       
    94     /**
       
    95      * An implementation of this pure virtual function should
       
    96      * get the field's maximum width in pixels.
       
    97      *
       
    98      * @param aFont The font.
       
    99      * @param aShrinkToMinimumSize ETrue to shrink the width to the minimum required.
       
   100      * @return The field's maximum width in pixels.
       
   101      */
       
   102 	virtual TInt MaximumWidthInPixels(const CFont& aFont, TBool aShrinkToMinimumSize)=0;
       
   103 
       
   104     /**
       
   105      * An implementation of this pure virtual function should
       
   106      * return the field's input capabilities.
       
   107      *
       
   108      * @return The field's input capabilities.
       
   109      */
       
   110 	virtual TCoeInputCapabilities InputCapabilities() const=0;
       
   111 	
       
   112 	/**
       
   113 	 * Derived classes' implementation of function should
       
   114 	 * return whether the field is editable.
       
   115 	 *
       
   116 	 * This implementation returns EFalse.
       
   117 	 *
       
   118 	 * @return EFalse.
       
   119      */
       
   120 	IMPORT_C virtual TBool IsEditable() const;
       
   121 	
       
   122 	/**
       
   123 	 * Derived classes' implementation of function should
       
   124 	 * return whether the field is valid
       
   125 	 *
       
   126 	 * This implementation returns ETrue.
       
   127 	 *
       
   128 	 * @return ETrue.
       
   129      */	
       
   130 	IMPORT_C virtual TBool IsValid() const;
       
   131 	
       
   132 	/**
       
   133 	 * An implementation of this function should get the
       
   134 	 * field's highlight type.
       
   135      * 
       
   136      * May only be called if IsEditable() returns ETrue.
       
   137      * 
       
   138      * This implementation panics in debug builds and returns
       
   139      * a dummy value in release builds.
       
   140      *
       
   141      * @return EInverseVideo.
       
   142      */
       
   143 	IMPORT_C virtual THighlightType HighlightType() const;
       
   144 	
       
   145 	/**
       
   146 	 * An implementation of this function should handle a key event.
       
   147      *
       
   148      * May only be called if IsEditable() returns ETrue.
       
   149      * This implementation panics in debug builds and is
       
   150      * empty in release builds.
       
   151      *
       
   152      * @param aFont The control's font.
       
   153      * @param aKeyEvent The key event passed on from the multi-field numeric editor.
       
   154      * @param aInterpretLeftAndRightAsEarEvents Not used. 
       
   155      * @param aDataAltered On return, indicates whether or not the field
       
   156      *                     contents changed. If EFalse, left and right arrow
       
   157      *                     key presses indicate a movement to the preceding of
       
   158      *                     following field, if ETrue they are ignored.
       
   159      * @param aHighlightIncrement On return: -1 indicates the previous field is
       
   160      *                            highlighted,0 indicates the highlight is
       
   161      *                            unchanged and 1 indicates the following field
       
   162      *                            is highlighted.
       
   163      */
       
   164 	IMPORT_C virtual void HandleKey(const CFont& aFont, const TKeyEvent& aKeyEvent, TBool aInterpretLeftAndRightAsEarEvents, TBool& aDataAltered, TInt& aHighlightIncrement);
       
   165  	
       
   166  	/**
       
   167  	* An implementation of this function should
       
   168  	* handle de-highlighting the field.
       
   169     *
       
   170     * May only be called if IsEditable() returns ETrue.
       
   171     *
       
   172     * This implementation panics in debug builds and is empty
       
   173     * in release builds.
       
   174     * 
       
   175     * @param aFont The control's font.
       
   176     * @param aEikonEnv The control's environment.
       
   177     * @param aDataAltered On return, set to ETrue if the function caused
       
   178     *                     the field's contents to change, otherwise unchanged.
       
   179     * @param aError On return, changed to ETrue if an error occurred e.g.
       
   180     *               the user entered an invalid value, otherwise unchanged.
       
   181     */
       
   182 	IMPORT_C virtual void HandleDeHighlight(const CFont& aFont, CEikonEnv& aEikonEnv, TBool& aDataAltered, TBool& aError);
       
   183 	
       
   184 	const TDesC& FieldText() const;
       
   185 protected:
       
   186     /**
       
   187      * Handles a left or right arrow key press.
       
   188      *
       
   189      * @param aKey Left or right arrow key: either EKeyLeftArrow or EKeyRightArrow. 
       
   190      * @param aDataAltered On return, ETrue if data is altered as a result of this function.
       
   191      * @param aHighlightIncrement On return, the direction to move the cursor:
       
   192      *                            either -1 if aKey is a left arrow key, or 1 if aKey is a right arrow key.
       
   193      * @panic 3 In debug builds, if aKey is neither a left nor a right arrow key.
       
   194      */
       
   195 	IMPORT_C void HandleLeftOrRightArrow(TChar aKey, TBool& aDataAltered, TInt& aHighlightIncrement);
       
   196 
       
   197     TInt AdditionalWidthForHighlights(const CFont& aFont) const;
       
   198 private:
       
   199 	virtual const TDesC& Text() const=0;
       
   200 protected:
       
   201     /**
       
   202      * The field's minimum width in pixels.
       
   203      */
       
   204 	TInt iMinimumWidthInPixels;
       
   205 	};
       
   206 
       
   207 //
       
   208 
       
   209 /**
       
   210  * A separator field for a multi-field numeric editor.
       
   211  *
       
   212  * For instance, the character that separates time or date components.
       
   213  */
       
   214 NONSHARABLE_CLASS(CEikMfneSeparator) : public CEikMfneField
       
   215 	{
       
   216 private:
       
   217 	CEikMfneSeparator(HBufC* aText);
       
   218 public:
       
   219     /**
       
   220      * Destructor.
       
   221      *
       
   222      * Deletes the separator text that is owned by the object.
       
   223      */
       
   224 	IMPORT_C virtual ~CEikMfneSeparator();
       
   225 	
       
   226 	/**
       
   227 	 * Allocates and constructs a CEikMfneSeparator from resource.
       
   228      * 
       
   229      * Uses an MFNE_SEPARATOR resource.
       
   230      * 
       
   231      * @param aResourceReader The resource reader to use.
       
   232      * @return A newly constructed separator field.
       
   233      */
       
   234 	IMPORT_C static CEikMfneSeparator* NewL(TResourceReader& aResourceReader);
       
   235 	
       
   236 	/**
       
   237 	 * Allocates and constructs a separator.
       
   238      *
       
   239      * @param aText The separator's text. Ownership of aText is transferred.
       
   240      * @return A newly constructed separator.
       
   241      */
       
   242 	IMPORT_C static CEikMfneSeparator* NewL(HBufC* aText); // ownership of aText is transferred when everything that can leave has successfully been done
       
   243 	
       
   244 	/**
       
   245 	 * Sets the separator's text.
       
   246      *
       
   247      * This function transfers ownership of the text and can only be called if the field's text was previously NULL.
       
   248      * 
       
   249      * @param aText The separator's text.
       
   250      * @panic 4 If the separator's text was not previously Null.
       
   251      */
       
   252 	IMPORT_C void SetText(HBufC* aText); // allows later transfer of ownership of text - can only be called if aText was previously NULL
       
   253     
       
   254 private: // framework
       
   255 	virtual TInt MaximumWidthInPixels(const CFont& aFont, TBool aShrinkToMinimumSize);
       
   256 	virtual TCoeInputCapabilities InputCapabilities() const;
       
   257 	virtual const TDesC& Text() const;
       
   258 private:
       
   259 	HBufC* iText;
       
   260 	};
       
   261 
       
   262 //
       
   263 
       
   264 /**
       
   265  * A number field within a multi-field numeric editor.
       
   266  */
       
   267 NONSHARABLE_CLASS(CEikMfneNumber) : public CEikMfneField
       
   268 	{
       
   269 public:
       
   270     /**
       
   271      * Flags for the number field.
       
   272      *
       
   273      * EFillWithLeadingZeros, EPreserveOldWidthBeforeEditing and ERepresentsYear can only be set if EPublicallySettableFlags is set.
       
   274      */
       
   275 	enum
       
   276 		{
       
   277 		/** Prepends the number field's value with leading zeros up to the maximum allowable width of the field. */
       
   278 		EFillWithLeadingZeros			=0x1,
       
   279 		/** The field's minimum width in pixels is set to the current text's width in pixels. */
       
   280 		EPreserveOldWidthBeforeEditing	=0x2,
       
   281 		/** The number is a year. */
       
   282 		ERepresentsYear					=0x4,
       
   283 		/** Used internally to make sure only the previous three values are set. */
       
   284 		EPublicallySettableFlags		=EFillWithLeadingZeros|EPreserveOldWidthBeforeEditing|ERepresentsYear
       
   285 		};
       
   286 private:
       
   287 	enum
       
   288 		{
       
   289 		EIsBeingEditedWithCursor		=0x8,
       
   290 		EIsUninitialised				=0x10,
       
   291 		EFillWithTrailingZeros          =0x20
       
   292 		};
       
   293 private:
       
   294 	CEikMfneNumber(TInt aMinimumValue, TInt aMaximumValue, TUint32 aFlags);
       
   295 	void ConstructL();
       
   296 public:
       
   297     /**
       
   298      * Destructor.
       
   299      *
       
   300      * Deletes the number field's text.
       
   301      */
       
   302 	IMPORT_C virtual ~CEikMfneNumber();
       
   303 	
       
   304 	/**
       
   305 	 * Allocates and constructs a CEikMfneNumber from resource.
       
   306      *
       
   307      * Obtains flags and the minimum and maximum values from an MFNE_NUMBER resource. Then calls the overloaded NewL() function.
       
   308      *
       
   309      * @param aFont The font to use.
       
   310      * @param aResourceReader The resource reader to use.
       
   311      * @return A newly constructed number field.
       
   312 	 */
       
   313 	IMPORT_C static CEikMfneNumber* NewL(const CFont& aFont, TResourceReader& aResourceReader);
       
   314 
       
   315     /**
       
   316      * Allocates and constructs a CEikMfneNumber with the specified parameters.
       
   317      *
       
   318      * @param aFont The font to use.
       
   319      * @param aMinimumValue The minimum value.
       
   320      * @param aMaximumValue The maximum value.
       
   321      * @param aInitialValue The initial value. This must be greater than the minimum value and less than the maximum value.
       
   322      * @param aFlags The number field's flags. See the Anonymous enum.
       
   323      * @return A newly constructed number field.
       
   324      * @panic 8 If the initial value is not greater than or equal to the minimum value and less than or equal to the maximum value.
       
   325      */
       
   326 	IMPORT_C static CEikMfneNumber* NewL(const CFont& aFont, TInt aMinimumValue, TInt aMaximumValue, TInt aInitialValue, TUint32 aFlags);
       
   327 	
       
   328 	/**
       
   329 	 * Sets the minimum and maximum allowable values.
       
   330      *
       
   331      * @param aMinimumValue The minimum value. Must be less than or equal to the maximum value.
       
   332      * @param aMaximumValue The maximum value.
       
   333      * @param aFont The font in use.
       
   334      * @panic 9 If the minimum value is greater than the maximum value or if the minimum/maximum text length is greater than the maximum number of digits.
       
   335      */
       
   336 	IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue, const CFont& aFont); // only values inside the initial minimum and maximum are permitted
       
   337 	
       
   338 	/**
       
   339 	 * Gets the minimum and maximum allowable values.
       
   340 	 *
       
   341 	 * @param aMinimumValue On return, the minimum allowable value.
       
   342 	 * @param aMaximumValue On return, the maximum allowable value.
       
   343      */
       
   344 	IMPORT_C void GetMinimumAndMaximum(TInt& aMinimumValue, TInt& aMaximumValue) const;
       
   345 	
       
   346 	/** 
       
   347 	 * Sets the field's current value.
       
   348      * @param aValue The field's current value. This must be between the minimum value and the maximum value.
       
   349      * @param aFont The font.
       
   350      * @panic 11 In debug builds only, if the value is less than the minimum value or greater than the maximum value.
       
   351      */
       
   352 	IMPORT_C void SetValue(TInt aValue, const CFont& aFont);
       
   353  	
       
   354  	/**
       
   355  	 * Gets the number field's value. Note that this function will leave
       
   356  	 * if the value is not valid, i.e. the number of digits is zero
       
   357  	 * or the value is outside of the minimum and maximum range.
       
   358      *
       
   359      * @return The field's value.
       
   360      */
       
   361 	IMPORT_C TInt Value() const;
       
   362 	
       
   363     /**
       
   364 	 * Returns ETrue if the field contains more than zero
       
   365 	 * digits.
       
   366      *
       
   367 	 * @return ETrue if the field contains more than zero digits.
       
   368      */	
       
   369 	IMPORT_C virtual TBool IsValid() const;
       
   370 
       
   371     /**
       
   372      * Sets the uninitialized status of the field.
       
   373      * 
       
   374      * @param aUninitialised If ETrue, sets the field as uninitialized,
       
   375      *                       i.e. it doesn't display anything.
       
   376      */
       
   377 	IMPORT_C void SetUninitialised(TBool aUninitialised);
       
   378 	
       
   379 	/**
       
   380 	 * Gets the uninitialized status of the field.
       
   381 	 * 
       
   382 	 * @return ETrue, if the field is set as uninitialized.
       
   383 	 */
       
   384 	IMPORT_C TBool IsUninitialised() const;
       
   385 
       
   386 public:
       
   387     /**
       
   388      * Sets the digit display type.
       
   389      *
       
   390      * @since S60 v3.1
       
   391      * @param aDigitType The digit display type to bet set for this number field
       
   392      * @param aFont The font of the MFNE that owns this field, usually retrieved with CEikMfne::Font()
       
   393      */
       
   394 	IMPORT_C void SetDigitType(TDigitType aDigitType, const CFont& aFont);
       
   395 
       
   396     /**
       
   397      * Gets the digit display type.
       
   398      *
       
   399      * @since S60 v3.1
       
   400      * @return The digit display type of this number field
       
   401      */
       
   402 	IMPORT_C TDigitType DigitType() const;
       
   403 
       
   404 	/**
       
   405 	 * Derive and set digit display type from locale information.
       
   406 	 *
       
   407 	 * @since S60 v3.1
       
   408 	 * @param aFont The font of the MFNE that owns this field, usually retrieved with CEikMfne::Font()
       
   409 	 */
       
   410 	IMPORT_C void RefreshDigitType(const CFont& aFont);
       
   411 	
       
   412 	void SetTrailingZeros();
       
   413 
       
   414 public:
       
   415 	TBool IsTextNull() const;
       
   416 private: // framework
       
   417 	virtual TInt MaximumWidthInPixels(const CFont& aFont, TBool aShrinkToMinimumSize);
       
   418 	virtual TCoeInputCapabilities InputCapabilities() const;
       
   419 	virtual TBool IsEditable() const;
       
   420 	virtual THighlightType HighlightType() const;
       
   421 	virtual void HandleKey(const CFont& aFont, const TKeyEvent& aKeyEvent, TBool aInterpretLeftAndRightAsEarEvents, TBool& aDataAltered, TInt& aHighlightIncrement);
       
   422 	virtual void HandleDeHighlight(const CFont& aFont, CEikonEnv& aEikonEnv, TBool& aDataAltered, TBool& aError);
       
   423 	virtual const TDesC& Text() const;
       
   424 private:
       
   425 	TInt MaximumNumberOfDigits() const;
       
   426 	TInt NumberOfDigits() const;
       
   427 	void SetTextToValue(TInt aValue, const CFont& aFont);
       
   428 	TInt ValueFromText() const;
       
   429 	TBool ConvertsIntoValidValue(TInt& aValue) const;
       
   430 
       
   431 private: // International digit support
       
   432 	TChar NormalizeDigit(TChar aChar);
       
   433 	TText ZeroCharacter() const;
       
   434 	TText NegativeCharacter() const;
       
   435 
       
   436 private:
       
   437 	TInt iMinimumValue;
       
   438 	TInt iMaximumValue;
       
   439 	TInt iMaxDigits;
       
   440 	TUint32 iFlags;
       
   441 	HBufC* iText;
       
   442 	TChar iNudgeCharMinus;
       
   443 	TChar iNudgeCharPlus;
       
   444 	TInt iMaxDigitsMinimumValue;
       
   445     TInt iMaxDigitsMaximumValue;
       
   446 	TDigitType	iDigitType;
       
   447 	};
       
   448 
       
   449 //
       
   450 
       
   451 /**
       
   452  * A symbol field for a multi-field numeric editor.
       
   453  *
       
   454  * For instance, the AM / PM text in a time editor. In this case, the field contains 2 symbolic items one each for the AM and PM text strings.
       
   455  */
       
   456 NONSHARABLE_CLASS(CEikMfneSymbol) : public CEikMfneField
       
   457 	{
       
   458 public:
       
   459     /**
       
   460      * An item within a symbol field in an MFNE.
       
   461      */
       
   462 	NONSHARABLE_CLASS(CItem) : public CBase
       
   463 		{
       
   464 	private:
       
   465 		CItem(TInt aId, TChar aKeyToMatch, HBufC* aText);
       
   466 	public:
       
   467 	    /**
       
   468 	     * Destructor.
       
   469          *
       
   470          * Deletes the item's text.
       
   471          */
       
   472 		IMPORT_C virtual ~CItem();
       
   473 		
       
   474 		/**
       
   475 		 * Allocates and constructs a symbolic item from resource.
       
   476          *
       
   477          * Uses a MFNE_SYMBOLIC_ITEM resource.
       
   478          * @param aResourceReader The resource reader to use.
       
   479          * @return A newly constructed symbolic item.
       
   480          */
       
   481 		IMPORT_C static CItem* NewL(TResourceReader& aResourceReader);
       
   482 		
       
   483 		/**
       
   484 		 * Allocates and constructs a symbolic item.
       
   485          *
       
   486          * @param aId The ID of the symbolic item that uniquely identifies the item in the field.
       
   487          * @param aKeyToMatch The key that represents the item. This is for character matching, not for display.
       
   488          * @param aText The text to be drawn. Ownership of aText is transferred when everything that can leave has successfully completed.
       
   489          * @return A newly constructed symbolic item.
       
   490          */
       
   491 		IMPORT_C static CItem* NewL(TInt aId, TChar aKeyToMatch, HBufC* aText); // ownership of aText is transferred when everything that can leave has successfully been done
       
   492         
       
   493         /**
       
   494          * Sets the symbolic item's text. 
       
   495          * 
       
   496          * The item takes ownership of aText.
       
   497          * 
       
   498          * @param aText The symbolic item's text.
       
   499          * @panic 19 In debug builds if the symbolic item's text was not
       
   500          *           previously Null.
       
   501          */
       
   502 		IMPORT_C void SetText(HBufC* aText); // allows later transfer of ownership of text - can only be called if aText was previously NULL
       
   503 	private:
       
   504 		friend class CEikMfneSymbol;
       
   505 	private:
       
   506 		TInt iId;
       
   507 		TCharF iKeyToMatch;
       
   508 		HBufC* iText;
       
   509 		};
       
   510 private:
       
   511 	CEikMfneSymbol(TInt aNumSymbolicItems);
       
   512 public:
       
   513     /**
       
   514      * Destructor.
       
   515      * 
       
   516      * Deletes the array of symbolic items owned by the object.
       
   517      */
       
   518 	IMPORT_C virtual ~CEikMfneSymbol();
       
   519 	
       
   520 	/**
       
   521      * Allocates and constructs a CEikMfneSymbol from resource.
       
   522      * 
       
   523      * Uses a MFNE_SYMBOL resource. The first item is set as current.
       
   524      * 
       
   525      * @param aResourceReader The resource reader to use.
       
   526      * @return A newly constructed symbol.
       
   527      * @panic 15 If there is not more than one symbol.
       
   528      */
       
   529 	IMPORT_C static CEikMfneSymbol* NewL(TResourceReader& aResourceReader);
       
   530 	
       
   531     /**
       
   532      * Allocates and constructs a CEikMfneSymbol.
       
   533      * 
       
   534      * The first item is set as current.
       
   535      * 
       
   536      * @param aNumSymbolicItems The number of symbolic items. Must be
       
   537      * greater than one. All items are set to NULL.
       
   538      * @return A newly constructed symbol.
       
   539      * @panic 15 If there is not more than one symbol.
       
   540      */
       
   541 	IMPORT_C static CEikMfneSymbol* NewL(TInt aNumSymbolicItems);
       
   542 
       
   543     /**
       
   544      * Adds the specified symbolic item at the first available position in
       
   545      * the array.
       
   546      * 
       
   547      * This should be called by the container only if construction was not
       
   548      * made from resource.
       
   549      * 
       
   550      * @param aSymbolicItem The symbol to add. Ownership of aSymbolicItem
       
   551      * is transferred to this.
       
   552      * @param aMakeCurrent ETrue to make the added symbol current.
       
   553      * @panic 16 In debug build if the symbolic item array has not yet been
       
   554      * created.
       
   555      * @panic 17 If the array is full.
       
   556      */
       
   557 	IMPORT_C void AddSymbolicItem(CItem* aSymbolicItem, TBool aMakeCurrent); // to be called by container only if not constructed from resource - ownership of aSymbolicItem is transferred to "this"
       
   558 	
       
   559 	/**
       
   560      * Sets the current item to the one specified.
       
   561      * 
       
   562      * 
       
   563      * @param aId The id of the new current item.
       
   564      * @panic 18 If the specified item does not exist.
       
   565      */
       
   566 	IMPORT_C void SetCurrentSymbolicItemToId(TInt aId);
       
   567 	
       
   568     /**
       
   569      * Gets the current symbol's ID.
       
   570      * 
       
   571      * @return The current symbol's ID.
       
   572      */
       
   573 	IMPORT_C TInt IdOfCurrentSymbolicItem() const;
       
   574 	
       
   575     /**
       
   576      * Sets the uninitialized status of the field.
       
   577      * 
       
   578      * @param aUninitialised If ETrue, sets the field as uninitialized,
       
   579      *                       i.e. doesn't display anything.
       
   580      */
       
   581 	IMPORT_C void SetUninitialised(TBool aUninitialised);
       
   582 	
       
   583 	/**
       
   584 	 * Gets the uninitialized status of the field.
       
   585 	 * 
       
   586 	 * @return ETrue, if the field is set as uninitialized.
       
   587 	 */
       
   588 	IMPORT_C TBool IsUninitialised() const;
       
   589 	
       
   590 private: // framework
       
   591 	virtual TInt MaximumWidthInPixels(const CFont& aFont, TBool aShrinkToMinimumSize);
       
   592 	virtual TCoeInputCapabilities InputCapabilities() const;
       
   593 	virtual TBool IsEditable() const;
       
   594 	virtual THighlightType HighlightType() const;
       
   595 	virtual void HandleKey(const CFont& aFont, const TKeyEvent& aKeyEvent, TBool aInterpretLeftAndRightAsEarEvents, TBool& aDataAltered, TInt& aHighlightIncrement);
       
   596 	virtual void HandleDeHighlight(const CFont& aFont, CEikonEnv& aEikonEnv, TBool& aDataAltered, TBool& aError);
       
   597 	virtual const TDesC& Text() const;
       
   598 private:
       
   599 	TInt CurrentSymbolicItem() const;
       
   600 	void SetCurrentSymbolicItem(TInt aCurrentSymbolicItem);
       
   601 private:
       
   602 	TInt iNumSymbolicItems;
       
   603 	TInt iCurrentSymbolicItem;
       
   604 	CItem** iSymbolicItems;
       
   605 	};
       
   606 
       
   607 //
       
   608 
       
   609 /**
       
   610  * Multi-field numeric editor abstract base class.
       
   611  * 
       
   612  * This is a set of fields, where a field can be a number, a symbol or
       
   613  * a separator. Field classes are derived from CEikMfneField.
       
   614  * 
       
   615  * Concrete multi-field numeric editors are derived from this class and
       
   616  * should provide the following:
       
   617  * 
       
   618  * * A virtual destructor if the class introduces new data members which
       
   619  * are allocated on the heap.
       
   620  * 
       
   621  * * A ConstructL() function; this is used to initialise a multi-field
       
   622  * numeric editor.
       
   623  * 
       
   624  * * A ConstructFromResourceL() function; this is used to initialise a
       
   625  * multi-field numeric editor from a resource.
       
   626  * 
       
   627  * * A data member to store the editor's value.
       
   628  * 
       
   629  * * Functions to set and get the editor's value.
       
   630  * 
       
   631  * * Functions to set the minimum and maximum allowable values.
       
   632  */
       
   633 class CEikMfne : public CEikBorderedControl, public MAknMfneCommandObserver
       
   634 	{
       
   635 public:
       
   636 	// miscellaneous functions
       
   637     /**
       
   638      * Default constructor.
       
   639      */
       
   640 	IMPORT_C CEikMfne();
       
   641 	
       
   642 	/**
       
   643      * Destructor.
       
   644      * 
       
   645      * This function is virtual which ensures that if delete is explicitly
       
   646      * called on a CEikMfne pointer which points to a derived class
       
   647      * instance, the derived class destructor is called.
       
   648      */
       
   649 	IMPORT_C virtual ~CEikMfne();
       
   650 
       
   651     /**
       
   652      * Allocates a field array containing aNumFields elements. 
       
   653      * 
       
   654      * This should be called by the container only if a derived control is
       
   655      * not constructed from a resource.
       
   656      * 
       
   657      * @param aNumFields The number of fields.
       
   658      * @panic 20 In debug builds, if there is already a field in the editor.
       
   659      */
       
   660 	IMPORT_C void CreateFieldArrayL(TInt aNumFields); // to be called by container only if not constructed from resource
       
   661 
       
   662     /**
       
   663      * Adds a field.
       
   664      * 
       
   665      * The field is added as the first empty element in the field array or,
       
   666      * if there is no current field, aField becomes the current field.
       
   667      * 
       
   668      * This should be called by the container only if a derived control is
       
   669      * not constructed from a resource.
       
   670      * 
       
   671      * Ownership of aField is transferred to this multi-field numeric
       
   672      * editor.
       
   673      * 
       
   674      * @param aField A field.
       
   675      * @panic 22 If the field array has not been allocated.
       
   676      */
       
   677 	IMPORT_C void AddField(CEikMfneField* aField); // to be called by container only if not constructed from resource - ownership of aField is transferred to "this"
       
   678 
       
   679     /**
       
   680      * Deletes the editor's field and the field array.
       
   681      * 
       
   682      * After a call to this, CreateFieldArrayL() can be called again.
       
   683      */
       
   684 	IMPORT_C void ResetFieldArray(); // after this CreateFieldArrayL() can be called again
       
   685 	
       
   686 	/**
       
   687      * Gets the control's border margins.
       
   688      * 
       
   689      * @return The control's margins.
       
   690      */
       
   691 	IMPORT_C TMargins BorderMargins() const;
       
   692 	
       
   693     /**
       
   694      * Draws immediately, and then leaves with an info message containing a
       
   695      * formatted time/date string.
       
   696      * 
       
   697      * The time/date is passed to the function, as is the resource which
       
   698      * contains the format string which defines how it is to be formatted.
       
   699      * 
       
   700      * @param aResourceId The resource containing the time/date format. See
       
   701      * TTime::FormatL().
       
   702      * @param aTimeDate The object containing the time/date to be displayed.
       
   703      */
       
   704 	IMPORT_C void DrawNowAndLeaveWithTimeDateFormatInfoMsgL(TInt aResourceId, const TTime& aTimeDate) const;
       
   705 
       
   706     /**
       
   707      * Gets the CEikMfneField at the specified index.
       
   708      * 
       
   709      * @param aField The field index.
       
   710      * @return The requested field, or NULL if the index is less than zero
       
   711      * or greater than the number of fields.
       
   712      */
       
   713 	IMPORT_C CEikMfneField* Field(TInt aField) const;
       
   714 	
       
   715 public:
       
   716 	// some utility functions which other classes may find useful
       
   717 	
       
   718 	/**
       
   719      * A utility function which reads seconds, minutes and hours from a
       
   720      * resource and returns the corresponding TTime value.
       
   721      * 
       
   722      * @param aResourceReader A resource reader.
       
   723      * @return The time value read from the resource.
       
   724      */
       
   725 	IMPORT_C static TTime ReadTime(TResourceReader& aResourceReader);
       
   726 
       
   727     /**
       
   728      * A utility function which reads days, months and years from a resource
       
   729      * and returns the corresponding TTime value.
       
   730      * 
       
   731      * @param aResourceReader A resource reader.
       
   732      * @return The date value read from the resource. The hours, minutes,
       
   733      * seconds values are set to zero.
       
   734      */
       
   735 	IMPORT_C static TTime ReadDate(TResourceReader& aResourceReader);
       
   736 
       
   737     /**
       
   738      * A utility function which reads seconds, minutes, hours, days, months
       
   739      * and years from a resource and returns the corresponding TTime value.
       
   740      * 
       
   741      * @param aResourceReader A resource reader.
       
   742      * @return The time/date value read from the resource.
       
   743      */
       
   744 	IMPORT_C static TTime ReadTimeAndDate(TResourceReader& aResourceReader);
       
   745 	
       
   746     /**
       
   747      * Reads a duration value from a resource.
       
   748      * 
       
   749      * @param aResourceReader A resource reader.
       
   750      * @return The duration, in seconds.
       
   751      */
       
   752 	IMPORT_C static TTimeIntervalSeconds ReadDuration(TResourceReader& aResourceReader);
       
   753 	
       
   754     /**
       
   755      * Reads a time offset from a resource. 
       
   756      * 
       
   757      * This is identical to ReadDuration(), except that negative offsets
       
   758      * are allowed.
       
   759      * 
       
   760      * @param aResourceReader A resource reader.
       
   761      * @return The duration, in seconds.
       
   762      */
       
   763 	IMPORT_C static TTimeIntervalSeconds ReadTimeOffset(TResourceReader& aResourceReader);
       
   764     
       
   765     /**
       
   766      * Converts a time duration to seconds.
       
   767      * 
       
   768      * @param aTime The date and time to be converted.
       
   769      * @return The time duration in seconds.
       
   770      */
       
   771 	IMPORT_C static TTimeIntervalSeconds Convert(const TTime& aTime);
       
   772     
       
   773     /**
       
   774      * Converts a time duration in seconds to hours, minutes and seconds.
       
   775      * 
       
   776      * @param aTimeIntervalSeconds The number of seconds to be converted.
       
   777      * @return The date/time duration.
       
   778      */
       
   779 	IMPORT_C static TTime Convert(const TTimeIntervalSeconds& aTimeIntervalSeconds);
       
   780     //
       
   781     /**
       
   782      * Gets the index into the field array of the current field.
       
   783      * 
       
   784      * @return The current field's index.
       
   785      */
       
   786     inline TInt CurrentField() const;
       
   787 
       
   788     /**
       
   789      * Gets the number of fields.
       
   790      * 
       
   791      * @return The number of fields in the editor.
       
   792      */
       
   793     inline TInt NumFields() const;
       
   794 
       
   795 public: // AVKON addition
       
   796     /**
       
   797      * Settable features for MFNE. See SetFeature().
       
   798      *
       
   799      * @since S60 3.2
       
   800      */
       
   801     enum TFeatureId
       
   802         {
       
   803         /** Tries to prevent MFNE drawing outside its rect,
       
   804             event if it smaller than MinimumSize().
       
   805             0 (or EFalse) parameter disables this, non-zero
       
   806             (or ETrue) enables the feature. */
       
   807         EClipGcToRect,
       
   808         
       
   809         /** Disables VKB. Non-zero (or ETrue) parameter disables VKB, 
       
   810             0 (or EFalse) enables VKB. When disabled, 
       
   811             editor doesn't request PenInputServer to start VKB */ 
       
   812         EDisablePenInput,
       
   813         
       
   814         /** Support finger input. Paramter is TFingerSupportParams.*/ 
       
   815         EFingerSupport,
       
   816         
       
   817         ELaunchPenInputAutomatic,
       
   818 
       
   819         EPartialScreenInput
       
   820         };
       
   821     /** Parameter for finger support feature: 
       
   822       * 0 means disable the suppor; 
       
   823       * 1 means enable the support;
       
   824       * 2 means enable the support with highlight of whole text.
       
   825       */
       
   826     enum TFingerSupportParams
       
   827         {
       
   828         EDisaleFingerSupport,
       
   829         EnableFingerSupport,
       
   830         EnableWithAllHighlight
       
   831         };
       
   832     
       
   833     /**
       
   834      * Sets the alignment of the editor. The editor alignments, defined in
       
   835      * avkon.hrh, are EAknEditorAlignNone, EAknEditorAlignCenter,
       
   836      * EAknEditorAlignLeft, EAknEditorAlignRight or EAknEditorAlignBidi.
       
   837      * 
       
   838      * @param aAlignment The editor's alignment
       
   839      */
       
   840     IMPORT_C void SetMfneAlignment(TInt aAlignment);
       
   841     
       
   842     /**
       
   843      * Sets whether the editor consumes up and down key events. If this is
       
   844      * set to EFalse, the editor returns EKeyWasNotConsumed upon receiving
       
   845      * EKeyDownArrow or EKeyUpArrow key event and doesn't send the key event to
       
   846      * the current field.
       
   847      * 
       
   848      * @param aConsume If EFalse, OfferKeyEventL() returns
       
   849      * EKeyWasNotConsumed when up and down key events are received.
       
   850      */
       
   851     IMPORT_C void SetUpAndDownKeysConsumed(TBool aConsume);
       
   852 
       
   853     /**
       
   854      * Used for suppressing all editor's background drawing. This is
       
   855      * intended for internal use.
       
   856      *
       
   857      * Note that when this is set, the background is not drawn with skin
       
   858      * nor cleared, so the background MUST be drawn by the parent control
       
   859      * every time the editor changes.
       
   860      *
       
   861      * @param aSuppress If ETrue, suppress background drawing
       
   862      */
       
   863     IMPORT_C void SetSuppressBackgroundDrawing( TBool aSuppress );
       
   864 
       
   865     /**
       
   866      * Used for setting various flag-like features to the editor.
       
   867      *
       
   868      * @param aFeatureId The feature id, see TFeatureId
       
   869      * @param aFeatureParam The feature parameter. This is usually
       
   870      *                      enabled or disabled. For more info, see
       
   871      *                      the feature documentation in TFeatureId.
       
   872      * @return KErrNone if the feature modification succeeded
       
   873      * @since S60 3.2
       
   874      **/
       
   875     IMPORT_C TInt SetFeature( TInt aFeatureId, TInt aFeatureParam );
       
   876      
       
   877     /**
       
   878      * Used to getting feature statuses.
       
   879      *
       
   880      * @param aFeatureId The feature id, see TFeatureId
       
   881      * @param aFeatureParam On return, the parameter for the feature
       
   882      *                      (usually non-zero for an enabled feature
       
   883      *                      and zero for disabled)
       
   884      * @return KErrNone if the feature is supported and fetching its value
       
   885      *                  succeeded
       
   886      * @since S60 3.2
       
   887      */
       
   888     IMPORT_C TInt GetFeature( TInt aFeatureId, TInt& aFeatureParam ) const;
       
   889 
       
   890     /**
       
   891      * Used for checking if the editor supports a feature.
       
   892      * For features, see TFeatureId.
       
   893      *
       
   894      * @param aFeatureId
       
   895      * @return ETrue if the feature is supported
       
   896      * @since S60 3.2
       
   897      */
       
   898     IMPORT_C TBool SupportsFeature( TInt aFeatureId ) const;
       
   899 
       
   900     // Highlights a field
       
   901     void HighlightField(  TInt aFieldPosition );
       
   902 
       
   903     /**
       
   904      * Gets a pointer to the CFont object that is used to draw the fields in
       
   905      * this editor.
       
   906      * 
       
   907      * @return A pointer to the CFont object used to draw the fields in
       
   908      * this editor.
       
   909      */
       
   910 	IMPORT_C const CFont* Font() const;
       
   911 	
       
   912     /**
       
   913      * Sets the font that is used to draw the fields in this editor.
       
   914      * 
       
   915      * @param aFont A pointer to a CFont object that is used to draw the
       
   916      * fields in this editor.
       
   917      */
       
   918 	IMPORT_C void SetFont(const CFont* aFont);
       
   919 
       
   920     /**
       
   921      * Sets within in the editor an externally owned Skins background control context.
       
   922      * This background control context will then be used by the editor to draw background.
       
   923      *
       
   924      * If this API is not called, then the editor IS skin enabled, (that is CEikMfnes are skin
       
   925      * enabled by default) but it will try to find a control context with which to perform background 
       
   926      * drawing from the Control Environment, via the Object Provider.
       
   927      *
       
   928      * Setting this control context to NULL will have the effect of turning off background 
       
   929      * skinning. 
       
   930      *
       
   931      * @param aBackgroundControlContext   Control context to store. Not owned. Can be NULL
       
   932      */
       
   933     IMPORT_C void SetSkinBackgroundControlContextL( MAknsControlContext* aControlContext );
       
   934     
       
   935     
       
   936     /**
       
   937      * From MAknMfneCommandObserver. Allows owning controls to give commands to 
       
   938      * MFNE editors. This is interface was added to enable modifying the current field
       
   939      * value with touch buttons.
       
   940      *
       
   941      * @param aCommand Command ID defined in MAknMfneCommandObserver::TMfneCommand
       
   942      */
       
   943     IMPORT_C void HandleMfneCommandL(TInt aCommand);
       
   944     
       
   945     /**
       
   946      * Sets the MFNE to use the CCoeControl::OverrideColorL() defined
       
   947      * color in drawing. If this is set, no skinning will be used
       
   948      * in drawing.
       
   949      *
       
   950      * @param aUseOverrideColors ETrue to make the MFNE use overridden colors.
       
   951      * @since S60 v3.2
       
   952      */
       
   953     IMPORT_C void SetUseOverrideColors( TBool aUseOverrideColors );
       
   954 
       
   955 
       
   956 public:	// from CCoeControl
       
   957     /**
       
   958      * Handles key events.
       
   959      * 
       
   960      * Overrides CCoeControl::OfferKeyEventL(). The key event is passed
       
   961      * onto the current field to handle.
       
   962      * 
       
   963      * @param aKeyEvent The key event.
       
   964      * @param aType The type of key event.
       
   965      * @return Indicates whether or not the key event was used by this
       
   966      * control.
       
   967      */
       
   968 	IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
   969 
       
   970     /**
       
   971      * Prepares for focus loss.
       
   972      * 
       
   973      * Overrides CCoeControl::PrepareForFocusLossL().
       
   974      * 
       
   975      * This function should be called when an attempt is made to remove
       
   976      * focus from a multi-field numeric editor. It redraws the control, removing
       
   977      * highlighting from the current field.
       
   978      * 
       
   979      * It may be overridden in derived classes to test the validity of
       
   980      * information entered into the editor. Derived class versions should include
       
   981      * a base function call.
       
   982      */
       
   983 	IMPORT_C virtual void PrepareForFocusLossL();
       
   984 
       
   985     /**
       
   986      * Gets the minimum size of the control. 
       
   987      * 
       
   988      * Overrides CCoeControl::MinimumSize().
       
   989      *
       
   990      * @return The minimum control size.
       
   991      */
       
   992 	IMPORT_C virtual TSize MinimumSize();
       
   993 
       
   994     /**
       
   995      * Gets the list of logical colours used to draw the control.
       
   996      * 
       
   997      * The colours are appended to aColorUseList.
       
   998      * 
       
   999      * Overrides CCoeControl::GetColorUseListL().
       
  1000      * 
       
  1001      * @param aColorUseList On return, the colour list.
       
  1002      */
       
  1003 	IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& aColorUseList) const; // not available before Release 005u
       
  1004 
       
  1005     /**
       
  1006      * Handles a change to the control's resources. 
       
  1007      * 
       
  1008      * The types of resources handled are those which are shared across the
       
  1009      * environment, e.g. colours or fonts.
       
  1010      * 
       
  1011      * Overrides CCoeControl::HandleResourceChange().
       
  1012      * 
       
  1013      * @param aType A message UID value.
       
  1014      */
       
  1015 	IMPORT_C virtual void HandleResourceChange(TInt aType);			// not available before Release 005u
       
  1016 
       
  1017     /**
       
  1018      * Gets the total of the input capabilities of all the editor's fields.
       
  1019      * 
       
  1020      * Overrides CCoeControl::InputCapabilities().
       
  1021      *
       
  1022      * If this function is overrided in a subclass, the subclass should
       
  1023      * obtain this class' InputCapabilities' object provider through
       
  1024      * TCoeInputCapabilities::ObjectProvider() and set that as a part of
       
  1025      * the subclass' InputCapabilities object provider chain to ensure
       
  1026      * maximum functionality.
       
  1027      * 
       
  1028      * @return The control's input capabilities.
       
  1029      */
       
  1030 	IMPORT_C virtual TCoeInputCapabilities InputCapabilities() const;
       
  1031 
       
  1032     /**
       
  1033      * From @c CCoeControl.
       
  1034      * 
       
  1035      * Handles pointer events.
       
  1036      *
       
  1037      * @param aPointerEvent The pointer event.
       
  1038      */
       
  1039 	IMPORT_C virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
  1040 
       
  1041     /**
       
  1042      * Retrieves an object of the same type as that encapsulated in aId.
       
  1043      * 
       
  1044      * Overrides CCoeControl::MopSupplyObject().
       
  1045      * 
       
  1046      * @param aId An encapsulated object type ID. 
       
  1047      * @return Encapsulates the pointer to the object provided. Note that
       
  1048      * the encapsulated pointer may be NULL. 
       
  1049      */
       
  1050 	IMPORT_C virtual TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
       
  1051 
       
  1052 public: // new 
       
  1053     /**
       
  1054      * Sets the colors for text and background as skin IDs. Please note that
       
  1055      * bgcolor overrides skinned draw if set
       
  1056      * 
       
  1057      * @since 3.0
       
  1058      * @param aAknSkinIDForTextColor ID for text color.
       
  1059      * @param aAknSkinIDForBgColor ID for background color.
       
  1060      */
       
  1061     IMPORT_C void SetSkinTextColorL(TInt aAknSkinIDForTextColor, TInt aAknSkinIDForBgColor=KErrNotFound);
       
  1062 
       
  1063 protected:
       
  1064 	// framework
       
  1065     /**
       
  1066      * Redraws the current field, so removing or displaying the cursor.
       
  1067      * 
       
  1068      * If the editor has lost focus, the current field is reset to the
       
  1069      * first editable field.
       
  1070      * 
       
  1071      * @param aDrawNow Whether to draw the control immediately.
       
  1072      */
       
  1073 	IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow);
       
  1074 
       
  1075     /**
       
  1076      * Writes the internal state of the control and its components to
       
  1077      * aStream.
       
  1078      * 
       
  1079      * This function is empty in release builds.
       
  1080      */
       
  1081 	IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
       
  1082 
       
  1083 	// miscellaneous functions
       
  1084 	
       
  1085     /**
       
  1086      * Handles the redrawing associated with a change to the current field.
       
  1087      * 
       
  1088      * Called by OfferKeyEventL(), HandlePointerEventL() and
       
  1089      * PrepareForFocusLossL().
       
  1090      * 
       
  1091      * @param aHandleDeHighlight ETrue if the current field has changed so
       
  1092      * requires de-highlighting.
       
  1093      * @param aNewCurrentField The index of the field to which the user has
       
  1094      * moved.
       
  1095      * @param aOldWidthInPixelsOfOldCurrentField The width in pixels of the
       
  1096      * previous current field.
       
  1097      * @param aOldHighlightTypeOfOldCurrentField The highlight type of the
       
  1098      * previously current field.
       
  1099      * @param aDataAltered ETrue if the data has been changed.
       
  1100      * @param aError On return, ETrue if successful, EFalse if not
       
  1101      * successful.
       
  1102      */
       
  1103 	IMPORT_C void HandleInteraction(TBool aHandleDeHighlight, TInt aNewCurrentField, TInt aOldWidthInPixelsOfOldCurrentField,
       
  1104 								CEikMfneField::THighlightType aOldHighlightTypeOfOldCurrentField, TBool& aDataAltered, TBool& aError);
       
  1105 								
       
  1106     /**
       
  1107      * Empty virtual function.
       
  1108      * 
       
  1109      * Called by HandleInteraction() when switching from the current field.
       
  1110      * Can be implemented by derived classes to maintain consistency between
       
  1111      * fields, e.g. in a range editor.
       
  1112      * 
       
  1113      * @param aField The current field.
       
  1114      * @param aDrawAllFields On return, whether all fields have changed and
       
  1115      * need to be redrawn.
       
  1116      */
       
  1117 	IMPORT_C virtual void FieldIsAboutToBeDeHighlighted(CEikMfneField* aField, TBool& aDrawAllFields); // first occurrence of this virtual function - does nothing by default
       
  1118 	
       
  1119     /**
       
  1120      * Gets the size of the multi-field numeric editor.
       
  1121      * 
       
  1122      * The width is the sum of the maximum widths of every field.
       
  1123      * 
       
  1124      * @return The size of the multi-field numeric editor.
       
  1125      */
       
  1126 	IMPORT_C TSize MfneSize() const;
       
  1127 
       
  1128     /**
       
  1129      * Gets the size of the multi-field numeric editor.
       
  1130      * 
       
  1131      * The width is the sum of the maximum widths of every field.
       
  1132      * 
       
  1133      * @param aShrinkToMinimumSize ETrue to shrink the width to the minimum
       
  1134      * required for each field.
       
  1135      * @return The size of the multi-field numeric editor.
       
  1136      */
       
  1137 	IMPORT_C TSize MfneSize(TBool aShrinkToMinimumSize);
       
  1138 
       
  1139     IMPORT_C virtual void SizeChanged();
       
  1140     
       
  1141 public:
       
  1142 	static void InvalidFieldAlert();
       
  1143 	static void LeaveWithAlert(TInt aResourceId);	
       
  1144 	void GetCursorInfo( TPoint& aPos, TInt& aHeight, TInt& aWidth, TInt& aAscent );
       
  1145     void ReportUpdate();
       
  1146     IMPORT_C virtual void MakeVisible(TBool aVisible);
       
  1147     void SetCurrentField( TInt aCurrentField );
       
  1148     void SetValidateCallBack( TCallBack aCallBack );
       
  1149     void ReportStateChangeEventL();
       
  1150     void SetFirstEditableField();
       
  1151     
       
  1152 private:
       
  1153 	// framework
       
  1154 	IMPORT_C virtual void Draw(const TRect& aRect) const;
       
  1155 	
       
  1156 	// new virtual functions
       
  1157 	IMPORT_C virtual void CreatePopoutIfRequiredL();
       
  1158 	// miscellaneous functions
       
  1159 
       
  1160 	/**
       
  1161 	 * Draws the specified fields within the MFNE.
       
  1162 	 * All fields between and including the @c aFirstField and @c aLastField
       
  1163 	 * will be drawn.
       
  1164 	 *
       
  1165 	 * @param  aGc                    The graphics context to draw to.
       
  1166 	 * @param  aFirstField            First field to be drawn.
       
  1167 	 * @param  aLastField             Last field to be drawn.
       
  1168 	 * @param  aSkipBackgroundDrawer  @c ETrue to skip the background drawing
       
  1169 	 *                                with a background drawer if it's used
       
  1170 	 *                                for the MFNE. 
       
  1171 	 */
       
  1172 	void DrawRange( CWindowGc& aGc,
       
  1173                     TInt aFirstField,
       
  1174                     TInt aLastField,
       
  1175                     TBool aSkipBackgroundDrawer = EFalse ) const;
       
  1176 
       
  1177 	CWindowGc& PreparedGc() const;
       
  1178 	void SetGcToNormalVideo(CWindowGc& aGc) const;
       
  1179 	void SetGcToInverseVideo(CWindowGc& aGc) const;
       
  1180 	void SetGcToDimmedVideo(CWindowGc& aGc) const;
       
  1181 	void DrawCursor();
       
  1182 	void HideCursor();	
       
  1183 	IMPORT_C void Reserved_2();
       
  1184 	IMPORT_C virtual void CEikMfne_Reserved();
       
  1185 	
       
  1186 	void LaunchPenInputL();
       
  1187 	
       
  1188 private:
       
  1189     /**
       
  1190     * From CAknControl
       
  1191     */
       
  1192     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
  1193 
       
  1194 private:
       
  1195 	enum {ENullIndex=KMaxTInt};
       
  1196 
       
  1197 	/**
       
  1198 	 * Access to state of whether up/down keys are eaten and used to increment/decrement.  If
       
  1199 	 * these keys are not consumed, then the events are passed on.
       
  1200 	 * 
       
  1201 	 * @return EFalse iff Up and Down keys are not consumed (and acted upon)
       
  1202 	 */
       
  1203 	TBool ConsumesUpAndDownKeys() const;
       
  1204 
       
  1205 	/**
       
  1206 	 * This state of enabling means that skinning will actually be drawn
       
  1207 	 * It is a combination of 
       
  1208 	 * - application is skin enabled
       
  1209 	 * - current skin has a background or frame bitmap
       
  1210 	 * It is set during construction and does not change its value after except if the Skin is 
       
  1211 	 * changed, whereupon the control context is re-accessed and checked for bitmaps present
       
  1212 	 *
       
  1213 	 * @return EFalse iff background skin will not be drawn.
       
  1214 	 */
       
  1215 	TBool SkinningBackground() const;
       
  1216 
       
  1217 	/** 
       
  1218 	 * Checks if app is skin enabled and that the current control context has bitmap. 
       
  1219 	 * If so, then state is set true.
       
  1220 	 * This should be called at constuction and when HandleResourceChange is called
       
  1221 	 *
       
  1222 	 */ 
       
  1223 	void EvaluateSkinningBackground(); 
       
  1224 
       
  1225     /**
       
  1226      * Access to Skins background control context that is potentially being used by the Editor.
       
  1227      *
       
  1228      * This API will first check to see if an control context has been set by API, and if so, 
       
  1229      * return that.  If the background control context has been set to NULL by API, then it will
       
  1230      * return NULL. If the background control context has never been set by API, then this returns
       
  1231      * the control context (if one exists) that the object obtains from Object Provider.
       
  1232      * 
       
  1233      * @return Pointer to control context potentially in use, or NULL.
       
  1234      */
       
  1235     MAknsControlContext* SkinBackgroundControlContext() const;
       
  1236 
       
  1237     /**
       
  1238      * Check for the existence of the extension and create if required.
       
  1239      */
       
  1240     void CreateExtensionIfRequiredL();
       
  1241 
       
  1242 private:
       
  1243 	TInt iNumFields;
       
  1244 	TInt iCurrentField;
       
  1245 	CEikMfneField** iFields;
       
  1246 	CEikMfneExtension* iExtension;
       
  1247 	const CFont* iFont;
       
  1248     TInt iAlignment;
       
  1249     TBitFlags iFlags;
       
  1250 	};
       
  1251 
       
  1252 inline TInt CEikMfne::CurrentField() const
       
  1253     {
       
  1254     return(iCurrentField);
       
  1255     }
       
  1256 
       
  1257 inline TInt CEikMfne::NumFields() const
       
  1258     {
       
  1259     return(iNumFields);
       
  1260     }
       
  1261 
       
  1262 //
       
  1263 
       
  1264 /**
       
  1265  * Integer editor.
       
  1266  * 
       
  1267  * This control supports editing a single integer value. If a number is
       
  1268  * entered which is not within the range specified by the maximum and
       
  1269  * minimum control values it is automatically reset to the nearest
       
  1270  * allowable value.
       
  1271  * 
       
  1272  * The editor has an associated resource struct NUMBER_EDITOR and
       
  1273  * control factory identifier EEikCtNumberEditor.
       
  1274  */
       
  1275 class CEikNumberEditor : public CEikMfne
       
  1276 	{
       
  1277 public:
       
  1278 	// miscellaneous functions
       
  1279     
       
  1280     /**
       
  1281      * Constructor.
       
  1282      * 
       
  1283      * This function should be used as the first stage in two stage
       
  1284      * construction, followed by a call to either ConstructFromResourceL() to
       
  1285      * initialise the editor's field values from a resource file, or ConstructL()
       
  1286      * if no resource file is used.
       
  1287      */
       
  1288 	IMPORT_C CEikNumberEditor();
       
  1289 	
       
  1290 	/**
       
  1291      * Second-phase constructor.
       
  1292      * 
       
  1293      * Completes the construction of an integer editor. It should be called
       
  1294      * by container only if the editor is not constructed from a resource.
       
  1295      * 
       
  1296      * Sets the minimum and maximum values that can be entered into the
       
  1297      * editor, and the initial value.
       
  1298      * 
       
  1299      * @param aMinimumValue The minimum allowable value.
       
  1300      * @param aMaximumValue The maximum allowable value.
       
  1301      * @param aInitialValue The initial value.
       
  1302      */
       
  1303 	IMPORT_C void ConstructL(TInt aMinimumValue, TInt aMaximumValue, TInt aInitialValue); // to be called by container only if not constructed from resource
       
  1304 	
       
  1305     /**
       
  1306      * Sets the minimum and maximum editor values.
       
  1307      * 
       
  1308      * Only values inside the initial minimum and maximum are permitted.
       
  1309      * 
       
  1310      * If the editor's value is outside the new bounds when the function is
       
  1311      * called, it is reset to the nearest allowable value.
       
  1312      * 
       
  1313      * @param aMinimumValue The minimum allowable value.
       
  1314      * @param aMaximumValue The maximum allowable value.
       
  1315      * @panic 9 If the minimum is greater than the maximum allowable value.
       
  1316      */
       
  1317 	IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue); // only values inside the initial minimum and maximum are permitted
       
  1318 
       
  1319     /**
       
  1320      * Gets the integer editor's minimum and maximum values.
       
  1321      * 
       
  1322      * @param aMinimumValue On return, contains the integer editor's
       
  1323      * minimum allowable value.
       
  1324      * @param aMaximumValue On return, contains the integer editor's
       
  1325      * maximum allowable value.
       
  1326      */
       
  1327 	IMPORT_C void GetMinimumAndMaximum(TInt& aMinimumValue, TInt& aMaximumValue) const;
       
  1328 
       
  1329     /**
       
  1330      * Sets the integer editor's value.
       
  1331      * 
       
  1332      * The control is not redrawn.
       
  1333      * 
       
  1334      * @param aNumber The editor's new value.
       
  1335      * @panic 11 In debug builds, if aNumber is outside the valid range.
       
  1336      */
       
  1337 	IMPORT_C void SetNumber(TInt aNumber);
       
  1338 
       
  1339     /**
       
  1340      * Gets the integer editor's value.
       
  1341      * 
       
  1342      * @return The integer editor's value.
       
  1343      * @panic 12 In debug builds, if the editor has no content.
       
  1344      */
       
  1345 	IMPORT_C TInt Number() const; // can only be called if PrepareForFocusLossL() succeeded
       
  1346 
       
  1347 	// framework
       
  1348 
       
  1349 	/**
       
  1350      * Second-phase construction from a resource file.
       
  1351      * 
       
  1352      * The function reads the maximum and minimum editor values from a
       
  1353      * NUMBER_EDITOR resource, and sets the initial number to be the same as the
       
  1354      * maximum value.
       
  1355      * 
       
  1356      * @param aResourceReader A resource file reader.
       
  1357      */
       
  1358 	IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aResourceReader);
       
  1359 
       
  1360     // From CCoeControl
       
  1361 
       
  1362     /**
       
  1363      * From @c CCoeControl.
       
  1364      * 
       
  1365      * Handles pointer events.
       
  1366      *
       
  1367      * @param aPointerEvent The pointer event.
       
  1368      */    
       
  1369     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);	
       
  1370 private:
       
  1371 	IMPORT_C virtual void CEikMfne_Reserved();
       
  1372 private:
       
  1373 	void RefreshFromLocale();
       
  1374 private:
       
  1375     /**
       
  1376     * From CAknControl
       
  1377     */
       
  1378     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
  1379 private:
       
  1380 	// none of these pointers owns anything
       
  1381 	CEikMfneNumber* iNumber;
       
  1382 	TInt iSpare;
       
  1383 	};
       
  1384 
       
  1385 
       
  1386 //
       
  1387 /**
       
  1388  * Range struct for CEikRangeEditor.
       
  1389  */
       
  1390 struct SEikRange
       
  1391 	{
       
  1392 	/**
       
  1393 	 * The lower limit.
       
  1394 	 */
       
  1395 	TInt iLowerLimit;
       
  1396 
       
  1397 	/**
       
  1398 	 * The upper limit.
       
  1399 	 */
       
  1400 	TInt iUpperLimit;
       
  1401 	};
       
  1402 
       
  1403 //
       
  1404 
       
  1405 /**
       
  1406  * Numeric range editor.
       
  1407  * 
       
  1408  * This editor supports editing an integer range. It has two fields;
       
  1409  * the first represents the lower value and the second the upper value. The
       
  1410  * second value must be greater than, or equal to, the first.
       
  1411  * 
       
  1412  * Minimum and maximum values for the editor are specified during
       
  1413  * construction. If a number is entered which is not within the editor's
       
  1414  * minimum and maximum values, it is automatically reset to the nearest
       
  1415  * allowable value.
       
  1416  * 
       
  1417  * The editor has an associated resource struct RANGE_EDITOR and
       
  1418  * control factory identifier EEikCtRangeEditor. 
       
  1419  */
       
  1420 class CEikRangeEditor : public CEikMfne
       
  1421 	{
       
  1422 public:
       
  1423 	// miscellaneous functions
       
  1424     
       
  1425     /**
       
  1426      * Default constructor.
       
  1427      * 
       
  1428      * This function should be used as the first stage in two stage
       
  1429      * construction, followed by a call to either ConstructFromResourceL() to
       
  1430      * initialise the editor's field values from a resource file, or ConstructL()
       
  1431      * if no resource file is used.
       
  1432      */
       
  1433 	IMPORT_C CEikRangeEditor();
       
  1434 
       
  1435 	// ConstructL to be called by container only if not constructed from resource, also ownership of aSeparatorText is transferred when everything that can leave has successfully been done
       
  1436     /**
       
  1437      * Second phase constructor.
       
  1438      * 
       
  1439      * This function completes construction of a range editor. It sets the
       
  1440      * minimum and maximum values, initial range and separator text. It
       
  1441      * should be called by the container only if the control is not constructed
       
  1442      * from a resource file. 
       
  1443      * 
       
  1444      * @param aMinimumValue The minimum value for the range editor.
       
  1445      * @param aMaximumValue The maximum value for the range editor.
       
  1446      * @param aInitialRange Struct containing upper and lower range limits.
       
  1447      * Must be within the minimum and maximum values.
       
  1448      * @param aSeparatorText The text to be used to separate the numeric
       
  1449      * values.
       
  1450      * @panic 8 If the initial lower or upper limit is outside the minimum
       
  1451      * or maximum bounds.
       
  1452      */
       
  1453 	IMPORT_C void ConstructL(TInt aMinimumValue, TInt aMaximumValue, const SEikRange& aInitialRange, HBufC* aSeparatorText);
       
  1454 
       
  1455     /**
       
  1456      * Sets the range editor's minimum and maximum values.
       
  1457      * 
       
  1458      * Any values are permitted. If the range values are outside the new
       
  1459      * minimum / maximum they are changed to be within the new minimum /
       
  1460      * maximum.
       
  1461      * 
       
  1462      * @param aMinimumValue The minimum value for the range editor.
       
  1463      * @param aMaximumValue The maximum value for the range editor.
       
  1464      */
       
  1465 	IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue); // only values inside the initial minimum and maximum are permitted
       
  1466 
       
  1467     /**
       
  1468      * Gets the range editor's minimum and maximum values.
       
  1469      * 
       
  1470      * @param aMinimumValue On return, the minimum value for the range
       
  1471      * editor.
       
  1472      * @param aMaximumValue On return, the maximum value for the range
       
  1473      * editor.
       
  1474      */
       
  1475 	IMPORT_C void GetMinimumAndMaximum(TInt& aMinimumValue, TInt& aMaximumValue) const;
       
  1476 
       
  1477     /**
       
  1478      * Sets the range editor's current values.
       
  1479      * 
       
  1480      * @param aRange Struct containing new range values.
       
  1481      */
       
  1482 	IMPORT_C void SetRange(const SEikRange& aRange);
       
  1483 	
       
  1484     /**
       
  1485      * Gets the range editor's current values.
       
  1486      * 
       
  1487      * Can only be called if CEikMfne::PrepareForFocusLossL() succeeded
       
  1488      * 
       
  1489      * @return Struct containing current range values.
       
  1490      */
       
  1491 	IMPORT_C SEikRange Range() const; // can only be called if PrepareForFocusLossL() succeeded
       
  1492 	
       
  1493 	// framework
       
  1494 	
       
  1495     /**
       
  1496      * Second phase constructor from resource.
       
  1497      * 
       
  1498      * This function completes construction of a newly-allocated range
       
  1499      * editor. It sets the minimum and maximum values, initial range and
       
  1500      * separator text as specified by the resource.
       
  1501      * 
       
  1502      * @param aResourceReader A resource reader.
       
  1503      */
       
  1504 	IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aResourceReader);
       
  1505 
       
  1506     // From CCoeControl
       
  1507 
       
  1508     /**
       
  1509      * From @c CCoeControl.
       
  1510      * 
       
  1511      * Handles pointer events.
       
  1512      *
       
  1513      * @param aPointerEvent The pointer event.
       
  1514      */    
       
  1515     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
  1516 private:
       
  1517 	virtual void FieldIsAboutToBeDeHighlighted(CEikMfneField* aField, TBool& aDrawAllFields);
       
  1518 	IMPORT_C virtual void CEikMfne_Reserved();
       
  1519 	void RefreshFromLocale();
       
  1520 private:
       
  1521     /**
       
  1522     * From CAknControl
       
  1523     */
       
  1524     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
  1525 private:
       
  1526 	// none of these pointers owns anything
       
  1527 	CEikMfneNumber* iLowerLimit;
       
  1528 	CEikMfneNumber* iUpperLimit;
       
  1529 	TInt iSpare;
       
  1530 	};
       
  1531 
       
  1532 
       
  1533 //
       
  1534 
       
  1535 /**
       
  1536  * Specifies an abstract interface for time and date editors where the
       
  1537  * time and date are set and retrieved using the TTime class.
       
  1538  */
       
  1539 class CEikTTimeEditor : public CEikMfne
       
  1540 	{
       
  1541 public:
       
  1542     /**
       
  1543      * An implementation (of this pure virtual function) should set the
       
  1544      * range of allowable time values.
       
  1545      * 
       
  1546      * This defines the maximum and minimum values that may be entered by
       
  1547      * the user. 
       
  1548      * 
       
  1549      * @param aMinimumTime The minimum allowable value.
       
  1550      * @param aMaximumTime The maximum allowable value.
       
  1551      */
       
  1552 	virtual void SetMinimumAndMaximum(const TTime& aMinimumTime, const TTime& aMaximumTime)=0;
       
  1553 
       
  1554     /**
       
  1555      * An implementation (of this pure virtual function) should get the
       
  1556      * range of allowable time values.
       
  1557      * 
       
  1558      * @param aMinimumTime The minimum allowable value.
       
  1559      * @param aMaximum The maximum allowable value.
       
  1560      */
       
  1561 	virtual void GetMinimumAndMaximum(TTime& aMinimumTime, TTime& aMaximum) const=0;
       
  1562     
       
  1563     /**
       
  1564      * An implementation (of this pure virtual function) should set the time
       
  1565      * in the editor.
       
  1566      * 
       
  1567      * @param aTime The time.
       
  1568      */
       
  1569 	virtual void SetTTime(const TTime& aTime)=0;
       
  1570 
       
  1571     /**
       
  1572      * An implementation (of this pure virtual function) should get the time
       
  1573      * from the editor.
       
  1574      * 
       
  1575      * Can only be called if CEikMfne::PrepareForFocusLossL() succeeded.
       
  1576      * 
       
  1577      * @return The time.
       
  1578      */
       
  1579 	virtual TTime GetTTime() const=0; // can only be called if PrepareForFocusLossL() succeeded
       
  1580 	};
       
  1581 
       
  1582 /**
       
  1583  * Time editor.
       
  1584  * 
       
  1585  * This control allows a time value to be displayed and edited. By
       
  1586  * default the editor has hours, minutes and seconds fields, although the
       
  1587  * seconds and hours fields may be omitted. 12 and 24-hour format are
       
  1588  * supported. When 12-hour format is used, am or pm text will be included as
       
  1589  * another field, either before or after the time. Locale information is
       
  1590  * used to determine the time separator characters. Locale information is
       
  1591  * set and retrieved using class TLocale. 
       
  1592  * 
       
  1593  * The upper and lower field bounds are set depending on the format,
       
  1594  * and times outside these bounds are invalid.
       
  1595  * 
       
  1596  * The editor has an associated resource struct TIME_EDITOR and control
       
  1597  * factory identifier EEikCtTimeEditor. 
       
  1598  */
       
  1599 class CEikTimeEditor : public CEikTTimeEditor
       
  1600 	{
       
  1601 public:
       
  1602 	// miscellaneous functions
       
  1603     /**
       
  1604      * Default constructor.
       
  1605      * 
       
  1606      * This function should be used as the first stage in two stage
       
  1607      * construction, followed by a call to either: ConstructFromResourceL() to
       
  1608      * initialise the editor's field values from a resource file, or ConstructL()
       
  1609      * if no resource file is used.
       
  1610      */
       
  1611 	IMPORT_C CEikTimeEditor();
       
  1612 
       
  1613     /**
       
  1614      * Destructor.
       
  1615      * 
       
  1616      * This frees the resources owned by the time editor, prior to its
       
  1617      * destruction.
       
  1618      */
       
  1619 	IMPORT_C virtual ~CEikTimeEditor();
       
  1620 
       
  1621     /**
       
  1622      * Second phase construction.
       
  1623      * 
       
  1624      * This function completes the construction of a newly-allocated time
       
  1625      * editor, by setting its minimum, maximum and initial values, and the
       
  1626      * AM/PM text settings - the AM/PM settings and time separator characters
       
  1627      * specified in class TLocale are honoured. It should be called by the
       
  1628      * container only if the control is not constructed from a resource file.
       
  1629      * 
       
  1630      * If the initial time is outside the bounds specified, it is reset to
       
  1631      * the nearest available setting.
       
  1632      * 
       
  1633      * The aFlags parameter is used to determine whether the seconds or
       
  1634      * hours fields are required. The minutes field is always present. It may
       
  1635      * also be used to specify whether or not to force 24 hour time format,
       
  1636      * overriding the locale's setting.
       
  1637      * 
       
  1638      * A panic will occur if the minimum time is later than the maximum
       
  1639      * time.
       
  1640      * 
       
  1641      * @param aMinimumTime The minimum allowable time.
       
  1642      * @param aMaximumTime The maximum allowable time.
       
  1643      * @param aInitialTime The initial time.
       
  1644      * @param aFlags Determines which fields are required and whether or
       
  1645      * not to force 24 hour formatting. See eikon.hrh EEiktime etc.
       
  1646      */
       
  1647 	IMPORT_C void ConstructL(const TTime& aMinimumTime, const TTime& aMaximumTime, const TTime& aInitialTime, TUint32 aFlags); // to be called by container only if not constructed from resource
       
  1648 
       
  1649     /**
       
  1650      * Sets the time editor's value.
       
  1651      * 
       
  1652      * @param aTime The new value to which to set the editor's fields.
       
  1653      */
       
  1654 	IMPORT_C void SetTime(const TTime& aTime);
       
  1655 
       
  1656     /**
       
  1657      * Gets the time editor's value.
       
  1658      * 
       
  1659      * @return The editor's value. (Date values are all zero.)
       
  1660      */
       
  1661 	IMPORT_C TTime Time() const;
       
  1662 
       
  1663     /**
       
  1664      * Sets the uninitialized status of the editor.
       
  1665      * 
       
  1666      * @param aUninitialised If ETrue, sets the editor as uninitialized,
       
  1667      *                       i.e. it doesn't display anything.
       
  1668      */
       
  1669 	IMPORT_C void SetUninitialised(TBool aUninitialised);
       
  1670 	
       
  1671 	/**
       
  1672 	 * Gets the uninitialized status of the editor.
       
  1673 	 * 
       
  1674 	 * @return ETrue, if the editor is set as uninitialized.
       
  1675 	 */	
       
  1676 	IMPORT_C TBool IsUninitialised() const;
       
  1677 	// from CEikTTimeEditor
       
  1678 	
       
  1679     /**
       
  1680      * Sets the range of allowable time values.
       
  1681      * 
       
  1682      * These define the maximum and minimum values that may be entered by
       
  1683      * the user.
       
  1684      * 
       
  1685      * If the existing time value is outside the bounds set by this
       
  1686      * function, it is reset to the nearest boundary value.
       
  1687      * 
       
  1688      * @param aMinimumTime The minimum allowable value.
       
  1689      * @param aMaximumTime The maximum allowable value.
       
  1690      * @panic 38 If the minimum value exceeds the maximum.
       
  1691      */
       
  1692 	IMPORT_C virtual void SetMinimumAndMaximum(const TTime& aMinimumTime, const TTime& aMaximumTime); // only values inside the initial minimum and maximum are permitted
       
  1693 
       
  1694     /**
       
  1695      * Gets the range of allowable values that may be entered by the user.
       
  1696      * 
       
  1697      * @param aMinimumTime On return, contains the time editor's minimum
       
  1698      * allowable value.
       
  1699      * @param aMaximumTime On return, contains the time editor's maximum
       
  1700      * allowable value.
       
  1701      */
       
  1702 	IMPORT_C virtual void GetMinimumAndMaximum(TTime& aMinimumTime, TTime& aMaximumTime) const;
       
  1703 
       
  1704 	// from CCoeControl
       
  1705 
       
  1706     /**
       
  1707      * Second phase construction from a resource.
       
  1708      * 
       
  1709      * This function completes the construction of a newly-allocated time
       
  1710      * editor from a TIME_EDITOR resource. The minimum and maximum times, and
       
  1711      * the flags settings are read from the resource, and ConstructL() is
       
  1712      * called with these settings. The initial time is set to the maximum time
       
  1713      * value. Honours the locale's AM/PM text setting and time separators.
       
  1714      * 
       
  1715      * @param aResourceReader A resource file reader.
       
  1716      * 
       
  1717      */
       
  1718 	IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aResourceReader);
       
  1719 	
       
  1720     /**
       
  1721      * Prepares the editor for focus loss.
       
  1722      * 
       
  1723      * This function should be called to validate the editor's contents
       
  1724      * when an attempt is made to remove focus from the control. If the control
       
  1725      * value is not within the bounds specified by the minimum and maximum
       
  1726      * time values, it is reset to the nearest allowable value, the function
       
  1727      * will leave and will display an appropriate message.
       
  1728      */
       
  1729 	IMPORT_C virtual void PrepareForFocusLossL();
       
  1730 
       
  1731     /**
       
  1732      * From @c CCoeControl.
       
  1733      * 
       
  1734      * Handles pointer events.
       
  1735      *
       
  1736      * @param aPointerEvent The pointer event.
       
  1737      */
       
  1738     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
  1739 private:
       
  1740 	// from CEikTTimeEditor
       
  1741 	virtual void SetTTime(const TTime& aTime);
       
  1742 	virtual TTime GetTTime() const; // can only be called if PrepareForFocusLossL() succeeded
       
  1743 private:
       
  1744 	// miscellaneous functions
       
  1745 	void DoSetMinimumAndMaximum(const TTime& aMinimumTime, const TTime& aMaximumTime);
       
  1746 	IMPORT_C virtual void CEikMfne_Reserved();
       
  1747 private:
       
  1748     /**
       
  1749     * From CAknControl
       
  1750     */
       
  1751     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
  1752 private:
       
  1753 	CTimeEditor* iTimeEditor;
       
  1754 	TTime iMinimumTime;
       
  1755 	TTime iMaximumTime;
       
  1756 	TInt iSpare;
       
  1757 	};
       
  1758 
       
  1759 
       
  1760 //
       
  1761 
       
  1762 // note: TDateTime uses zero based day numbers, so -1 on the day field
       
  1763 #define KAknMinimumDate (TTime(TDateTime(0001, EJanuary, 1-1, 0, 0, 0, 0)))
       
  1764 #define KAknMaximumDate (TTime(TDateTime(9999, EDecember, 31-1, 23, 59, 59, 999999)))
       
  1765 
       
  1766 /**
       
  1767  * Date editor.
       
  1768  *
       
  1769  * A date editor has five fields: day, month and year, and two separator 
       
  1770  * characters. The order of the fields varies depending on the locale's 
       
  1771  * date format setting. Locale information, which is set and retrieved using 
       
  1772  * class @c TLocale, is used to determine field order and the characters used 
       
  1773  * to separate the date components. The upper and lower field bounds are set, 
       
  1774  * and dates outside these bounds are invalid.
       
  1775  *
       
  1776  * The editor can be configured to launch a pop-out calendar dialog, 
       
  1777  * @c CEikCalendar. This may be used to directly set the day, month and year 
       
  1778  * values. 
       
  1779  *
       
  1780  * The editor has an associated resource struct @c DATE_EDITOR and control 
       
  1781  * factory identifier @c EEikCtDateEditor.
       
  1782  *
       
  1783  */
       
  1784 class CEikDateEditor : public CEikTTimeEditor, private MEikCalendarObserver
       
  1785 	{
       
  1786 
       
  1787 public:
       
  1788 
       
  1789     // miscellaneous functions
       
  1790     /**
       
  1791      * C++ default constructor.
       
  1792      */
       
  1793     IMPORT_C CEikDateEditor();
       
  1794 
       
  1795     /**
       
  1796      * Destructor.
       
  1797      */
       
  1798     IMPORT_C virtual ~CEikDateEditor();
       
  1799 
       
  1800     // to be called by container only if not constructed from resource
       
  1801     /**
       
  1802      * Handles 2nd phase construction.
       
  1803      *
       
  1804      * This function completes the construction of a newly-allocated date 
       
  1805      * editor. This function should be used instead of 
       
  1806      * @c ConstructFromResourceL() when not initialising from a resource file.
       
  1807      * The editor's minimum, maximum and initial date values are set and the 
       
  1808      * date format and date separator characters specified in class @c TLocale
       
  1809      * are honoured.
       
  1810      * 
       
  1811      * @param aMinimumDate The minimum allowable date.
       
  1812      * @param aMaximumDate The maximum allowable date.
       
  1813      * @param aInitialDate The initial value.
       
  1814      * @param aWithoutPopoutCalendar If @c ETrue the editor will not have a 
       
  1815      *        pop-out calendar dialog / icon. If @c EFalse the editor will have
       
  1816      *        a pop-out calendar dialog / icon.
       
  1817      */
       
  1818     IMPORT_C void ConstructL(const TTime& aMinimumDate, 
       
  1819                              const TTime& aMaximumDate, 
       
  1820                              const TTime& aInitialDate, 
       
  1821                              TBool aWithoutPopoutCalendar); 
       
  1822     
       
  1823     /**
       
  1824      * Sets the date editor's value.
       
  1825      * 
       
  1826      * @param aDate The editor's value. Time components are ignored.
       
  1827      */
       
  1828     IMPORT_C void SetDate(const TTime& aDate);
       
  1829 
       
  1830     /**
       
  1831      * Gets the date editor's value.
       
  1832      *
       
  1833      * @return The editor's date value.
       
  1834      */
       
  1835 	IMPORT_C TTime Date() const;
       
  1836 
       
  1837     /**
       
  1838      * Sets date editor to initialised or uninitialised.
       
  1839      * 
       
  1840      * @param aUninitialised If @c ETrue then the date editor is set 
       
  1841      *        to be uninitialised.
       
  1842      */
       
  1843 	IMPORT_C void SetUninitialised(TBool aUninitialised);
       
  1844 
       
  1845     /**
       
  1846      * Tests whether the editor is uninitialised.
       
  1847      * 
       
  1848      * @return @c ETrue if uninitialised.
       
  1849      */
       
  1850 	IMPORT_C TBool IsUninitialised() const;
       
  1851 
       
  1852 	// from CEikTTimeEditor
       
  1853 	// only values inside the initial minimum and maximum are permitted
       
  1854     /**
       
  1855      * From @c CEikTTimeEditor.
       
  1856      * 
       
  1857      * Sets the minimum and maximum allowable dates.
       
  1858      *
       
  1859      * If the current date is outside the new bounds it is changed to be within
       
  1860      * them.
       
  1861      *
       
  1862      * @param aMinimumDate The minimum allowable value.
       
  1863      * @param aMaximumDate The maximum allowable value.
       
  1864      */
       
  1865     IMPORT_C virtual void SetMinimumAndMaximum(const TTime& aMinimumDate, 
       
  1866                                                const TTime& aMaximumDate); 
       
  1867     	
       
  1868     /**
       
  1869      * From @c CEikTTimeEditor.
       
  1870      *
       
  1871      * Gets the date editor's minimum and maximum values.
       
  1872      *
       
  1873      * @param aMinimumDate On return, the minimum allowable value.
       
  1874      * @param aMaximumDate On return, the maximum allowable value.
       
  1875      */
       
  1876     IMPORT_C virtual void GetMinimumAndMaximum(TTime& aMinimumDate, 
       
  1877                                                TTime& aMaximumDate) const;
       
  1878 	
       
  1879     // from CCoeControl
       
  1880     /**
       
  1881      * From @c CCoeControl.
       
  1882      *
       
  1883      * Handles key events.
       
  1884      *
       
  1885      * @param aKeyEvent The key event.
       
  1886      * @param aType The type of key event.
       
  1887      * @return @c EKeyConsumed if the key has beend handled. 
       
  1888      */
       
  1889     IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, 
       
  1890                                                  TEventCode aType);
       
  1891 	
       
  1892     /**
       
  1893      * From @c CCoeControl.
       
  1894      * 
       
  1895      * Second-phase construction from a resource file.
       
  1896      *
       
  1897      * The function reads the maximum and minimum date values and whether 
       
  1898      * or not the editor should support a pop-out calendar and/or date icon 
       
  1899      * from a @c DATE_EDITOR resource. It sets the initial date to be the same 
       
  1900      * as the maximum date and honours the locale's date format and separators.
       
  1901      * 
       
  1902      * @param aResourceReader A resource file reader.
       
  1903      */
       
  1904     IMPORT_C virtual void ConstructFromResourceL(TResourceReader& 
       
  1905                                                  aResourceReader);
       
  1906 	
       
  1907     /**
       
  1908      * From @c CCoeControl.
       
  1909      * 
       
  1910      * Editor validation.
       
  1911      *
       
  1912      * This function should be called before an attempt is made to remove focus
       
  1913      * from a date editor. If the control value is not within the bounds 
       
  1914      * specified by the minimum and maximum date values, it is reset to the 
       
  1915      * nearest allowable value, the function then leaves.
       
  1916      */
       
  1917     IMPORT_C virtual void PrepareForFocusLossL();
       
  1918     
       
  1919     /**
       
  1920      * From @c CCoeControl.
       
  1921      * 
       
  1922      * Handles pointer events.
       
  1923      *
       
  1924      * @param aPointerEvent The pointer event.
       
  1925      */
       
  1926     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
  1927 
       
  1928 private:
       
  1929 
       
  1930     // from CEikMfne
       
  1931     virtual void CreatePopoutIfRequiredL();
       
  1932     // from CEikTTimeEditor
       
  1933     virtual void SetTTime(const TTime& aDate);
       
  1934     virtual TTime GetTTime() const; // can only be called if PrepareForFocusLossL() succeeded
       
  1935 
       
  1936 private:
       
  1937 
       
  1938     // from MEikCalendarDialogObserver
       
  1939     virtual void GetMinimumAndMaximumAndInitialDatesForCalendarL(TTime& aMinimumDate, 
       
  1940                                                                  TTime& aMaximumDate, 
       
  1941                                                                  TTime& aInitialDate) const;
       
  1942     virtual void SetDateFromCalendarAndDrawNow(const TTime& aDate);
       
  1943     // miscellaneous functions
       
  1944     void DoSetMinimumAndMaximum(const TTime& aMinimumDate, const TTime& aMaximumDate);
       
  1945     IMPORT_C virtual void CEikMfne_Reserved();
       
  1946 
       
  1947 private:
       
  1948 
       
  1949     /**
       
  1950     * From CAknControl
       
  1951     */
       
  1952     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
  1953 
       
  1954 private:
       
  1955 
       
  1956 	CDateEditor* iDateEditor;
       
  1957 	TTime iMinimumDate;
       
  1958 	TTime iMaximumDate;
       
  1959 	TInt iSpare;
       
  1960 	};
       
  1961 
       
  1962 
       
  1963 //
       
  1964 
       
  1965 /**
       
  1966  * Time and date editor.
       
  1967  * 
       
  1968  * This control allows both a time and date to be displayed and edited.
       
  1969  * It contains the following time fields: hours, minutes and seconds,
       
  1970  * two time separator characters and am/pm text, and the following date
       
  1971  * fields: year, month and day, with two date separator characters. The
       
  1972  * seconds and hours fields are optional and the order of the date fields and
       
  1973  * the separator characters are locale-dependent. The upper and lower
       
  1974  * field bounds are set, and dates and times outside these bounds are
       
  1975  * invalid.
       
  1976  * 
       
  1977  * Date field values may be edited directly or via a pop-out calendar
       
  1978  * dialog.
       
  1979  * 
       
  1980  * The editor has an associated resource struct TIME_AND_DATE_EDITOR
       
  1981  * and control factory identifier EEikCtTimeAndDateEditor. 
       
  1982  */
       
  1983 class CEikTimeAndDateEditor : public CEikTTimeEditor, private MEikCalendarObserver
       
  1984 	{
       
  1985 public:
       
  1986 	// miscellaneous functions
       
  1987 
       
  1988     /**
       
  1989      * Default constructor.
       
  1990      * 
       
  1991      * This function should be used as the first stage in two stage
       
  1992      * construction, followed by a call to either ConstructFromResourceL() to
       
  1993      * initialise the editor's field values from a resource file, or ConstructL()
       
  1994      * (if no resource file is used). 
       
  1995      */
       
  1996 	IMPORT_C CEikTimeAndDateEditor();
       
  1997 
       
  1998     /**
       
  1999      * Destructor. 
       
  2000      * 
       
  2001      * This frees the resources owned by the time and date editor, prior to
       
  2002      * its destruction.
       
  2003      */
       
  2004 	IMPORT_C virtual ~CEikTimeAndDateEditor();
       
  2005 
       
  2006 	// ConstructL to be called by container only if not constructed from resource, also ownership of aInterveningText is transferred when everything that can leave has successfully been done
       
  2007 
       
  2008     /**
       
  2009      * Second phase construction.
       
  2010      * 
       
  2011      * This function completes construction of a newly-allocated date and
       
  2012      * time editor, by setting the minimum, maximum and initial date and time
       
  2013      * values. It should be called by the container only if the control is
       
  2014      * not constructed from a resource file.
       
  2015      * 
       
  2016      * The aFlags parameter is used to set whether the seconds or hours
       
  2017      * fields are not required. The minutes field is always present. It may also
       
  2018      * be used to specify whether or not to force 24 hour time format,
       
  2019      * overriding the locale's setting, and whether the editor should have a
       
  2020      * pop-out calendar dialog.
       
  2021      * 
       
  2022      * The locale-dependant date and time settings specified in class
       
  2023      * TLocale are honoured.
       
  2024      * 
       
  2025      * If the initial date/time is outside the bounds specified by the
       
  2026      * minimum and maximum, it is set to the nearest valid setting.
       
  2027      * 
       
  2028      * A panic will occur if the minimum date/time is later than the
       
  2029      * maximum date/time.
       
  2030      * 
       
  2031      * @param aMinimumTimeAndDate The minimum date and time value.
       
  2032      * @param aMaximumTimeAndDate The maximum date and time value.
       
  2033      * @param aInitialTimeAndDate The initial date and time value.
       
  2034      * @param aFlags A bitmask of flags. See eikon.hrh file, EEikTime,
       
  2035      * EEikDate etc.
       
  2036      * @param aInterveningText Descriptor containing the text to use to
       
  2037      * separate the time and date portions of the editor.     
       
  2038      */
       
  2039 	IMPORT_C void ConstructL(const TTime& aMinimumTimeAndDate, const TTime& aMaximumTimeAndDate, const TTime& aInitialTimeAndDate, TUint32 aFlags, HBufC* aInterveningText=NULL);
       
  2040 	
       
  2041     /**
       
  2042      * Sets the values of the time and date editor's fields.
       
  2043      * 
       
  2044      * @param aTimeAndDate The new value for the date and time editor's
       
  2045      * fields.
       
  2046      */
       
  2047 	IMPORT_C void SetTimeAndDate(const TTime& aTimeAndDate);
       
  2048 
       
  2049     /**
       
  2050      * Gets the time and date editor's value.
       
  2051      * 
       
  2052      * @return The editor's value.
       
  2053      */
       
  2054 	IMPORT_C TTime TimeAndDate() const;
       
  2055 
       
  2056     /**
       
  2057      * Sets the uninitialized status of the editor.
       
  2058      * 
       
  2059      * @param aUninitialised If ETrue, sets the editor as uninitialized,
       
  2060      *                       i.e. it doesn't display anything.
       
  2061      */
       
  2062 	IMPORT_C void SetUninitialised(TBool aUninitialised);
       
  2063 	
       
  2064 	/**
       
  2065 	 * Gets the uninitialized status of the editor.
       
  2066 	 * 
       
  2067 	 * @return ETrue, if the editor is set as uninitialized.
       
  2068 	 */	
       
  2069 	IMPORT_C TBool IsUninitialised() const;
       
  2070 	
       
  2071 	// from CEikTTimeEditor
       
  2072 
       
  2073     /**
       
  2074      * Sets the range of allowable values.
       
  2075      * 
       
  2076      * These define the maximum and minimum time/date values that may be
       
  2077      * entered by the user.
       
  2078      * 
       
  2079      * If the existing date/time value is outside the new bounds, it is
       
  2080      * reset to the nearest allowable value.
       
  2081      * 
       
  2082      * @param aMinimumTimeAndDate The minimum allowable value.
       
  2083      * @param aMaximumTimeAndDate The maximum allowable value.
       
  2084      */
       
  2085 	IMPORT_C virtual void SetMinimumAndMaximum(const TTime& aMinimumTimeAndDate, const TTime& aMaximumTimeAndDate); // only values inside the initial minimum and maximum are permitted
       
  2086 
       
  2087     /**
       
  2088      * Gets the range of allowable values that may be entered by the user.
       
  2089      * 
       
  2090      * @param aMinimumTimeAndDate On return, contains the time and date
       
  2091      * editor's minimum allowable value.
       
  2092      * @param aMaximumTimeAndDate On return, contains the time and date
       
  2093      * editor's maximum allowable value.
       
  2094      */
       
  2095 	IMPORT_C virtual void GetMinimumAndMaximum(TTime& aMinimumTimeAndDate, TTime& aMaximumTimeAndDate) const;
       
  2096 
       
  2097 	// from CCoeControl
       
  2098 	
       
  2099     /**
       
  2100      * Handles key events.
       
  2101      * 
       
  2102      * For example, the Tab key validates and launches a calendar popout.
       
  2103      * 
       
  2104      * Calls CEikMfne::OfferKeyEventL() if the control does not consume the
       
  2105      * key.
       
  2106      * 
       
  2107      * @param aKeyEvent The key event.
       
  2108      * @param aType The type of key event.
       
  2109      * @return Returns EKeyWasConsumed if the control consumes the key.
       
  2110      */
       
  2111 	IMPORT_C virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
  2112 
       
  2113     /**
       
  2114      * Second phase construction from a resource.
       
  2115      * 
       
  2116      * This function completes the construction of a newly-allocated
       
  2117      * date/time editor from a TIME_AND_DATE_EDITOR resource. The minimum and
       
  2118      * maximum date/times, the date and time flag settings, and the intervening
       
  2119      * text are read from the resource, and ConstructL() is called with these
       
  2120      * settings. The initial date/time is set to the maximum date/time value. 
       
  2121      * 
       
  2122      * @param aResourceReader A resource file reader.
       
  2123      */
       
  2124 	IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aResourceReader);
       
  2125 
       
  2126     /**
       
  2127      * Prepares the editor for focus loss.
       
  2128      * 
       
  2129      * This function should be called to validate the editor's contents
       
  2130      * when an attempt is made to remove focus from the control. If the control
       
  2131      * value is not within the bounds specified by the minimum and maximum
       
  2132      * date/time values, it is reset to the nearest allowable value, the
       
  2133      * function will leave and display an appropriate message.
       
  2134      */
       
  2135 	IMPORT_C virtual void PrepareForFocusLossL();
       
  2136 
       
  2137     /**
       
  2138      * From @c CCoeControl.
       
  2139      * 
       
  2140      * Handles pointer events.
       
  2141      *
       
  2142      * @param aPointerEvent The pointer event.
       
  2143      */
       
  2144     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);	
       
  2145     
       
  2146 private:
       
  2147 	// from CEikMfne
       
  2148 	virtual void CreatePopoutIfRequiredL();	
       
  2149 	IMPORT_C virtual void CEikMfne_Reserved();
       
  2150 	// from CEikTTimeEditor
       
  2151 	virtual void SetTTime(const TTime& aTimeAndDate);
       
  2152 	virtual TTime GetTTime() const; // can only be called if PrepareForFocusLossL() succeeded
       
  2153 private:
       
  2154 	// from MEikCalendarDialogObserver
       
  2155 	virtual void GetMinimumAndMaximumAndInitialDatesForCalendarL(TTime& aMinimumDate, TTime& aMaximumDate, TTime& aInitialDate) const;
       
  2156 	virtual void SetDateFromCalendarAndDrawNow(const TTime& aDate);
       
  2157 	// miscellaneous functions
       
  2158 	void DoSetMinimumAndMaximum(const TTime& aMinimumTimeAndDate, const TTime& aMaximumTimeAndDate);
       
  2159 private:
       
  2160     /**
       
  2161     * From CAknControl
       
  2162     */
       
  2163     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
  2164 private:
       
  2165 	CTimeEditor* iTimeEditor;
       
  2166 	CDateEditor* iDateEditor;
       
  2167 	TTime iMinimumTimeAndDate;
       
  2168 	TTime iMaximumTimeAndDate;
       
  2169 	TInt iSpare;
       
  2170 	};
       
  2171 
       
  2172 
       
  2173 //
       
  2174 
       
  2175 /**
       
  2176  * Duration editor.
       
  2177  * 
       
  2178  * The duration editor allows a time duration to be displayed and
       
  2179  * edited. The editor has a clock icon and an edit field with separators for
       
  2180  * hours, minutes, and seconds. These fields can all be suppressed using
       
  2181  * the appropriate flags in the resource declaration.
       
  2182  * 
       
  2183  * Unlike the time editor control, the duration editor has no am or pm
       
  2184  * text. This is because the duration is a length of time (from 0 to 24
       
  2185  * hours), rather than a point in time.
       
  2186  * 
       
  2187  * The minimum and maximum values are set, and values outside these
       
  2188  * limits are invalid.
       
  2189  * 
       
  2190  * The editor has an associated resource struct DURATION_EDITOR and
       
  2191  * control factory identifier EEikCtDurationEditor. 
       
  2192  */
       
  2193 class CEikDurationEditor : public CEikMfne
       
  2194 	{
       
  2195 public:
       
  2196 	// miscellaneous functions
       
  2197 
       
  2198     /**
       
  2199      * Default constructor.
       
  2200      * 
       
  2201      * This function should be used as the first stage in two stage
       
  2202      * construction, followed by a call to either ConstructFromResourceL() to
       
  2203      * initialise the editor's field values from a resource file, or ConstructL()
       
  2204      * if no resource file is used.
       
  2205      */
       
  2206 	IMPORT_C CEikDurationEditor();
       
  2207 
       
  2208     /**
       
  2209      * Destructor.
       
  2210      * 
       
  2211      * The destructor frees the resources owned by the duration editor,
       
  2212      * prior to its destruction.
       
  2213      */
       
  2214 	IMPORT_C virtual ~CEikDurationEditor();
       
  2215 
       
  2216     /**
       
  2217      * Second phase construction.
       
  2218      * 
       
  2219      * This function completes the construction of a newly-allocated
       
  2220      * duration editor. This function should be used instead of
       
  2221      * ConstructFromResourceL() when not initialising from a resource file.
       
  2222      * 
       
  2223      * The function sets the editor's minimum, maximum and initial values.
       
  2224      * The time separator characters specified in class TLocale are honoured.
       
  2225      * If the initial duration is less than the minimum value the minimum
       
  2226      * value is used as the initial setting. If the initial duration is greater
       
  2227      * than the maximum value the maximum value is used as the initial
       
  2228      * setting.
       
  2229      * 
       
  2230      * The aFlags parameter is used to determine whether the seconds or
       
  2231      * hours fields are not required. The minutes field is always present.
       
  2232      * Regardless of the value specified in aFlags, 24 hour time format is set,
       
  2233      * overriding the locale's setting.
       
  2234      * 
       
  2235      * @param aMinimumDuration The minimum interval in seconds.
       
  2236      * @param aMaximumDuration The maximum interval in seconds.
       
  2237      * @param aInitialDuration The initial interval in seconds.
       
  2238      * @param aFlags Duration editor flags.
       
  2239      */
       
  2240 	IMPORT_C void ConstructL(const TTimeIntervalSeconds& aMinimumDuration, const TTimeIntervalSeconds& aMaximumDuration, const TTimeIntervalSeconds& aInitialDuration, TUint32 aFlags);
       
  2241 
       
  2242     /**
       
  2243      * Sets the minimum and maximum duration values.
       
  2244      * 
       
  2245      * The user can only enter values between these bounds.
       
  2246      * 
       
  2247      * @param aMinimumDuration The minimum duration.
       
  2248      * @param aMaximumDuration The maximum duration.
       
  2249      * @panic 48 If the minimum duration exceeds the maximum.
       
  2250      */
       
  2251 	IMPORT_C void SetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumDuration, const TTimeIntervalSeconds& aMaximumDuration); // only values inside the initial minimum and maximum are permitted
       
  2252 
       
  2253     /**
       
  2254      * Gets the duration editor's minimum and maximum values.
       
  2255      * 
       
  2256      * @param aMinimumDuration On return, the minimum value.
       
  2257      * @param aMaximumDuration On return, the maximum value.
       
  2258      */
       
  2259 	IMPORT_C void GetMinimumAndMaximum(TTimeIntervalSeconds& aMinimumDuration, TTimeIntervalSeconds& aMaximumDuration) const;
       
  2260 
       
  2261     /**
       
  2262      * Sets the duration editor's value.
       
  2263      * 
       
  2264      * @param aDuration The new value to convert into hours, minutes and
       
  2265      * seconds and to which the duration editor's fields will be set.
       
  2266      */
       
  2267 	IMPORT_C void SetDuration(const TTimeIntervalSeconds& aDuration);
       
  2268 
       
  2269     /**
       
  2270      * Gets the duration editor's value and returns it as a period of
       
  2271      * seconds.
       
  2272      * 
       
  2273      * @return The editor's value in seconds.
       
  2274      */
       
  2275 	IMPORT_C TTimeIntervalSeconds Duration() const; // can only be called if PrepareForFocusLossL() succeeded
       
  2276 
       
  2277 	// framework
       
  2278 
       
  2279     /**
       
  2280      * Second-phase construction from a resource.
       
  2281      * 
       
  2282      * The function reads the maximum and minimum duration values, and the
       
  2283      * flags settings, from a DURATION_EDITOR resource. It sets the initial
       
  2284      * duration to be the same as the maximum value and honours the locale's
       
  2285      * time separators.
       
  2286      * 
       
  2287      * @param aResourceReader A resource file reader.
       
  2288      */
       
  2289 	IMPORT_C void ConstructFromResourceL(TResourceReader& aResourceReader);
       
  2290 
       
  2291     /**
       
  2292      * Editor validation.
       
  2293      * 
       
  2294      * This function should be called when an attempt is made to remove
       
  2295      * focus from a duration editor. If the editor value is not within the
       
  2296      * bounds specified by the minimum and maximum duration values, it is reset to
       
  2297      * the nearest allowable value - the function will leave.
       
  2298      */
       
  2299 	IMPORT_C void PrepareForFocusLossL();
       
  2300 
       
  2301     // From CCoeControl    
       
  2302     /**
       
  2303      * From @c CCoeControl.
       
  2304      * 
       
  2305      * Handles pointer events.
       
  2306      *
       
  2307      * @param aPointerEvent The pointer event.
       
  2308      */
       
  2309     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);	
       
  2310 private:
       
  2311 	// miscellaneous functions
       
  2312 	void DoSetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumDuration, const TTimeIntervalSeconds& aMaximumDuration);
       
  2313 	IMPORT_C virtual void CEikMfne_Reserved();
       
  2314 private:
       
  2315     /**
       
  2316     * From CAknControl
       
  2317     */
       
  2318     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
  2319 private:
       
  2320 	CTimeEditor* iTimeEditor;
       
  2321 	TTimeIntervalSeconds iMinimumDuration;
       
  2322 	TTimeIntervalSeconds iMaximumDuration;
       
  2323 	TInt iSpare;
       
  2324 	};
       
  2325 
       
  2326 /**
       
  2327  * Time offset editor.
       
  2328  * 
       
  2329  * This control allows a signed time offset to be displayed and edited.
       
  2330  * It has the same fields as the time editor control CEikTimeEditor,
       
  2331  * except there is no AM or PM text because the value is a time offset,
       
  2332  * positive or negative, from 0 to 24 hours rather than a point in time.
       
  2333  * 
       
  2334  * The editor has an associated resource struct TIME_OFFSET_EDITOR and
       
  2335  * control factory identifier EEikCtTimeOffsetEditor. 
       
  2336  */
       
  2337 class CEikTimeOffsetEditor : public CEikMfne
       
  2338 	{
       
  2339 public:
       
  2340 	// miscellaneous functions
       
  2341 
       
  2342     /**
       
  2343      * Default constructor.
       
  2344      * 
       
  2345      * This function should be used as the first stage in two stage
       
  2346      * construction, followed by a call to either ConstructFromResourceL() to
       
  2347      * initialise the editor's field values from a resource file, or ConstructL()
       
  2348      * if no resource file is used.
       
  2349      */
       
  2350 	IMPORT_C CEikTimeOffsetEditor();
       
  2351 
       
  2352     /**
       
  2353      * Destructor. This frees the resources owned by the time offset editor,
       
  2354      * prior to its destruction.
       
  2355      */
       
  2356 	IMPORT_C virtual ~CEikTimeOffsetEditor();
       
  2357 
       
  2358     /**
       
  2359      * Second phase constructor.
       
  2360      * 
       
  2361      * This function completes the construction of a time offset editor, by
       
  2362      * setting its minimum, maximum and initial values. The time separator
       
  2363      * characters specified in the system's locale are honoured. It should be
       
  2364      * called by the container only if the control is not constructed from a
       
  2365      * resource file.
       
  2366      * 
       
  2367      * The aFlags parameter is used to determine whether the seconds or
       
  2368      * hours fields are displayed by the editor. The minutes field is always
       
  2369      * displayed. This function forces 24 hour time format for the time offset
       
  2370      * editor, overriding the locale's setting.
       
  2371      * 
       
  2372      * If the initial time offset is outside the bounds specified, it is
       
  2373      * invalid and will be reset to the upper or lower bound.
       
  2374      * 
       
  2375      * The minimum value for a time offset editor is -23:59:59, and the
       
  2376      * maximum value is 23:59:59.
       
  2377      * 
       
  2378      * @param aMinimumTimeOffset The minimum allowable value, in seconds.
       
  2379      * @param aMaximumTimeOffset The maximum allowable value, in seconds.
       
  2380      * @param aInitialTimeOffset The initial value, in seconds.
       
  2381      * @param aFlags Determines which fields are required. Specify
       
  2382      * CTimeEditor::EWithoutSecondsField for no seconds field,
       
  2383      * CTimeEditor::EWithoutHoursField for no hours field. 24 hour clock format is set, regardless
       
  2384      * of the flag setting specified in this parameter.
       
  2385      */
       
  2386 	IMPORT_C void ConstructL(const TTimeIntervalSeconds& aMinimumTimeOffset, const TTimeIntervalSeconds& aMaximumTimeOffset, const TTimeIntervalSeconds& aInitialTimeOffset, TUint32 aFlags);
       
  2387 
       
  2388     /**
       
  2389      * Sets the range of allowable offset values. 
       
  2390      * 
       
  2391      * These define the maximum and minimum values that may be entered by
       
  2392      * the user.
       
  2393      * 
       
  2394      * If the existing offset value is outside the bounds set by this
       
  2395      * function, it is reset to the nearest boundary value.
       
  2396      * 
       
  2397      * @param aMinimumTimeOffset The minimum allowable value.
       
  2398      * @param aMaximumTimeOffset The maximum allowable value.
       
  2399      * @panic 49 If the minimum exceeds the maximum.
       
  2400      */
       
  2401 	IMPORT_C void SetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumTimeOffset, const TTimeIntervalSeconds& aMaximumTimeOffset); // only values inside the initial minimum and maximum are permitted
       
  2402 
       
  2403     /**
       
  2404      * Gets the range of allowable values that may be entered by the user.
       
  2405      * 
       
  2406      * @param aMinimumTimeOffset On return, contains the time offset
       
  2407      * editor’s minimum allowable value.
       
  2408      * @param aMaximumTimeOffset On return, contains the time offset
       
  2409      * editor’s maximum allowable value.
       
  2410      */
       
  2411 	IMPORT_C void GetMinimumAndMaximum(TTimeIntervalSeconds& aMinimumTimeOffset, TTimeIntervalSeconds& aMaximumTimeOffset) const;
       
  2412 
       
  2413     /**
       
  2414      * Sets the time offset editor's value.
       
  2415      * 
       
  2416      * The sign is set according to whether the value specified is positive
       
  2417      * or negative.
       
  2418      * 
       
  2419      * @param aTimeOffset The new offset value to which to assign to the
       
  2420      * editor.
       
  2421      */
       
  2422 	IMPORT_C void SetTimeOffset(const TTimeIntervalSeconds& aTimeOffset);
       
  2423 
       
  2424     /**
       
  2425      * Gets the time offset editor's value converted into seconds.
       
  2426      * 
       
  2427      * @return The editor's value in seconds.
       
  2428      */
       
  2429 	IMPORT_C TTimeIntervalSeconds TimeOffset() const; // can only be called if PrepareForFocusLossL() succeeded
       
  2430 
       
  2431 	// framework
       
  2432 
       
  2433     /**
       
  2434      * Second phase construction from a resource. 
       
  2435      * 
       
  2436      * This function completes the construction of a time offset editor
       
  2437      * from a TIME_OFFSET_EDITOR resource.
       
  2438      * 
       
  2439      * The minimum and maximum time offsets, and the flags settings are
       
  2440      * read from the resource, and ConstructL() is called with these settings.
       
  2441      * The initial time offset is set to the maximum time offset value.
       
  2442      * 
       
  2443      * @param aResourceReader A resource file reader.
       
  2444      */
       
  2445 	IMPORT_C void ConstructFromResourceL(TResourceReader& aResourceReader);
       
  2446 
       
  2447     /**
       
  2448      * Prepares editor for focus loss.
       
  2449      * 
       
  2450      * This function should be called to validate the editor’s contents
       
  2451      * when an attempt is made to remove focus from the control.
       
  2452      * 
       
  2453      * If the control value is not within the bounds specified by the
       
  2454      * minimum and maximum time offset values, it is reset to the nearest
       
  2455      * allowable value. The function then leaves.
       
  2456      */
       
  2457 	IMPORT_C void PrepareForFocusLossL();
       
  2458 
       
  2459     // From CCoeControl    
       
  2460 
       
  2461     /**
       
  2462      * From @c CCoeControl.
       
  2463      * 
       
  2464      * Handles pointer events.
       
  2465      *
       
  2466      * @param aPointerEvent The pointer event.
       
  2467      */
       
  2468     IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);	
       
  2469     
       
  2470 private:
       
  2471 	// miscellaneous functions
       
  2472 	void DoSetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumTimeOffset, const TTimeIntervalSeconds& aMaximumTimeOffset);
       
  2473 	IMPORT_C virtual void CEikMfne_Reserved();
       
  2474 private:
       
  2475     /**
       
  2476     * From CAknControl
       
  2477     */
       
  2478     IMPORT_C void* ExtensionInterface( TUid aInterface );
       
  2479 private:
       
  2480 	CTimeEditor* iTimeEditor;
       
  2481 	TTimeIntervalSeconds iMinimumTimeOffset;
       
  2482 	TTimeIntervalSeconds iMaximumTimeOffset;
       
  2483 	// none of these pointers owns anything
       
  2484 	CEikMfneSymbol* iSign;
       
  2485 	TInt iSpare;
       
  2486 	};
       
  2487 
       
  2488 
       
  2489 //
       
  2490 // Longitude and Latitude editors removed 2.4.2002:
       
  2491 
       
  2492 enum
       
  2493 	{
       
  2494 	EEikOrientationNorthSouth   =0x1000,
       
  2495 	EEikOrientationWestEast     =0x2000,
       
  2496 	EEikOrientationMask=EEikOrientationNorthSouth|EEikOrientationWestEast
       
  2497 	};
       
  2498 
       
  2499 
       
  2500 enum
       
  2501 	{
       
  2502 	EEikDirectionNegative,
       
  2503 	EEikDirectionPositive,
       
  2504 	EEikDirectionMask=EEikDirectionNegative|EEikDirectionPositive
       
  2505 	};
       
  2506 
       
  2507 
       
  2508 enum TEikCompass
       
  2509 	{
       
  2510 	EEikCompassNorth=EEikOrientationNorthSouth|EEikDirectionNegative,
       
  2511 	EEikCompassSouth=EEikOrientationNorthSouth|EEikDirectionPositive,
       
  2512 	EEikCompassEast=EEikOrientationWestEast|EEikDirectionNegative,
       
  2513 	EEikCompassWest=EEikOrientationWestEast|EEikDirectionPositive
       
  2514 	};
       
  2515 
       
  2516 
       
  2517 struct SEikDegreesMinutesDirection
       
  2518 	{
       
  2519 	TInt iDegrees;
       
  2520 	TInt iMinutes;
       
  2521 	TInt iSeconds;
       
  2522 	TEikCompass iDirection;
       
  2523 	};
       
  2524 
       
  2525 #endif  // __EIKMFNE_H__
       
  2526 // End of file