45
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2006 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: The CAknIpFieldEditor class implements an editor for an
|
|
15 |
* IP address.
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
|
|
20 |
#if !defined(__AKNIPFED_H_)
|
|
21 |
#define __AKNIPFED_H_
|
|
22 |
|
|
23 |
// INCLUDES
|
|
24 |
#include <eikmfne.h>
|
|
25 |
|
|
26 |
// FORWARD DECLERATIONS
|
|
27 |
class TInetAddr;
|
|
28 |
|
|
29 |
//CLASS DECLERATION
|
|
30 |
/**
|
|
31 |
* The @c CAknIpFieldEditor class implements an editor for an IP address.
|
|
32 |
* Based on Crystal @c CCknIpFieldEditor.
|
|
33 |
*
|
|
34 |
* @since Series 60 0.9
|
|
35 |
*/
|
|
36 |
class CAknIpFieldEditor : public CEikMfne
|
|
37 |
{
|
|
38 |
public: // public constructors
|
|
39 |
|
|
40 |
/**
|
|
41 |
* C++ default constructor.
|
|
42 |
*/
|
|
43 |
IMPORT_C CAknIpFieldEditor();
|
|
44 |
|
|
45 |
/**
|
|
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.
|
|
55 |
*/
|
|
56 |
void ConstructL(TInetAddr& aMinimumAddress,
|
|
57 |
TInetAddr& aMaximumAddress,
|
|
58 |
TInetAddr& aInitialAddress,
|
|
59 |
const TInt aFlags=0);
|
|
60 |
|
|
61 |
/**
|
|
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.
|
|
71 |
*/
|
|
72 |
IMPORT_C static CAknIpFieldEditor* NewL(TInetAddr& aMinimumAddress,
|
|
73 |
TInetAddr& aMaximumAddress,
|
|
74 |
TInetAddr& aInitialAddress);
|
|
75 |
|
|
76 |
/**
|
|
77 |
* Two phased constructor.
|
|
78 |
* Requires a call for @c ConstructFromResourcesL() method to finish
|
|
79 |
* construction.
|
|
80 |
* @return Pointer to the constructed @c CAknIpFieldEditor object.
|
|
81 |
*/
|
|
82 |
IMPORT_C static CAknIpFieldEditor* NewL();
|
|
83 |
|
|
84 |
public: // Methods for getting and setting values
|
|
85 |
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Sets the editor's value dynamically.
|
|
89 |
* @param aAddress Reference to a @c TInetAddr struct including the new
|
|
90 |
* address.
|
|
91 |
*/
|
|
92 |
IMPORT_C void SetAddress(const TInetAddr& aAddress);
|
|
93 |
|
|
94 |
/**
|
|
95 |
* Gets the editor's value.
|
|
96 |
* @return TInetAddr struct including the address.
|
|
97 |
*/
|
|
98 |
IMPORT_C TInetAddr Address() const;
|
|
99 |
|
|
100 |
/**
|
|
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.
|
|
106 |
*/
|
|
107 |
IMPORT_C virtual void SetMinimumAndMaximum(
|
|
108 |
const TInetAddr& aMinimumAddress,
|
|
109 |
const TInetAddr& aMaximumAddress); // only values inside the initial minimum and maximum are permitted
|
|
110 |
|
|
111 |
/**
|
|
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.
|
|
117 |
*/
|
|
118 |
IMPORT_C virtual void GetMinimumAndMaximum(
|
|
119 |
TInetAddr& aMinimumAddress,
|
|
120 |
TInetAddr& aMaximumAddress) const;
|
|
121 |
|
|
122 |
/**
|
|
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.
|
|
127 |
*/
|
|
128 |
IMPORT_C TInetAddr ReadIPAddress(TResourceReader& aResourceReader);
|
|
129 |
|
|
130 |
public: // from CCoeControl
|
|
131 |
|
|
132 |
/**
|
|
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
|
|
136 |
* @c IP_FIELD_EDITOR
|
|
137 |
* resource.
|
|
138 |
*/
|
|
139 |
IMPORT_C void ConstructFromResourceL(TResourceReader& aResourceReader);
|
|
140 |
|
|
141 |
/**
|
|
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
|
|
148 |
*/
|
|
149 |
IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
|
|
150 |
TEventCode aType);
|
|
151 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
|
152 |
private:
|
|
153 |
/**
|
|
154 |
* From CAknControl
|
|
155 |
*/
|
|
156 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
|
157 |
private:
|
|
158 |
void SplitAddressIntoFields(
|
|
159 |
const TInetAddr& aAddress,
|
|
160 |
TUint8 &aFieldA,
|
|
161 |
TUint8 &aFieldB,
|
|
162 |
TUint8 &aFieldC,
|
|
163 |
TUint8 &aFieldD) const;
|
|
164 |
IMPORT_C virtual void CEikMfne_Reserved();
|
|
165 |
|
|
166 |
private:
|
|
167 |
TInt iSpare;
|
|
168 |
TInt iSpare2;
|
|
169 |
};
|
|
170 |
|
|
171 |
|
|
172 |
#endif
|