2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: The CAknIpFieldEditor class implements an editor for an
20 #if !defined(__AKNIPFED_H_)
26 // FORWARD DECLERATIONS
31 * The @c CAknIpFieldEditor class implements an editor for an IP address.
32 * Based on Crystal @c CCknIpFieldEditor.
34 * @since Series 60 0.9
36 class CAknIpFieldEditor : public CEikMfne
38 public: // public constructors
41 * C++ default constructor.
43 IMPORT_C CAknIpFieldEditor();
46 * Two phased constructor.
47 * @param aMinimumAddress Reference to a @c TInetAddr struct. Defines lower
48 * limits for IP editor fields.
49 * @param aMaximumAddress Reference to a @c TInetAddr struct. Defines upper
50 * limits for IP editor fields.
51 * @param aInitialAddress Reference to a @c TInetAddr struct. Defines the
52 * initial address of the IP editor.
53 * @param aFlags The number field's flags. Default is 0.
54 * @return Pointer to the fully constructed @c CAknIpFieldEditor object.
56 void ConstructL(TInetAddr& aMinimumAddress,
57 TInetAddr& aMaximumAddress,
58 TInetAddr& aInitialAddress,
62 * Two phased constructor.
63 * Constructs a CAknIpFieldEditor object using given parameters.
64 * @param aMinimumAddress Reference to a @c TInetAddr struct. Defines lower
65 * limits for IP editor fields.
66 * @param aMaximumAddress Reference to a @c TInetAddr struct. Defines upper
67 * limits for IP editor fields.
68 * @param aInitialAddress Reference to a @c TInetAddr struct. Defines the
69 * initial address of the IP editor.
70 * @return Pointer to the fully constructed @c CAknIpFieldEditor object.
72 IMPORT_C static CAknIpFieldEditor* NewL(TInetAddr& aMinimumAddress,
73 TInetAddr& aMaximumAddress,
74 TInetAddr& aInitialAddress);
77 * Two phased constructor.
78 * Requires a call for @c ConstructFromResourcesL() method to finish
80 * @return Pointer to the constructed @c CAknIpFieldEditor object.
82 IMPORT_C static CAknIpFieldEditor* NewL();
84 public: // Methods for getting and setting values
88 * Sets the editor's value dynamically.
89 * @param aAddress Reference to a @c TInetAddr struct including the new
92 IMPORT_C void SetAddress(const TInetAddr& aAddress);
95 * Gets the editor's value.
96 * @return TInetAddr struct including the address.
98 IMPORT_C TInetAddr Address() const;
101 * Sets the minimum and maximum editor values.
102 * @param aMinimumAddress Reference to a @c TInetAddr struct defining the
103 * lower limits of the editor fields.
104 * @param aMaximumAddress Reference to a @c TInetAddr struct defining the
105 * upper limits of the editor fields.
107 IMPORT_C virtual void SetMinimumAndMaximum(
108 const TInetAddr& aMinimumAddress,
109 const TInetAddr& aMaximumAddress); // only values inside the initial minimum and maximum are permitted
112 * Gets the minimum and maximum editor values.
113 * @param aMinimumAddress Reference to a @c TInetAddr struct in which the
114 * lower limits are wanted to be returned.
115 * @param aMaximumAddress Reference to a @c TInetAddr struct in which the
116 * upper limits are wanted to be returned.
118 IMPORT_C virtual void GetMinimumAndMaximum(
119 TInetAddr& aMinimumAddress,
120 TInetAddr& aMaximumAddress) const;
123 * Gets an IP address from resources.
124 * @param aResourceReader Reference to a resource reader associated to the
125 * @c IP_FIELD resource.
126 * @return TInetAddr struct including the address.
128 IMPORT_C TInetAddr ReadIPAddress(TResourceReader& aResourceReader);
130 public: // from CCoeControl
133 * From @c CCoeControl. Constructs controls from a resource file.
134 * Essential for Dialog/Form construction.
135 * @param aResourceReader The resource reader with which to access
139 IMPORT_C void ConstructFromResourceL(TResourceReader& aResourceReader);
142 * From @c CCoeControl. Handles key events.
143 * Called by framework when a key event occurs.
144 * @param aKeyEvent The key event that occured.
145 * @param aType The type of key event that occured.
146 * @return @c EKeyWasConsumed if the event was processed,
147 * @c EKeyWasNotConsumed if the event was not processed
149 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
151 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
156 IMPORT_C void* ExtensionInterface( TUid aInterface );
158 void SplitAddressIntoFields(
159 const TInetAddr& aAddress,
163 TUint8 &aFieldD) const;
164 IMPORT_C virtual void CEikMfne_Reserved();