epoc32/include/mw/aknmfnesettingpage.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/aknmfnesettingpage.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/aknmfnesettingpage.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,980 @@
     1.4 -aknmfnesettingpage.h
     1.5 +/*
     1.6 +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description: 
    1.19 +*     Header file for Setting page implementations for Date, Time, duration 
    1.20 +*       and IP addresses 
    1.21 +*
    1.22 +*/
    1.23 +
    1.24 +
    1.25 +#ifndef __AKNMFNESETTINGPAGE_H__
    1.26 +#define __AKNMFNESETTINGPAGE_H__ 
    1.27 +
    1.28 +#include <eikdef.h>
    1.29 +#include <eikbtgpc.h>
    1.30 +#include <eikmfne.h>
    1.31 +#include <aknipfed.h>
    1.32 +#include <in_sock.h>
    1.33 +#include <aknsettingpage.h>
    1.34 +
    1.35 + 
    1.36 +// FORWARD DECLARATIONS
    1.37 +class CAknButton;
    1.38 + 
    1.39 +/** 
    1.40 + *
    1.41 + * This class is used as the base for the date, time, duration and Ip editor
    1.42 + * setting page types.  It performs all the layout.
    1.43 + *
    1.44 + */
    1.45 +class CAknMfneSettingPage : public CAknSettingPage
    1.46 +{
    1.47 +
    1.48 +public: 
    1.49 +    /**
    1.50 +     * From CCoeControl.     
    1.51 +     * Handles pointer events
    1.52 +     */
    1.53 +    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
    1.54 +    /**
    1.55 +    * Destructor.
    1.56 +    */
    1.57 +    IMPORT_C virtual ~CAknMfneSettingPage();
    1.58 +
    1.59 +protected:
    1.60 +    /**
    1.61 +     * Constructor using purely Setting page resource
    1.62 +     *
    1.63 +     * @param   aResourceId     Setting page resource Id
    1.64 +     */
    1.65 +    IMPORT_C CAknMfneSettingPage(TInt ResourceId );
    1.66 +     /**
    1.67 +     * Constructor that allows separate setting page and editor resources
    1.68 +     * 
    1.69 +     * @param aSettingTitleText Text at top of setting pane ; Externally owned
    1.70 +     * @param aSettingNumber        Number at top left (if present)
    1.71 +     * @param aControlType          Determines the type constructed and how its
    1.72 +     *                              resource is read
    1.73 +     * @param aEditorResourceId Editor resource to use in the setting page 
    1.74 +     *                          (if present)
    1.75 +     */
    1.76 +    IMPORT_C CAknMfneSettingPage(   const TDesC* aSettingTitleText, 
    1.77 +                                TInt aSettingNumber, 
    1.78 +                                TInt aControlType,
    1.79 +                                TInt aEditorResourceId, 
    1.80 +                                TInt aSettingPageResourceId );
    1.81 +
    1.82 +    /**
    1.83 +    *
    1.84 +    * Framework method called when the control needs to be re-laid out
    1.85 +    *
    1.86 +    */
    1.87 +    IMPORT_C virtual void SizeChanged();
    1.88 +    
    1.89 +    /** 
    1.90 +    * Draws the control. Framework method
    1.91 +    */
    1.92 +    IMPORT_C void Draw(const TRect& aRect) const;
    1.93 +
    1.94 +    /**
    1.95 +    * Type-specific access to control
    1.96 +    */
    1.97 +    IMPORT_C CEikMfne* Mfne() const;
    1.98 +
    1.99 +    /**
   1.100 +    * Implementation of of validity framework method for mfnes.
   1.101 +    * Checks if the current focused field in the mfne is valid and sets the 
   1.102 +    * setting page validity accordingly.
   1.103 +    * 
   1.104 +    * This method is called in order for the softkeys to be updated
   1.105 +    */
   1.106 +    IMPORT_C void CheckAndSetDataValidity();
   1.107 +
   1.108 +    /**
   1.109 +    * From MCoeControlObserver:
   1.110 +    * Acts upon changes in the hosted control's state. 
   1.111 +    * 
   1.112 +    * This observer method performs
   1.113 +    *  - Updates the value if EUpdateWhenChanged is the setting page's update
   1.114 +    *    mode
   1.115 +    *  - updates CBA labels depending on the data validity
   1.116 +    *
   1.117 +    * @param    aControl    The control changing its state (not used)
   1.118 +    * @param    aEventType  The type of control event 
   1.119 +    */
   1.120 +    IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl,
   1.121 +                                            TCoeEvent aEventType);
   1.122 +                                            
   1.123 +    /**
   1.124 +    *
   1.125 +    * 2nd stage construction. This creates the editing buttons in 
   1.126 +    * touch enabled builds.
   1.127 +    *
   1.128 +    */
   1.129 +    IMPORT_C virtual void ConstructL();
   1.130 +    
   1.131 +    /**
   1.132 +     * Standard CCoeControl routine to return the number of componentn controls
   1.133 +     *
   1.134 +     * @param	aIndex	index at which to return control
   1.135 +     */
   1.136 +    IMPORT_C TInt CountComponentControls() const;
   1.137 +
   1.138 +    /**
   1.139 +     * Standard CCoeControl routine to return the control at a given index
   1.140 +     *
   1.141 +     * @param	aIndex	index at which to return control
   1.142 +     */ 
   1.143 +    IMPORT_C CCoeControl* ComponentControl(TInt anIndex) const;
   1.144 +                                            
   1.145 +protected:
   1.146 +
   1.147 +    // Buttons for modifying the value of the active MFNE field with stylus.
   1.148 +    // The derived classes which require the buttons, must call this class'
   1.149 +    // ConstructL function in their second phase constructor. This class
   1.150 +    // takes care of the button positioning and functionality.
   1.151 +    CAknButton* iIncreaseValueButton;
   1.152 +    CAknButton* iDecreaseValueButton;
   1.153 +
   1.154 +private:
   1.155 +    /**
   1.156 +    * From CAknControl
   1.157 +    */
   1.158 +    IMPORT_C void* ExtensionInterface( TUid aInterface );
   1.159 +
   1.160 +private:
   1.161 +    // Layout information is stored here and not in the derived classes
   1.162 +    TAknLayoutRect iMfneLayoutRect;
   1.163 +    TAknLayoutRect iHorizontalShadow;
   1.164 +    TAknLayoutRect iVerticalShadow;
   1.165 +    TAknLayoutRect iOutlineFrame;
   1.166 +
   1.167 +    TInt iSpare_1;
   1.168 +
   1.169 +};
   1.170 +
   1.171 +
   1.172 +/** 
   1.173 +*
   1.174 +* This class is used for entering Dates in a "Code" setting page
   1.175 +*
   1.176 +*/
   1.177 +class CAknDateSettingPage : public CAknMfneSettingPage
   1.178 +{
   1.179 +public:
   1.180 +
   1.181 +    /**
   1.182 +     * Constructor using purely Setting page resource
   1.183 +     *
   1.184 +     * @param   aResourceId     Setting page resource Id
   1.185 +     * @param   aDateValue      Reference to a date value set to the initial 
   1.186 +     *                          date
   1.187 +     */
   1.188 +    IMPORT_C CAknDateSettingPage(
   1.189 +        TInt aResourceID, 
   1.190 +        TTime& aDateValue);
   1.191 +
   1.192 +    /**
   1.193 +     * Constructor that allows separate setting page and editor resources
   1.194 +     * 
   1.195 +     * This constructor allows the use of setting page using only the editor 
   1.196 +     * resource. Other combinations are also possible
   1.197 +     *
   1.198 +     * In all cases the number (if supplied i.e. <> 0 ) is used.  
   1.199 +     *
   1.200 +     *      Editor Resource     Setting Page Resource
   1.201 +     *          present             present             Both are used 
   1.202 +     *                                                  (but text 
   1.203 +     *                                                  & number overridden)
   1.204 +     *           = 0                present             Editor resource is used
   1.205 +     *                                                  via SP resource 
   1.206 +     *                                                  (Effectively like the
   1.207 +     *                                                  other constructor)
   1.208 +     *          present             = 0                 Default Avkon SP 
   1.209 +     *                                                  resource if used + this
   1.210 +     *                                                  editor resource
   1.211 +     *           = 0                = 0                 uses default resource
   1.212 +     *                                                  for both SP and editor.
   1.213 +     *                                                  This is OK if:
   1.214 +     *   i) control type is present, 
   1.215 +     *  ii) a default resource exists ( OK for text, integer, date, time, 
   1.216 +     *      duration )
   1.217 +     *
   1.218 +     * Note: The first argument is a TDesC* (rather than TDesC&) because the
   1.219 +     * other constructor cannot initialize such a member without allocation or
   1.220 +     * having an internal dummy buffer.
   1.221 +     * Note that this descriptor must be owned by the client at least until the
   1.222 +     * ExecuteLD().
   1.223 +     *
   1.224 +     * Rules for text and numbers: The rules are the same for both:  
   1.225 +     * (non-zero length) text or number other than 
   1.226 +     * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not
   1.227 +     * override resource (unless that is zero length or 
   1.228 +     * EAknSettingPageNoOrdinalDisplayed).  Note, however, that text or number
   1.229 +     * given via the specific API for setting them, WILL override resource.
   1.230 +     * It is assumed that number from resource is very rare.  Special text is
   1.231 +     * somewhat more likely.
   1.232 +     * 
   1.233 +     * @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY
   1.234 +     * @param aSettingNumber        Number at top left (if present)
   1.235 +     * @param aControlType          Determines the type constructed and how its
   1.236 +     *                              resource is read
   1.237 +     * @param aEditorResourceId Editor resource to use in the setting page 
   1.238 +     *                          (if present)
   1.239 +     * @param aSettingPageResourceId        Setting Page to use (if present)
   1.240 +     * @param aDateValue                reference to date
   1.241 +     */
   1.242 +    IMPORT_C CAknDateSettingPage(   
   1.243 +                                const TDesC* aSettingTitleText, 
   1.244 +                                TInt aSettingNumber, 
   1.245 +                                TInt aControlType,
   1.246 +                                TInt aEditorResourceId, 
   1.247 +                                TInt aSettingPageResourceId,    
   1.248 +                                TTime& aDateValue );
   1.249 +
   1.250 +
   1.251 +    /**
   1.252 +    *
   1.253 +    * 2nd stage construction.  This uses stored values from the conststuctor
   1.254 +    * to allocate the required aggregate objects, and then set the Date value.
   1.255 +    *
   1.256 +    */
   1.257 +    IMPORT_C virtual void ConstructL();
   1.258 +
   1.259 +    /**
   1.260 +     * Type-specific access to the editor 
   1.261 +     *
   1.262 +     * @return the hosted editor
   1.263 +     */
   1.264 +    IMPORT_C CEikDateEditor* DateEditor();
   1.265 +
   1.266 +    /**
   1.267 +    *  From CCoeControl
   1.268 +    */ 
   1.269 +    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
   1.270 +
   1.271 +protected:
   1.272 +    /**
   1.273 +    * Destructor
   1.274 +    */
   1.275 +    IMPORT_C virtual ~CAknDateSettingPage();
   1.276 +
   1.277 +    /**
   1.278 +    * This framework method is called when the editor changes its value and the
   1.279 +    * mode of execution of the setting page is a continuous update mode.
   1.280 +    *
   1.281 +    */
   1.282 +    IMPORT_C virtual void UpdateSettingL();
   1.283 +
   1.284 +    /**
   1.285 +    * Called when the user has accepted the value.
   1.286 +    * The external value is updated once again, in case we were not in
   1.287 +    * continuous update mode. 
   1.288 +    * A specific observer event is generated for the observer to say that the
   1.289 +    * value is accepted.
   1.290 +    */
   1.291 +    IMPORT_C virtual void AcceptSettingL();
   1.292 +
   1.293 +    /**
   1.294 +    * The backup value, stored at construction time, is re-loaded into the 
   1.295 +    * referenced Date. An event is sent to the observer saying that the event
   1.296 +    * was dismissed.
   1.297 +    */
   1.298 +    IMPORT_C virtual void RestoreOriginalSettingL();
   1.299 +    
   1.300 +//
   1.301 +// CoeControl Framework and reserved methods
   1.302 +//
   1.303 +protected:
   1.304 +
   1.305 +/**
   1.306 + * Writes the internal state of the control and its components to aStream.
   1.307 + * Does nothing in release mode.
   1.308 + * Designed to be overidden and base called by subclasses.
   1.309 + *
   1.310 + * @param   aWriteSteam     A connected write stream
   1.311 + */ 
   1.312 +    IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
   1.313 +
   1.314 +private:
   1.315 +/**
   1.316 + *  Reserved method derived from CCoeControl
   1.317 + */
   1.318 +    IMPORT_C virtual void Reserved_2();
   1.319 +
   1.320 +private:
   1.321 +    /**
   1.322 +    * From CAknControl
   1.323 +    */
   1.324 +    IMPORT_C void* ExtensionInterface( TUid aInterface );
   1.325 +
   1.326 +/**
   1.327 + * New reserved methods for CAknSettingPage hierarchy
   1.328 + */ 
   1.329 +private: 
   1.330 +    IMPORT_C virtual void CAknSettingPage_Reserved_1();
   1.331 +    IMPORT_C virtual void CAknSettingPage_Reserved_2();
   1.332 +
   1.333 +private:
   1.334 +    TTime& iDateValue;
   1.335 +    TTime iBackupDateValue;
   1.336 +};
   1.337 +
   1.338 +/** 
   1.339 + *
   1.340 + * This class is used for entering Times in a "Code" setting page
   1.341 + *
   1.342 + */
   1.343 +class CAknTimeSettingPage : public CAknMfneSettingPage
   1.344 +{
   1.345 +public:
   1.346 +    /**
   1.347 +     * Constructor using purely Setting page resource
   1.348 +     *
   1.349 +     * @param   aResourceId     Setting page resource Id
   1.350 +     * @param   aTimeValue      Reference to a time value for the initial time
   1.351 +     */
   1.352 +    IMPORT_C CAknTimeSettingPage(
   1.353 +        TInt aResourceID, 
   1.354 +        TTime& aTimeValue);
   1.355 +
   1.356 +    /**
   1.357 +     * Constructor that allows separate setting page and editor resources
   1.358 +     * 
   1.359 +     * This constructor allows the use of setting page using only the editor 
   1.360 +     * resource.  Other combinations are also possible
   1.361 +     *
   1.362 +     * In all cases the number (if supplied i.e. <> 0 ) is used.  
   1.363 +     *
   1.364 +     *      Editor Resource     Setting Page Resource
   1.365 +     *          present             present             Both are used (but text
   1.366 +     *                                                  & number overridden)
   1.367 +     *           = 0                present             Editor resource is used
   1.368 +     *                                                  via SP resource 
   1.369 +     *                                                  (Effectively like the
   1.370 +     *                                                  other constructor)
   1.371 +     *          present              = 0                Default Avkon SP 
   1.372 +     *                                                  resource if used + this
   1.373 +     *                                                  editor resource
   1.374 +     *           = 0                 = 0                uses default resource
   1.375 +     *                                                  for both SP and editor.
   1.376 +     *                                                  This is OK if:
   1.377 +     *   i) control type is present, 
   1.378 +     *  ii) a default resource exists ( OK for text, integer, 
   1.379 +     *      date, time, duration )
   1.380 +     *
   1.381 +     * Note: The first argument is a TDesC* (rather than TDesC&) because the
   1.382 +     * other constructor cannot initialize such a member without allocation or
   1.383 +     * having an internal dummy buffer.
   1.384 +     * Note that this descriptor must be owned by the client at least until the
   1.385 +     * ExecuteLD().
   1.386 +     *
   1.387 +     * Rules for text and numbers: The rules are the same for both:  
   1.388 +     * (non-zero length) text or number other than 
   1.389 +     * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not
   1.390 +     * override resource (unless that is zero length or 
   1.391 +     * EAknSettingPageNoOrdinalDisplayed).  Note, however, that text or number
   1.392 +     * given via the specific API for setting them, WILL override resource.
   1.393 +     * It is assumed that number from resource is very rare.  Special text is
   1.394 +     * somewhat more likely.
   1.395 +     * 
   1.396 +     * @param aSettingTitleText Text at top of setting pane
   1.397 +     * @param aSettingNumber        Number at top left (if present)
   1.398 +     * @param aControlType          Determines the type constructed and how its
   1.399 +     *                              resource is read
   1.400 +     * @param aEditorResourceId Editor resource to use in the setting page 
   1.401 +     *                          (if present)
   1.402 +     * @param aSettingPageResourceId        Setting Page to use (if present)
   1.403 +     * @param aTimeValue                reference to a time
   1.404 +     */
   1.405 +    IMPORT_C CAknTimeSettingPage(   const TDesC* aSettingTitleText, 
   1.406 +                                TInt aSettingNumber, 
   1.407 +                                TInt aControlType,
   1.408 +                                TInt aEditorResourceId, 
   1.409 +                                TInt aSettingPageResourceId,    
   1.410 +                                TTime& aTimeValue );
   1.411 +
   1.412 +    /**
   1.413 +    * Specific 2nd stage contructor for this type. Construction is performed
   1.414 +    * according to the resources and parameters set in the C++ constructors
   1.415 +    *
   1.416 +    */ 
   1.417 +    IMPORT_C virtual void ConstructL();
   1.418 +
   1.419 +    /**
   1.420 +     * Type-specific access to the editor 
   1.421 +     */
   1.422 +    IMPORT_C CEikTimeEditor* TimeEditor();
   1.423 +
   1.424 +    /**
   1.425 +    *  From CCoeControl
   1.426 +    */ 
   1.427 +    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
   1.428 +
   1.429 +protected:
   1.430 +
   1.431 +    /**
   1.432 +    * Destructor
   1.433 +    */
   1.434 +    IMPORT_C virtual ~CAknTimeSettingPage();
   1.435 +
   1.436 +    /**
   1.437 +    * This framework method is called when the editor changes its value and 
   1.438 +    * the mode of execution of the setting page is a continuous update mode.
   1.439 +    *
   1.440 +    */
   1.441 +    IMPORT_C virtual void UpdateSettingL();
   1.442 +
   1.443 +    /**
   1.444 +    * Called when the user has accepted the value.
   1.445 +    * The external value is updated once again, in case we were not in
   1.446 +    * continuous update mode. 
   1.447 +    * A specific observer event is generated for the observer to say that the
   1.448 +    * value is accepted.
   1.449 +    */
   1.450 +    IMPORT_C virtual void AcceptSettingL();
   1.451 +    /**
   1.452 +    * The backup value, stored at construction time, is re-loaded into the 
   1.453 +    * referenced Date.
   1.454 +    * An event is sent to the observer saying that the event was dismissed.
   1.455 +    */
   1.456 +    IMPORT_C virtual void RestoreOriginalSettingL();
   1.457 +    
   1.458 +//
   1.459 +// CoeControl Framework and reserved methods
   1.460 +//
   1.461 +protected:
   1.462 +
   1.463 +/**
   1.464 + * Writes the internal state of the control and its components to aStream.
   1.465 + * Does nothing in release mode.
   1.466 + * Designed to be overidden and base called by subclasses.
   1.467 + *
   1.468 + * @param   aWriteSteam     A connected write stream
   1.469 + */ 
   1.470 +    IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
   1.471 +
   1.472 +private:
   1.473 +
   1.474 +/**
   1.475 + *  Reserved method derived from CCoeControl
   1.476 + */
   1.477 +    IMPORT_C virtual void Reserved_2();
   1.478 +
   1.479 +private:
   1.480 +    /**
   1.481 +    * From CAknControl
   1.482 +    */
   1.483 +    IMPORT_C void* ExtensionInterface( TUid aInterface );
   1.484 +
   1.485 +/**
   1.486 + * New reserved methods for CAknSettingPage hierarchy
   1.487 + */ 
   1.488 +private: 
   1.489 +    IMPORT_C virtual void CAknSettingPage_Reserved_1();
   1.490 +    IMPORT_C virtual void CAknSettingPage_Reserved_2();
   1.491 +
   1.492 +
   1.493 +private:
   1.494 +    TTime& iTimeValue;
   1.495 +    TTime iBackupTimeValue;
   1.496 +
   1.497 +};
   1.498 +
   1.499 +/** 
   1.500 + *
   1.501 + * This class is used for entering duration in a "Code" setting page
   1.502 + *
   1.503 + */
   1.504 +class CAknDurationSettingPage : public CAknMfneSettingPage
   1.505 +{
   1.506 +public:
   1.507 +    /**
   1.508 +     * Constructor using purely Setting page resource
   1.509 +     *
   1.510 +     * @param   aResourceId     Setting page resource Id
   1.511 +     * @param   aDurationValue      Reference to the maintained duration value
   1.512 +     */
   1.513 +    IMPORT_C CAknDurationSettingPage(
   1.514 +        TInt                    aResourceID, 
   1.515 +        TTimeIntervalSeconds&   aDurationValue);
   1.516 +    /**
   1.517 +     * Constructor that allows separate setting page and editor resources
   1.518 +     * 
   1.519 +     * This constructor allows the use of setting page using only the editor 
   1.520 +     * resource.  Other combinations are also possible
   1.521 +     *
   1.522 +     * In all cases the number (if supplied i.e. <> 0 ) is used.  
   1.523 +     *
   1.524 +     *      Editor Resource     Setting Page Resource
   1.525 +     *          present             present             Both are used 
   1.526 +     *                                                  (but text & number 
   1.527 +     *                                                  overridden)
   1.528 +     *           = 0                    present         Editor resource is used
   1.529 +     *                                                  via SP resource 
   1.530 +     *                                                  (Effectively like the 
   1.531 +     *                                                  other constructor)
   1.532 +     *          present             = 0                 Default Avkon SP 
   1.533 +     *                                                  resource if used + this
   1.534 +     *                                                  editor resource
   1.535 +     *           = 0                    = 0             uses default resource 
   1.536 +     *                                                  for both SP and editor.
   1.537 +     *                                                  This is OK if:
   1.538 +     *   i) control type is present, 
   1.539 +     *  ii) a default resource exists ( OK for text, integer, 
   1.540 +     *      date, time, duration )
   1.541 +     *
   1.542 +     * Note: The first argument is a TDesC* (rather than TDesC&) because the 
   1.543 +     * other constructor cannot initialize such a member without allocation or
   1.544 +     * having an internal dummy buffer.
   1.545 +     * Note that this descriptor must be owned by the client at least until the
   1.546 +     * ExecuteLD().
   1.547 +     *
   1.548 +     * Rules for text and numbers: The rules are the same for both:
   1.549 +     * (non-zero length) text or number other than 
   1.550 +     * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not
   1.551 +     * override resource (unless that is zero length or 
   1.552 +     * EAknSettingPageNoOrdinalDisplayed).  Note, however, that text or number
   1.553 +     * given via the specific API for setting them, WILL override resource.
   1.554 +     * It is assumed that number from resource is very rare.  Special text is
   1.555 +     * somewhat more likely.
   1.556 +     * 
   1.557 +     * @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY
   1.558 +     * @param aSettingNumber        Number at top left (if present)
   1.559 +     * @param aControlType          Determines the type constructed and how its
   1.560 +     *                              resource is read
   1.561 +     * @param aEditorResourceId Editor resource to use in the setting page 
   1.562 +     *                          (if present)
   1.563 +     * @param aSettingPageResourceId        Setting Page to use (if present)
   1.564 +     * @param aDurationValue                reference to a duration
   1.565 +     */
   1.566 +    IMPORT_C CAknDurationSettingPage(   const TDesC* aSettingTitleText, 
   1.567 +                                TInt aSettingNumber, 
   1.568 +                                TInt aControlType,
   1.569 +                                TInt aEditorResourceId, 
   1.570 +                                TInt aSettingPageResourceId,    
   1.571 +                                TTimeIntervalSeconds&   aDurationValue);
   1.572 +
   1.573 +    /**
   1.574 +    * Specific 2nd stage contructor for this type. Construction is performed
   1.575 +    * according to the resources and parameters set in the C++ constructors
   1.576 +    *
   1.577 +    */ 
   1.578 +    IMPORT_C virtual void ConstructL();
   1.579 +    /**
   1.580 +     * Type-specific access to the editor 
   1.581 +     */
   1.582 +    IMPORT_C CEikDurationEditor* DurationEditor();
   1.583 +    /**
   1.584 +     * From CCoeControl.     
   1.585 +     * Handles pointer events
   1.586 +     */
   1.587 +    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
   1.588 +
   1.589 +protected:
   1.590 +    /**
   1.591 +    * Destructor
   1.592 +    */
   1.593 +    IMPORT_C virtual ~CAknDurationSettingPage();
   1.594 +
   1.595 +    /**
   1.596 +    * This framework method is called when the editor changes its value and 
   1.597 +    * the mode of execution of the setting page is a continuous update mode.
   1.598 +    *
   1.599 +    */
   1.600 +    IMPORT_C virtual void UpdateSettingL();
   1.601 +
   1.602 +    /**
   1.603 +    * Called when the user has accepted the value.
   1.604 +    * The external value is updated once again, in case we were not in
   1.605 +    * continuous update mode. 
   1.606 +    * A specific observer event is generated for the observer to say that the
   1.607 +    * value is accepted.
   1.608 +    */
   1.609 +    IMPORT_C virtual void AcceptSettingL();
   1.610 +
   1.611 +    /**
   1.612 +    * The backup value, stored at construction time, is re-loaded into the 
   1.613 +    * referenced Date.
   1.614 +    * An event is sent to the observer saying that the event was dismissed.
   1.615 +    */
   1.616 +    IMPORT_C virtual void RestoreOriginalSettingL();
   1.617 +    
   1.618 +//
   1.619 +// CoeControl Framework and reserved methods
   1.620 +//
   1.621 +protected:
   1.622 +
   1.623 +/**
   1.624 + * Writes the internal state of the control and its components to aStream.
   1.625 + * Does nothing in release mode.
   1.626 + * Designed to be overidden and base called by subclasses.
   1.627 + *
   1.628 + * @param   aWriteSteam     A connected write stream
   1.629 + */ 
   1.630 +    IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
   1.631 +
   1.632 +private:
   1.633 +/**
   1.634 + *  Reserved method derived from CCoeControl
   1.635 + */
   1.636 +    IMPORT_C virtual void Reserved_2();
   1.637 +
   1.638 +private:
   1.639 +    /**
   1.640 +    * From CAknControl
   1.641 +    */
   1.642 +    IMPORT_C void* ExtensionInterface( TUid aInterface );
   1.643 +
   1.644 +/**
   1.645 + * New reserved methods for CAknSettingPage hierarchy
   1.646 + */ 
   1.647 +private: 
   1.648 +    IMPORT_C virtual void CAknSettingPage_Reserved_1();
   1.649 +    IMPORT_C virtual void CAknSettingPage_Reserved_2();
   1.650 +
   1.651 +private:
   1.652 +    TTimeIntervalSeconds& iDurationValue;
   1.653 +    TTimeIntervalSeconds iBackupDurationValue;
   1.654 +};
   1.655 +
   1.656 +
   1.657 +/**
   1.658 +*  Time offset setting page.
   1.659 +*
   1.660 +*  @lib avkon
   1.661 +*  @since 2.0
   1.662 +*/
   1.663 +
   1.664 +class CAknTimeOffsetSettingPage : public CAknMfneSettingPage
   1.665 +{
   1.666 +public:
   1.667 +    /**
   1.668 +     * Constructor using purely Setting page resource
   1.669 +     *
   1.670 +     * @since 2.0
   1.671 +     * @param   aResourceId     Setting page resource Id
   1.672 +     * @param   aTimeOffsetValue        Reference to the maintained 
   1.673 +     *                                  offset value
   1.674 +     */
   1.675 +    IMPORT_C CAknTimeOffsetSettingPage(
   1.676 +        TInt                    aResourceID, 
   1.677 +        TTimeIntervalSeconds&   aTimeOffsetValue);
   1.678 +    /**
   1.679 +     * Constructor that allows separate setting page and editor resources
   1.680 +     * 
   1.681 +     * This constructor allows the use of setting page using only the editor 
   1.682 +     * resource. Other combinations are also possible
   1.683 +     *
   1.684 +     * In all cases the number (if supplied i.e. <> 0 ) is used.  
   1.685 +     *
   1.686 +     *      Editor Resource     Setting Page Resource
   1.687 +     *          present             present             Both are used 
   1.688 +     *                                                  (but text & number 
   1.689 +     *                                                  overridden)
   1.690 +     *           = 0                present             Editor resource is 
   1.691 +     *                                                  used via SP resource 
   1.692 +     *                                                  (Effectively like the 
   1.693 +     *                                                  other constructor)
   1.694 +     *          present             = 0                 Default Avkon SP 
   1.695 +     *                                                  resource if used + 
   1.696 +     *                                                  this editor resource
   1.697 +     *           = 0                = 0                 uses default resource 
   1.698 +     *                                                  for both SP and editor. 
   1.699 +     *                                                  This is OK if:
   1.700 +     * i) control type is present, 
   1.701 +     * ii) a default resource exists ( OK for text, integer, 
   1.702 +     *     date, time, duration )
   1.703 +     *
   1.704 +     * Note: The first argument is a TDesC* (rather than TDesC&) because 
   1.705 +     * the other constructor cannot initialize such a member without allocation
   1.706 +     * or having an internal dummy buffer.
   1.707 +     * Note that this descriptor must be owned by the client at least until the
   1.708 +     * ExecuteLD().
   1.709 +     *
   1.710 +     * Rules for text and numbers: The rules are the same for both:  
   1.711 +     * (non-zero length) text or number other than 
   1.712 +     * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not 
   1.713 +     * override resource (unless that is zero length or 
   1.714 +     * EAknSettingPageNoOrdinalDisplayed).  Note, however, that text or number 
   1.715 +     * given via the specific API for setting them, WILL override resource.
   1.716 +     * It is assumed that number from resource is very rare.  Special text is 
   1.717 +     * somewhat more likely.
   1.718 +     * 
   1.719 +     * @since 2.0
   1.720 +     * @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY
   1.721 +     * @param aSettingNumber        Number at top left (if present)
   1.722 +     * @param aControlType          Determines the type constructed 
   1.723 +     *                              and how its resource is read
   1.724 +     * @param aEditorResourceId Editor resource to use in the setting page 
   1.725 +     *                                 (if present)
   1.726 +     * @param aSettingPageResourceId        Setting Page to use (if present)
   1.727 +     * @param aTimeOffsetValue              reference to time offset
   1.728 +     */
   1.729 +    IMPORT_C CAknTimeOffsetSettingPage( const TDesC* aSettingTitleText, 
   1.730 +                                TInt aSettingNumber, 
   1.731 +                                TInt aControlType,
   1.732 +                                TInt aEditorResourceId, 
   1.733 +                                TInt aSettingPageResourceId,    
   1.734 +                                TTimeIntervalSeconds&   aTimeOffsetValue);
   1.735 +
   1.736 +    /**
   1.737 +    * Specific 2nd stage contructor for this type. Construction is performed
   1.738 +    * according to the resources and parameters set in the C++ constructors
   1.739 +    *
   1.740 +    */ 
   1.741 +    IMPORT_C virtual void ConstructL();
   1.742 +    /**
   1.743 +     * Type-specific access to the editor 
   1.744 +     */
   1.745 +    IMPORT_C CEikTimeOffsetEditor* TimeOffsetEditor();
   1.746 +    /**
   1.747 +    *  From CCoeControl
   1.748 +    */	
   1.749 +    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
   1.750 +
   1.751 +protected:
   1.752 +    /**
   1.753 +    * Destructor
   1.754 +    */
   1.755 +    IMPORT_C virtual ~CAknTimeOffsetSettingPage();
   1.756 +
   1.757 +    /**
   1.758 +    * This framework method is called when the editor changes its 
   1.759 +    * value and the mode of execution of the setting page is a continuous 
   1.760 +    * update mode.
   1.761 +    *
   1.762 +    * @since 2.0
   1.763 +    */
   1.764 +    IMPORT_C virtual void UpdateSettingL();
   1.765 +
   1.766 +    /**
   1.767 +    * Called when the user has accepted the value.
   1.768 +    * The external value is updated once again, in case we were not in
   1.769 +    * continuous update mode. 
   1.770 +    * A specific observer event is generated for the observer to say that the
   1.771 +    * value is accepted.
   1.772 +    *
   1.773 +    * @since 2.0
   1.774 +    */
   1.775 +    IMPORT_C virtual void AcceptSettingL();
   1.776 +
   1.777 +    /**
   1.778 +    * The backup value, stored at construction time, is re-loaded into the 
   1.779 +    * referenced Date.
   1.780 +    * An event is sent to the observer saying that the event was dismissed.
   1.781 +    *
   1.782 +    * @since 2.0
   1.783 +    */
   1.784 +    IMPORT_C virtual void RestoreOriginalSettingL();
   1.785 +    
   1.786 +//
   1.787 +// CoeControl Framework and reserved methods
   1.788 +//
   1.789 +protected:
   1.790 +
   1.791 +/**
   1.792 + * Writes the internal state of the control and its components to aStream.
   1.793 + * Does nothing in release mode.
   1.794 + * Designed to be overidden and base called by subclasses.
   1.795 + *
   1.796 + * @since 2.0
   1.797 + * @param   aWriteSteam     A connected write stream
   1.798 + */ 
   1.799 +    IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
   1.800 +
   1.801 +private:
   1.802 +/**
   1.803 + *  Reserved method derived from CCoeControl
   1.804 + *
   1.805 + * @since 2.0
   1.806 + */
   1.807 +    IMPORT_C virtual void Reserved_2();
   1.808 +
   1.809 +private:
   1.810 +    /**
   1.811 +    * From CAknControl
   1.812 +    */
   1.813 +    IMPORT_C void* ExtensionInterface( TUid aInterface );
   1.814 +
   1.815 +/**
   1.816 + * New reserved methods for CAknSettingPage hierarchy
   1.817 + */ 
   1.818 +private: 
   1.819 +    IMPORT_C virtual void CAknSettingPage_Reserved_1();
   1.820 +    IMPORT_C virtual void CAknSettingPage_Reserved_2();
   1.821 +
   1.822 +private:
   1.823 +    TTimeIntervalSeconds& iTimeOffsetValue;
   1.824 +    TTimeIntervalSeconds iBackupTimeOffsetValue;
   1.825 +
   1.826 +};
   1.827 +/** 
   1.828 + *
   1.829 + * Setting page class for entering an IP Address
   1.830 + *
   1.831 + */
   1.832 +class CAknIpFieldSettingPage : public CAknMfneSettingPage
   1.833 +{
   1.834 +public:
   1.835 +    /**
   1.836 +     * Constructor using purely Setting page resource
   1.837 +     *
   1.838 +     * @param   aResourceId     Setting page resource Id
   1.839 +     * @param   aIpAddress      Reference to the maintained IP address
   1.840 +     */
   1.841 +    IMPORT_C CAknIpFieldSettingPage(
   1.842 +        TInt                    aResourceID, 
   1.843 +        TInetAddr&          aIpAddress);
   1.844 +    /**
   1.845 +     * Constructor that allows separate setting page and editor resources
   1.846 +     * 
   1.847 +     * This constructor allows the use of setting page using only the editor 
   1.848 +     * resource.  Other combinations are also possible
   1.849 +     *
   1.850 +     * In all cases the number (if supplied i.e. <> 0 ) is used.  
   1.851 +     *
   1.852 +     *      Editor Resource     Setting Page Resource
   1.853 +     *          present             present             Both are used (but text
   1.854 +     *                                                  & number overridden)
   1.855 +     *           = 0                    present         Editor resource is 
   1.856 +     *                                                  used via SP resource 
   1.857 +     *                                                  (Effectively like the 
   1.858 +     *                                                  other constructor)
   1.859 +     *          present             = 0                 Default Avkon SP 
   1.860 +     *                                                  resource if used + this
   1.861 +     *                                                  editor resource
   1.862 +     *           = 0                    = 0             uses default resource 
   1.863 +     *                                                  for both SP and editor. 
   1.864 +     *                                                  This is OK if:
   1.865 +     *   i) control type is present, 
   1.866 +     *  ii) a default resource exists ( OK for text, integer, 
   1.867 +     *      date, time, duration )
   1.868 +     *
   1.869 +     * Note: The first argument is a TDesC* (rather than TDesC&) because the 
   1.870 +     * other constructor cannot initialize such a member without allocation 
   1.871 +     * or having an internal dummy buffer.
   1.872 +     * Note that this descriptor must be owned by the client at least until 
   1.873 +     * the ExecuteLD().
   1.874 +     *
   1.875 +     * Rules for text and numbers: The rules are the same for both: 
   1.876 +     * (non-zero length) text or number other than 
   1.877 +     * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not 
   1.878 +     * override resource (unless that is zero length or 
   1.879 +     * EAknSettingPageNoOrdinalDisplayed).  Note, however, that text or number 
   1.880 +     * given via the specific API for setting them, WILL override resource.
   1.881 +     * It is assumed that number from resource is very rare. Special text is 
   1.882 +     * somewhat more likely.
   1.883 +     * 
   1.884 +     * @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY
   1.885 +     * @param aSettingNumber        Number at top left (if present)
   1.886 +     * @param aControlType          Determines the type constructed and how its 
   1.887 +     *                              resource is read
   1.888 +     * @param aEditorResourceId Editor resource to use in the setting page 
   1.889 +     *                          (if present)
   1.890 +     * @param aSettingPageResourceId        Setting Page to use (if present)
   1.891 +     * @param aIpAddress                reference to a duration
   1.892 +     */
   1.893 +    IMPORT_C CAknIpFieldSettingPage(    const TDesC* aSettingTitleText, 
   1.894 +                                TInt aSettingNumber, 
   1.895 +                                TInt aControlType,
   1.896 +                                TInt aEditorResourceId, 
   1.897 +                                TInt aSettingPageResourceId,    
   1.898 +                                TInetAddr&  aIpAddress);
   1.899 +
   1.900 +    /**
   1.901 +    * Specific 2nd stage contructor for this type. Construction is performed
   1.902 +    * according to the resources and parameters set in the C++ constructors
   1.903 +    *
   1.904 +    */ 
   1.905 +    IMPORT_C virtual void ConstructL();
   1.906 +    /**
   1.907 +     * Type-specific access to the editor 
   1.908 +     */
   1.909 +    IMPORT_C CAknIpFieldEditor* IpFieldEditor();
   1.910 +
   1.911 +    /**
   1.912 +    *  From CCoeControl
   1.913 +    */	 
   1.914 +    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
   1.915 +
   1.916 +protected:
   1.917 +    /**
   1.918 +    * Destructor
   1.919 +    */
   1.920 +    IMPORT_C virtual ~CAknIpFieldSettingPage();
   1.921 +
   1.922 +    /**
   1.923 +    * This framework method is called when the editor changes its value and 
   1.924 +    * the mode of execution of the setting page is a continuous update mode.
   1.925 +    *
   1.926 +    */
   1.927 +    IMPORT_C virtual void UpdateSettingL();
   1.928 +
   1.929 +    /**
   1.930 +    * Called when the user has accepted the value.
   1.931 +    * The external value is updated once again, in case we were not in
   1.932 +    * continuous update mode. 
   1.933 +    * A specific observer  event is generated for the observer to say that the
   1.934 +    * value is accepted.
   1.935 +    */
   1.936 +    IMPORT_C virtual void AcceptSettingL();
   1.937 +
   1.938 +    /**
   1.939 +    * The backup value, stored at construction time, is re-loaded into 
   1.940 +    * the referenced Date.
   1.941 +    * An event is sent to the observer saying that the event was dismissed.
   1.942 +    */
   1.943 +    IMPORT_C virtual void RestoreOriginalSettingL();
   1.944 +
   1.945 +//
   1.946 +// CoeControl Framework and reserved methods
   1.947 +//
   1.948 +protected:
   1.949 +
   1.950 +/**
   1.951 + * Writes the internal state of the control and its components to aStream.
   1.952 + * Does nothing in release mode.
   1.953 + * Designed to be overidden and base called by subclasses.
   1.954 + *
   1.955 + * @param   aWriteSteam     A connected write stream
   1.956 + */ 
   1.957 +    IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const;
   1.958 +
   1.959 +private:
   1.960 +    
   1.961 +/**
   1.962 + *  Reserved method derived from CCoeControl
   1.963 + */
   1.964 +    IMPORT_C virtual void Reserved_2();
   1.965 +
   1.966 +private:
   1.967 +    /**
   1.968 +    * From CAknControl
   1.969 +    */
   1.970 +    IMPORT_C void* ExtensionInterface( TUid aInterface );
   1.971 +
   1.972 +/**
   1.973 + * New reserved methods for CAknSettingPage hierarchy
   1.974 + */ 
   1.975 +private: 
   1.976 +    IMPORT_C virtual void CAknSettingPage_Reserved_1();
   1.977 +    IMPORT_C virtual void CAknSettingPage_Reserved_2();
   1.978 +    
   1.979 +private:
   1.980 +    TInetAddr& iIpAddress;
   1.981 +    TInetAddr iBackupIpAddress; // Not a reference
   1.982 +
   1.983 +    };
   1.984 +#endif