epoc32/include/mw/aknipfed.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  The CAknIpFieldEditor class implements an editor for an 
williamr@2
    15
*                IP address.
williamr@2
    16
*
williamr@2
    17
*/
williamr@2
    18
williamr@2
    19
williamr@2
    20
#if !defined(__AKNIPFED_H_)
williamr@2
    21
#define __AKNIPFED_H_
williamr@2
    22
williamr@2
    23
// INCLUDES
williamr@2
    24
#include <eikmfne.h>
williamr@2
    25
williamr@2
    26
// FORWARD DECLERATIONS
williamr@2
    27
class TInetAddr;
williamr@2
    28
williamr@2
    29
//CLASS DECLERATION
williamr@2
    30
/**
williamr@2
    31
 * The @c CAknIpFieldEditor class implements an editor for an IP address.
williamr@2
    32
 * Based on Crystal @c CCknIpFieldEditor.
williamr@2
    33
 * 
williamr@2
    34
 * @since Series 60 0.9 
williamr@2
    35
 */
williamr@2
    36
class CAknIpFieldEditor : public CEikMfne 
williamr@2
    37
    {
williamr@2
    38
public: // public constructors
williamr@2
    39
williamr@2
    40
    /**
williamr@2
    41
    * C++ default constructor.
williamr@2
    42
    */
williamr@2
    43
	IMPORT_C CAknIpFieldEditor();
williamr@2
    44
williamr@2
    45
    /**
williamr@2
    46
    * Two phased constructor.
williamr@2
    47
    * @param aMinimumAddress Reference to a @c TInetAddr struct. Defines lower 
williamr@2
    48
    * limits for IP editor fields.
williamr@2
    49
    * @param aMaximumAddress Reference to a @c TInetAddr struct. Defines upper 
williamr@2
    50
    * limits for IP editor fields.
williamr@2
    51
    * @param aInitialAddress Reference to a @c TInetAddr struct. Defines the 
williamr@2
    52
    * initial address of the IP editor.
williamr@2
    53
    * @param aFlags The number field's flags. Default is 0.
williamr@2
    54
    * @return Pointer to the fully constructed @c CAknIpFieldEditor object.
williamr@2
    55
    */
williamr@2
    56
	void ConstructL(TInetAddr& aMinimumAddress,
williamr@2
    57
                    TInetAddr& aMaximumAddress,
williamr@2
    58
                    TInetAddr& aInitialAddress,
williamr@2
    59
                    const TInt aFlags=0);
williamr@2
    60
williamr@2
    61
    /**
williamr@2
    62
    * Two phased constructor.
williamr@2
    63
    * Constructs a CAknIpFieldEditor object using given parameters.
williamr@2
    64
    * @param aMinimumAddress Reference to a @c TInetAddr struct. Defines lower
williamr@2
    65
    * limits for IP editor fields.
williamr@2
    66
    * @param aMaximumAddress Reference to a @c TInetAddr struct. Defines upper
williamr@2
    67
    * limits for IP editor fields.
williamr@2
    68
    * @param aInitialAddress Reference to a @c TInetAddr struct. Defines the 
williamr@2
    69
    * initial address of the IP editor.
williamr@2
    70
    * @return Pointer to the fully constructed @c CAknIpFieldEditor object.
williamr@2
    71
    */
williamr@2
    72
	IMPORT_C static CAknIpFieldEditor* NewL(TInetAddr& aMinimumAddress,
williamr@2
    73
                                            TInetAddr& aMaximumAddress,
williamr@2
    74
                                            TInetAddr& aInitialAddress);
williamr@2
    75
	
williamr@2
    76
	/**
williamr@2
    77
	* Two phased constructor.
williamr@2
    78
	* Requires a call for @c ConstructFromResourcesL() method to finish 
williamr@2
    79
	* construction.
williamr@2
    80
	* @return Pointer to the constructed @c CAknIpFieldEditor object.
williamr@2
    81
	*/
williamr@2
    82
	IMPORT_C static CAknIpFieldEditor* NewL();
williamr@2
    83
	
williamr@2
    84
public: // Methods for getting and setting values
williamr@2
    85
williamr@2
    86
	        
williamr@2
    87
    /**
williamr@2
    88
 	* Sets the editor's value dynamically.
williamr@2
    89
    * @param aAddress Reference to a @c TInetAddr struct including the new 
williamr@2
    90
    * address.
williamr@2
    91
    */
williamr@2
    92
	IMPORT_C void SetAddress(const TInetAddr& aAddress);
williamr@2
    93
	
williamr@2
    94
    /**
williamr@2
    95
    * Gets the editor's value.
williamr@2
    96
    * @return TInetAddr struct including the address.
williamr@2
    97
    */
williamr@2
    98
	IMPORT_C TInetAddr Address() const;
williamr@2
    99
	
williamr@2
   100
	/**
williamr@2
   101
    * Sets the minimum and maximum editor values.
williamr@2
   102
    * @param aMinimumAddress Reference to a @c TInetAddr struct defining the
williamr@2
   103
    * lower limits of the editor fields.
williamr@2
   104
    * @param aMaximumAddress Reference to a @c TInetAddr struct defining the
williamr@2
   105
    * upper limits of the editor fields.
williamr@2
   106
    */
williamr@2
   107
	IMPORT_C virtual void SetMinimumAndMaximum(
williamr@2
   108
	                                    const TInetAddr& aMinimumAddress,
williamr@2
   109
                                        const TInetAddr& aMaximumAddress); // only values inside the initial minimum and maximum are permitted
williamr@2
   110
williamr@2
   111
    /**
williamr@2
   112
    * Gets the minimum and maximum editor values.
williamr@2
   113
    * @param aMinimumAddress Reference to a @c TInetAddr struct in which the
williamr@2
   114
    * lower limits are wanted to be returned.
williamr@2
   115
    * @param aMaximumAddress Reference to a @c TInetAddr struct in which the
williamr@2
   116
    * upper limits are wanted to be returned.
williamr@2
   117
    */
williamr@2
   118
	IMPORT_C virtual void GetMinimumAndMaximum(
williamr@2
   119
	                                    TInetAddr& aMinimumAddress,
williamr@2
   120
                                        TInetAddr& aMaximumAddress) const;
williamr@2
   121
    
williamr@2
   122
    /**
williamr@2
   123
    * Gets an IP address from resources.
williamr@2
   124
    * @param aResourceReader  Reference to a resource reader associated to the
williamr@2
   125
    * @c IP_FIELD resource.
williamr@2
   126
    * @return TInetAddr struct including the address.
williamr@2
   127
    */
williamr@2
   128
	IMPORT_C TInetAddr ReadIPAddress(TResourceReader& aResourceReader);
williamr@2
   129
	
williamr@2
   130
public: // from CCoeControl
williamr@2
   131
williamr@2
   132
	/**
williamr@2
   133
    * From @c CCoeControl. Constructs controls from a resource file.
williamr@2
   134
    * Essential for Dialog/Form construction.
williamr@2
   135
    * @param aResourceReader The resource reader with which to access 
williamr@2
   136
    * @c IP_FIELD_EDITOR
williamr@2
   137
    * resource.
williamr@2
   138
    */
williamr@2
   139
	IMPORT_C void ConstructFromResourceL(TResourceReader& aResourceReader);
williamr@2
   140
	
williamr@2
   141
	/**
williamr@2
   142
    * From @c CCoeControl. Handles key events.
williamr@2
   143
    * Called by framework when a key event occurs.
williamr@2
   144
    * @param aKeyEvent The key event that occured.
williamr@2
   145
	* @param aType The type of key event that occured.
williamr@2
   146
    * @return @c EKeyWasConsumed if the event was processed, 
williamr@2
   147
    * @c EKeyWasNotConsumed if the event was not processed
williamr@2
   148
    */
williamr@2
   149
	IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
williamr@2
   150
	                                     TEventCode aType);
williamr@2
   151
    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);	
williamr@2
   152
private:
williamr@2
   153
    /**
williamr@2
   154
    * From CAknControl
williamr@2
   155
    */
williamr@2
   156
    IMPORT_C void* ExtensionInterface( TUid aInterface );
williamr@2
   157
private: 
williamr@2
   158
   void SplitAddressIntoFields(
williamr@2
   159
                                const TInetAddr& aAddress,
williamr@2
   160
                                TUint8 &aFieldA,
williamr@2
   161
                                TUint8 &aFieldB,
williamr@2
   162
                                TUint8 &aFieldC,
williamr@2
   163
                                TUint8 &aFieldD) const;
williamr@2
   164
	IMPORT_C virtual void CEikMfne_Reserved();
williamr@2
   165
williamr@2
   166
private:
williamr@2
   167
    TInt iSpare;
williamr@2
   168
    TInt iSpare2;
williamr@2
   169
	};
williamr@2
   170
williamr@2
   171
williamr@2
   172
#endif