williamr@2: /* williamr@2: * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * Header file for Setting page implementations for Date, Time, duration williamr@2: * and IP addresses williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef __AKNMFNESETTINGPAGE_H__ williamr@2: #define __AKNMFNESETTINGPAGE_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CAknButton; williamr@2: williamr@2: /** williamr@2: * williamr@2: * This class is used as the base for the date, time, duration and Ip editor williamr@2: * setting page types. It performs all the layout. williamr@2: * williamr@2: */ williamr@2: class CAknMfneSettingPage : public CAknSettingPage williamr@2: { williamr@2: williamr@2: public: williamr@2: /** williamr@2: * From CCoeControl. williamr@2: * Handles pointer events williamr@2: */ williamr@2: IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~CAknMfneSettingPage(); williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * Constructor using purely Setting page resource williamr@2: * williamr@2: * @param aResourceId Setting page resource Id williamr@2: */ williamr@2: IMPORT_C CAknMfneSettingPage(TInt ResourceId ); williamr@2: /** williamr@2: * Constructor that allows separate setting page and editor resources williamr@2: * williamr@2: * @param aSettingTitleText Text at top of setting pane ; Externally owned williamr@2: * @param aSettingNumber Number at top left (if present) williamr@2: * @param aControlType Determines the type constructed and how its williamr@2: * resource is read williamr@2: * @param aEditorResourceId Editor resource to use in the setting page williamr@2: * (if present) williamr@2: */ williamr@2: IMPORT_C CAknMfneSettingPage( const TDesC* aSettingTitleText, williamr@2: TInt aSettingNumber, williamr@2: TInt aControlType, williamr@2: TInt aEditorResourceId, williamr@2: TInt aSettingPageResourceId ); williamr@2: williamr@2: /** williamr@2: * williamr@2: * Framework method called when the control needs to be re-laid out williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void SizeChanged(); williamr@2: williamr@2: /** williamr@2: * Draws the control. Framework method williamr@2: */ williamr@2: IMPORT_C void Draw(const TRect& aRect) const; williamr@2: williamr@2: /** williamr@2: * Type-specific access to control williamr@2: */ williamr@2: IMPORT_C CEikMfne* Mfne() const; williamr@2: williamr@2: /** williamr@2: * Implementation of of validity framework method for mfnes. williamr@2: * Checks if the current focused field in the mfne is valid and sets the williamr@2: * setting page validity accordingly. williamr@2: * williamr@2: * This method is called in order for the softkeys to be updated williamr@2: */ williamr@2: IMPORT_C void CheckAndSetDataValidity(); williamr@2: williamr@2: /** williamr@2: * From MCoeControlObserver: williamr@2: * Acts upon changes in the hosted control's state. williamr@2: * williamr@2: * This observer method performs williamr@2: * - Updates the value if EUpdateWhenChanged is the setting page's update williamr@2: * mode williamr@2: * - updates CBA labels depending on the data validity williamr@2: * williamr@2: * @param aControl The control changing its state (not used) williamr@2: * @param aEventType The type of control event williamr@2: */ williamr@2: IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl, williamr@2: TCoeEvent aEventType); williamr@2: williamr@2: /** williamr@2: * williamr@2: * 2nd stage construction. This creates the editing buttons in williamr@2: * touch enabled builds. williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void ConstructL(); williamr@2: williamr@2: /** williamr@2: * Standard CCoeControl routine to return the number of componentn controls williamr@2: * williamr@2: * @param aIndex index at which to return control williamr@2: */ williamr@2: IMPORT_C TInt CountComponentControls() const; williamr@2: williamr@2: /** williamr@2: * Standard CCoeControl routine to return the control at a given index williamr@2: * williamr@2: * @param aIndex index at which to return control williamr@2: */ williamr@2: IMPORT_C CCoeControl* ComponentControl(TInt anIndex) const; williamr@2: williamr@2: protected: williamr@2: williamr@2: // Buttons for modifying the value of the active MFNE field with stylus. williamr@2: // The derived classes which require the buttons, must call this class' williamr@2: // ConstructL function in their second phase constructor. This class williamr@2: // takes care of the button positioning and functionality. williamr@2: CAknButton* iIncreaseValueButton; williamr@2: CAknButton* iDecreaseValueButton; williamr@2: williamr@2: private: williamr@2: /** williamr@2: * From CAknControl williamr@2: */ williamr@2: IMPORT_C void* ExtensionInterface( TUid aInterface ); williamr@2: williamr@2: private: williamr@2: // Layout information is stored here and not in the derived classes williamr@2: TAknLayoutRect iMfneLayoutRect; williamr@2: TAknLayoutRect iHorizontalShadow; williamr@2: TAknLayoutRect iVerticalShadow; williamr@2: TAknLayoutRect iOutlineFrame; williamr@2: williamr@2: TInt iSpare_1; williamr@2: williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: * williamr@2: * This class is used for entering Dates in a "Code" setting page williamr@2: * williamr@2: */ williamr@2: class CAknDateSettingPage : public CAknMfneSettingPage williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Constructor using purely Setting page resource williamr@2: * williamr@2: * @param aResourceId Setting page resource Id williamr@2: * @param aDateValue Reference to a date value set to the initial williamr@2: * date williamr@2: */ williamr@2: IMPORT_C CAknDateSettingPage( williamr@2: TInt aResourceID, williamr@2: TTime& aDateValue); williamr@2: williamr@2: /** williamr@2: * Constructor that allows separate setting page and editor resources williamr@2: * williamr@2: * This constructor allows the use of setting page using only the editor williamr@2: * resource. Other combinations are also possible williamr@2: * williamr@2: * In all cases the number (if supplied i.e. <> 0 ) is used. williamr@2: * williamr@2: * Editor Resource Setting Page Resource williamr@2: * present present Both are used williamr@2: * (but text williamr@2: * & number overridden) williamr@2: * = 0 present Editor resource is used williamr@2: * via SP resource williamr@2: * (Effectively like the williamr@2: * other constructor) williamr@2: * present = 0 Default Avkon SP williamr@2: * resource if used + this williamr@2: * editor resource williamr@2: * = 0 = 0 uses default resource williamr@2: * for both SP and editor. williamr@2: * This is OK if: williamr@2: * i) control type is present, williamr@2: * ii) a default resource exists ( OK for text, integer, date, time, williamr@2: * duration ) williamr@2: * williamr@2: * Note: The first argument is a TDesC* (rather than TDesC&) because the williamr@2: * other constructor cannot initialize such a member without allocation or williamr@2: * having an internal dummy buffer. williamr@2: * Note that this descriptor must be owned by the client at least until the williamr@2: * ExecuteLD(). williamr@2: * williamr@2: * Rules for text and numbers: The rules are the same for both: williamr@2: * (non-zero length) text or number other than williamr@2: * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not williamr@2: * override resource (unless that is zero length or williamr@2: * EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number williamr@2: * given via the specific API for setting them, WILL override resource. williamr@2: * It is assumed that number from resource is very rare. Special text is williamr@2: * somewhat more likely. williamr@2: * williamr@2: * @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY williamr@2: * @param aSettingNumber Number at top left (if present) williamr@2: * @param aControlType Determines the type constructed and how its williamr@2: * resource is read williamr@2: * @param aEditorResourceId Editor resource to use in the setting page williamr@2: * (if present) williamr@2: * @param aSettingPageResourceId Setting Page to use (if present) williamr@2: * @param aDateValue reference to date williamr@2: */ williamr@2: IMPORT_C CAknDateSettingPage( williamr@2: const TDesC* aSettingTitleText, williamr@2: TInt aSettingNumber, williamr@2: TInt aControlType, williamr@2: TInt aEditorResourceId, williamr@2: TInt aSettingPageResourceId, williamr@2: TTime& aDateValue ); williamr@2: williamr@2: williamr@2: /** williamr@2: * williamr@2: * 2nd stage construction. This uses stored values from the conststuctor williamr@2: * to allocate the required aggregate objects, and then set the Date value. williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void ConstructL(); williamr@2: williamr@2: /** williamr@2: * Type-specific access to the editor williamr@2: * williamr@2: * @return the hosted editor williamr@2: */ williamr@2: IMPORT_C CEikDateEditor* DateEditor(); williamr@2: williamr@2: /** williamr@2: * From CCoeControl williamr@2: */ williamr@2: IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C virtual ~CAknDateSettingPage(); williamr@2: williamr@2: /** williamr@2: * This framework method is called when the editor changes its value and the williamr@2: * mode of execution of the setting page is a continuous update mode. williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void UpdateSettingL(); williamr@2: williamr@2: /** williamr@2: * Called when the user has accepted the value. williamr@2: * The external value is updated once again, in case we were not in williamr@2: * continuous update mode. williamr@2: * A specific observer event is generated for the observer to say that the williamr@2: * value is accepted. williamr@2: */ williamr@2: IMPORT_C virtual void AcceptSettingL(); williamr@2: williamr@2: /** williamr@2: * The backup value, stored at construction time, is re-loaded into the williamr@2: * referenced Date. An event is sent to the observer saying that the event williamr@2: * was dismissed. williamr@2: */ williamr@2: IMPORT_C virtual void RestoreOriginalSettingL(); williamr@2: williamr@2: // williamr@2: // CoeControl Framework and reserved methods williamr@2: // williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * Writes the internal state of the control and its components to aStream. williamr@2: * Does nothing in release mode. williamr@2: * Designed to be overidden and base called by subclasses. williamr@2: * williamr@2: * @param aWriteSteam A connected write stream williamr@2: */ williamr@2: IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; williamr@2: williamr@2: private: williamr@2: /** williamr@2: * Reserved method derived from CCoeControl williamr@2: */ williamr@2: IMPORT_C virtual void Reserved_2(); williamr@2: williamr@2: private: williamr@2: /** williamr@2: * From CAknControl williamr@2: */ williamr@2: IMPORT_C void* ExtensionInterface( TUid aInterface ); williamr@2: williamr@2: /** williamr@2: * New reserved methods for CAknSettingPage hierarchy williamr@2: */ williamr@2: private: williamr@2: IMPORT_C virtual void CAknSettingPage_Reserved_1(); williamr@2: IMPORT_C virtual void CAknSettingPage_Reserved_2(); williamr@2: williamr@2: private: williamr@2: TTime& iDateValue; williamr@2: TTime iBackupDateValue; williamr@2: }; williamr@2: williamr@2: /** williamr@2: * williamr@2: * This class is used for entering Times in a "Code" setting page williamr@2: * williamr@2: */ williamr@2: class CAknTimeSettingPage : public CAknMfneSettingPage williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Constructor using purely Setting page resource williamr@2: * williamr@2: * @param aResourceId Setting page resource Id williamr@2: * @param aTimeValue Reference to a time value for the initial time williamr@2: */ williamr@2: IMPORT_C CAknTimeSettingPage( williamr@2: TInt aResourceID, williamr@2: TTime& aTimeValue); williamr@2: williamr@2: /** williamr@2: * Constructor that allows separate setting page and editor resources williamr@2: * williamr@2: * This constructor allows the use of setting page using only the editor williamr@2: * resource. Other combinations are also possible williamr@2: * williamr@2: * In all cases the number (if supplied i.e. <> 0 ) is used. williamr@2: * williamr@2: * Editor Resource Setting Page Resource williamr@2: * present present Both are used (but text williamr@2: * & number overridden) williamr@2: * = 0 present Editor resource is used williamr@2: * via SP resource williamr@2: * (Effectively like the williamr@2: * other constructor) williamr@2: * present = 0 Default Avkon SP williamr@2: * resource if used + this williamr@2: * editor resource williamr@2: * = 0 = 0 uses default resource williamr@2: * for both SP and editor. williamr@2: * This is OK if: williamr@2: * i) control type is present, williamr@2: * ii) a default resource exists ( OK for text, integer, williamr@2: * date, time, duration ) williamr@2: * williamr@2: * Note: The first argument is a TDesC* (rather than TDesC&) because the williamr@2: * other constructor cannot initialize such a member without allocation or williamr@2: * having an internal dummy buffer. williamr@2: * Note that this descriptor must be owned by the client at least until the williamr@2: * ExecuteLD(). williamr@2: * williamr@2: * Rules for text and numbers: The rules are the same for both: williamr@2: * (non-zero length) text or number other than williamr@2: * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not williamr@2: * override resource (unless that is zero length or williamr@2: * EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number williamr@2: * given via the specific API for setting them, WILL override resource. williamr@2: * It is assumed that number from resource is very rare. Special text is williamr@2: * somewhat more likely. williamr@2: * williamr@2: * @param aSettingTitleText Text at top of setting pane williamr@2: * @param aSettingNumber Number at top left (if present) williamr@2: * @param aControlType Determines the type constructed and how its williamr@2: * resource is read williamr@2: * @param aEditorResourceId Editor resource to use in the setting page williamr@2: * (if present) williamr@2: * @param aSettingPageResourceId Setting Page to use (if present) williamr@2: * @param aTimeValue reference to a time williamr@2: */ williamr@2: IMPORT_C CAknTimeSettingPage( const TDesC* aSettingTitleText, williamr@2: TInt aSettingNumber, williamr@2: TInt aControlType, williamr@2: TInt aEditorResourceId, williamr@2: TInt aSettingPageResourceId, williamr@2: TTime& aTimeValue ); williamr@2: williamr@2: /** williamr@2: * Specific 2nd stage contructor for this type. Construction is performed williamr@2: * according to the resources and parameters set in the C++ constructors williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void ConstructL(); williamr@2: williamr@2: /** williamr@2: * Type-specific access to the editor williamr@2: */ williamr@2: IMPORT_C CEikTimeEditor* TimeEditor(); williamr@2: williamr@2: /** williamr@2: * From CCoeControl williamr@2: */ williamr@2: IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); williamr@2: williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C virtual ~CAknTimeSettingPage(); williamr@2: williamr@2: /** williamr@2: * This framework method is called when the editor changes its value and williamr@2: * the mode of execution of the setting page is a continuous update mode. williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void UpdateSettingL(); williamr@2: williamr@2: /** williamr@2: * Called when the user has accepted the value. williamr@2: * The external value is updated once again, in case we were not in williamr@2: * continuous update mode. williamr@2: * A specific observer event is generated for the observer to say that the williamr@2: * value is accepted. williamr@2: */ williamr@2: IMPORT_C virtual void AcceptSettingL(); williamr@2: /** williamr@2: * The backup value, stored at construction time, is re-loaded into the williamr@2: * referenced Date. williamr@2: * An event is sent to the observer saying that the event was dismissed. williamr@2: */ williamr@2: IMPORT_C virtual void RestoreOriginalSettingL(); williamr@2: williamr@2: // williamr@2: // CoeControl Framework and reserved methods williamr@2: // williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * Writes the internal state of the control and its components to aStream. williamr@2: * Does nothing in release mode. williamr@2: * Designed to be overidden and base called by subclasses. williamr@2: * williamr@2: * @param aWriteSteam A connected write stream williamr@2: */ williamr@2: IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; williamr@2: williamr@2: private: williamr@2: williamr@2: /** williamr@2: * Reserved method derived from CCoeControl williamr@2: */ williamr@2: IMPORT_C virtual void Reserved_2(); williamr@2: williamr@2: private: williamr@2: /** williamr@2: * From CAknControl williamr@2: */ williamr@2: IMPORT_C void* ExtensionInterface( TUid aInterface ); williamr@2: williamr@2: /** williamr@2: * New reserved methods for CAknSettingPage hierarchy williamr@2: */ williamr@2: private: williamr@2: IMPORT_C virtual void CAknSettingPage_Reserved_1(); williamr@2: IMPORT_C virtual void CAknSettingPage_Reserved_2(); williamr@2: williamr@2: williamr@2: private: williamr@2: TTime& iTimeValue; williamr@2: TTime iBackupTimeValue; williamr@2: williamr@2: }; williamr@2: williamr@2: /** williamr@2: * williamr@2: * This class is used for entering duration in a "Code" setting page williamr@2: * williamr@2: */ williamr@2: class CAknDurationSettingPage : public CAknMfneSettingPage williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Constructor using purely Setting page resource williamr@2: * williamr@2: * @param aResourceId Setting page resource Id williamr@2: * @param aDurationValue Reference to the maintained duration value williamr@2: */ williamr@2: IMPORT_C CAknDurationSettingPage( williamr@2: TInt aResourceID, williamr@2: TTimeIntervalSeconds& aDurationValue); williamr@2: /** williamr@2: * Constructor that allows separate setting page and editor resources williamr@2: * williamr@2: * This constructor allows the use of setting page using only the editor williamr@2: * resource. Other combinations are also possible williamr@2: * williamr@2: * In all cases the number (if supplied i.e. <> 0 ) is used. williamr@2: * williamr@2: * Editor Resource Setting Page Resource williamr@2: * present present Both are used williamr@2: * (but text & number williamr@2: * overridden) williamr@2: * = 0 present Editor resource is used williamr@2: * via SP resource williamr@2: * (Effectively like the williamr@2: * other constructor) williamr@2: * present = 0 Default Avkon SP williamr@2: * resource if used + this williamr@2: * editor resource williamr@2: * = 0 = 0 uses default resource williamr@2: * for both SP and editor. williamr@2: * This is OK if: williamr@2: * i) control type is present, williamr@2: * ii) a default resource exists ( OK for text, integer, williamr@2: * date, time, duration ) williamr@2: * williamr@2: * Note: The first argument is a TDesC* (rather than TDesC&) because the williamr@2: * other constructor cannot initialize such a member without allocation or williamr@2: * having an internal dummy buffer. williamr@2: * Note that this descriptor must be owned by the client at least until the williamr@2: * ExecuteLD(). williamr@2: * williamr@2: * Rules for text and numbers: The rules are the same for both: williamr@2: * (non-zero length) text or number other than williamr@2: * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not williamr@2: * override resource (unless that is zero length or williamr@2: * EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number williamr@2: * given via the specific API for setting them, WILL override resource. williamr@2: * It is assumed that number from resource is very rare. Special text is williamr@2: * somewhat more likely. williamr@2: * williamr@2: * @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY williamr@2: * @param aSettingNumber Number at top left (if present) williamr@2: * @param aControlType Determines the type constructed and how its williamr@2: * resource is read williamr@2: * @param aEditorResourceId Editor resource to use in the setting page williamr@2: * (if present) williamr@2: * @param aSettingPageResourceId Setting Page to use (if present) williamr@2: * @param aDurationValue reference to a duration williamr@2: */ williamr@2: IMPORT_C CAknDurationSettingPage( const TDesC* aSettingTitleText, williamr@2: TInt aSettingNumber, williamr@2: TInt aControlType, williamr@2: TInt aEditorResourceId, williamr@2: TInt aSettingPageResourceId, williamr@2: TTimeIntervalSeconds& aDurationValue); williamr@2: williamr@2: /** williamr@2: * Specific 2nd stage contructor for this type. Construction is performed williamr@2: * according to the resources and parameters set in the C++ constructors williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void ConstructL(); williamr@2: /** williamr@2: * Type-specific access to the editor williamr@2: */ williamr@2: IMPORT_C CEikDurationEditor* DurationEditor(); williamr@2: /** williamr@2: * From CCoeControl. williamr@2: * Handles pointer events williamr@2: */ williamr@2: IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C virtual ~CAknDurationSettingPage(); williamr@2: williamr@2: /** williamr@2: * This framework method is called when the editor changes its value and williamr@2: * the mode of execution of the setting page is a continuous update mode. williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void UpdateSettingL(); williamr@2: williamr@2: /** williamr@2: * Called when the user has accepted the value. williamr@2: * The external value is updated once again, in case we were not in williamr@2: * continuous update mode. williamr@2: * A specific observer event is generated for the observer to say that the williamr@2: * value is accepted. williamr@2: */ williamr@2: IMPORT_C virtual void AcceptSettingL(); williamr@2: williamr@2: /** williamr@2: * The backup value, stored at construction time, is re-loaded into the williamr@2: * referenced Date. williamr@2: * An event is sent to the observer saying that the event was dismissed. williamr@2: */ williamr@2: IMPORT_C virtual void RestoreOriginalSettingL(); williamr@2: williamr@2: // williamr@2: // CoeControl Framework and reserved methods williamr@2: // williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * Writes the internal state of the control and its components to aStream. williamr@2: * Does nothing in release mode. williamr@2: * Designed to be overidden and base called by subclasses. williamr@2: * williamr@2: * @param aWriteSteam A connected write stream williamr@2: */ williamr@2: IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; williamr@2: williamr@2: private: williamr@2: /** williamr@2: * Reserved method derived from CCoeControl williamr@2: */ williamr@2: IMPORT_C virtual void Reserved_2(); williamr@2: williamr@2: private: williamr@2: /** williamr@2: * From CAknControl williamr@2: */ williamr@2: IMPORT_C void* ExtensionInterface( TUid aInterface ); williamr@2: williamr@2: /** williamr@2: * New reserved methods for CAknSettingPage hierarchy williamr@2: */ williamr@2: private: williamr@2: IMPORT_C virtual void CAknSettingPage_Reserved_1(); williamr@2: IMPORT_C virtual void CAknSettingPage_Reserved_2(); williamr@2: williamr@2: private: williamr@2: TTimeIntervalSeconds& iDurationValue; williamr@2: TTimeIntervalSeconds iBackupDurationValue; williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: * Time offset setting page. williamr@2: * williamr@2: * @lib avkon williamr@2: * @since 2.0 williamr@2: */ williamr@2: williamr@2: class CAknTimeOffsetSettingPage : public CAknMfneSettingPage williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Constructor using purely Setting page resource williamr@2: * williamr@2: * @since 2.0 williamr@2: * @param aResourceId Setting page resource Id williamr@2: * @param aTimeOffsetValue Reference to the maintained williamr@2: * offset value williamr@2: */ williamr@2: IMPORT_C CAknTimeOffsetSettingPage( williamr@2: TInt aResourceID, williamr@2: TTimeIntervalSeconds& aTimeOffsetValue); williamr@2: /** williamr@2: * Constructor that allows separate setting page and editor resources williamr@2: * williamr@2: * This constructor allows the use of setting page using only the editor williamr@2: * resource. Other combinations are also possible williamr@2: * williamr@2: * In all cases the number (if supplied i.e. <> 0 ) is used. williamr@2: * williamr@2: * Editor Resource Setting Page Resource williamr@2: * present present Both are used williamr@2: * (but text & number williamr@2: * overridden) williamr@2: * = 0 present Editor resource is williamr@2: * used via SP resource williamr@2: * (Effectively like the williamr@2: * other constructor) williamr@2: * present = 0 Default Avkon SP williamr@2: * resource if used + williamr@2: * this editor resource williamr@2: * = 0 = 0 uses default resource williamr@2: * for both SP and editor. williamr@2: * This is OK if: williamr@2: * i) control type is present, williamr@2: * ii) a default resource exists ( OK for text, integer, williamr@2: * date, time, duration ) williamr@2: * williamr@2: * Note: The first argument is a TDesC* (rather than TDesC&) because williamr@2: * the other constructor cannot initialize such a member without allocation williamr@2: * or having an internal dummy buffer. williamr@2: * Note that this descriptor must be owned by the client at least until the williamr@2: * ExecuteLD(). williamr@2: * williamr@2: * Rules for text and numbers: The rules are the same for both: williamr@2: * (non-zero length) text or number other than williamr@2: * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not williamr@2: * override resource (unless that is zero length or williamr@2: * EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number williamr@2: * given via the specific API for setting them, WILL override resource. williamr@2: * It is assumed that number from resource is very rare. Special text is williamr@2: * somewhat more likely. williamr@2: * williamr@2: * @since 2.0 williamr@2: * @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY williamr@2: * @param aSettingNumber Number at top left (if present) williamr@2: * @param aControlType Determines the type constructed williamr@2: * and how its resource is read williamr@2: * @param aEditorResourceId Editor resource to use in the setting page williamr@2: * (if present) williamr@2: * @param aSettingPageResourceId Setting Page to use (if present) williamr@2: * @param aTimeOffsetValue reference to time offset williamr@2: */ williamr@2: IMPORT_C CAknTimeOffsetSettingPage( const TDesC* aSettingTitleText, williamr@2: TInt aSettingNumber, williamr@2: TInt aControlType, williamr@2: TInt aEditorResourceId, williamr@2: TInt aSettingPageResourceId, williamr@2: TTimeIntervalSeconds& aTimeOffsetValue); williamr@2: williamr@2: /** williamr@2: * Specific 2nd stage contructor for this type. Construction is performed williamr@2: * according to the resources and parameters set in the C++ constructors williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void ConstructL(); williamr@2: /** williamr@2: * Type-specific access to the editor williamr@2: */ williamr@2: IMPORT_C CEikTimeOffsetEditor* TimeOffsetEditor(); williamr@2: /** williamr@2: * From CCoeControl williamr@2: */ williamr@2: IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C virtual ~CAknTimeOffsetSettingPage(); williamr@2: williamr@2: /** williamr@2: * This framework method is called when the editor changes its williamr@2: * value and the mode of execution of the setting page is a continuous williamr@2: * update mode. williamr@2: * williamr@2: * @since 2.0 williamr@2: */ williamr@2: IMPORT_C virtual void UpdateSettingL(); williamr@2: williamr@2: /** williamr@2: * Called when the user has accepted the value. williamr@2: * The external value is updated once again, in case we were not in williamr@2: * continuous update mode. williamr@2: * A specific observer event is generated for the observer to say that the williamr@2: * value is accepted. williamr@2: * williamr@2: * @since 2.0 williamr@2: */ williamr@2: IMPORT_C virtual void AcceptSettingL(); williamr@2: williamr@2: /** williamr@2: * The backup value, stored at construction time, is re-loaded into the williamr@2: * referenced Date. williamr@2: * An event is sent to the observer saying that the event was dismissed. williamr@2: * williamr@2: * @since 2.0 williamr@2: */ williamr@2: IMPORT_C virtual void RestoreOriginalSettingL(); williamr@2: williamr@2: // williamr@2: // CoeControl Framework and reserved methods williamr@2: // williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * Writes the internal state of the control and its components to aStream. williamr@2: * Does nothing in release mode. williamr@2: * Designed to be overidden and base called by subclasses. williamr@2: * williamr@2: * @since 2.0 williamr@2: * @param aWriteSteam A connected write stream williamr@2: */ williamr@2: IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; williamr@2: williamr@2: private: williamr@2: /** williamr@2: * Reserved method derived from CCoeControl williamr@2: * williamr@2: * @since 2.0 williamr@2: */ williamr@2: IMPORT_C virtual void Reserved_2(); williamr@2: williamr@2: private: williamr@2: /** williamr@2: * From CAknControl williamr@2: */ williamr@2: IMPORT_C void* ExtensionInterface( TUid aInterface ); williamr@2: williamr@2: /** williamr@2: * New reserved methods for CAknSettingPage hierarchy williamr@2: */ williamr@2: private: williamr@2: IMPORT_C virtual void CAknSettingPage_Reserved_1(); williamr@2: IMPORT_C virtual void CAknSettingPage_Reserved_2(); williamr@2: williamr@2: private: williamr@2: TTimeIntervalSeconds& iTimeOffsetValue; williamr@2: TTimeIntervalSeconds iBackupTimeOffsetValue; williamr@2: williamr@2: }; williamr@2: /** williamr@2: * williamr@2: * Setting page class for entering an IP Address williamr@2: * williamr@2: */ williamr@2: class CAknIpFieldSettingPage : public CAknMfneSettingPage williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Constructor using purely Setting page resource williamr@2: * williamr@2: * @param aResourceId Setting page resource Id williamr@2: * @param aIpAddress Reference to the maintained IP address williamr@2: */ williamr@2: IMPORT_C CAknIpFieldSettingPage( williamr@2: TInt aResourceID, williamr@2: TInetAddr& aIpAddress); williamr@2: /** williamr@2: * Constructor that allows separate setting page and editor resources williamr@2: * williamr@2: * This constructor allows the use of setting page using only the editor williamr@2: * resource. Other combinations are also possible williamr@2: * williamr@2: * In all cases the number (if supplied i.e. <> 0 ) is used. williamr@2: * williamr@2: * Editor Resource Setting Page Resource williamr@2: * present present Both are used (but text williamr@2: * & number overridden) williamr@2: * = 0 present Editor resource is williamr@2: * used via SP resource williamr@2: * (Effectively like the williamr@2: * other constructor) williamr@2: * present = 0 Default Avkon SP williamr@2: * resource if used + this williamr@2: * editor resource williamr@2: * = 0 = 0 uses default resource williamr@2: * for both SP and editor. williamr@2: * This is OK if: williamr@2: * i) control type is present, williamr@2: * ii) a default resource exists ( OK for text, integer, williamr@2: * date, time, duration ) williamr@2: * williamr@2: * Note: The first argument is a TDesC* (rather than TDesC&) because the williamr@2: * other constructor cannot initialize such a member without allocation williamr@2: * or having an internal dummy buffer. williamr@2: * Note that this descriptor must be owned by the client at least until williamr@2: * the ExecuteLD(). williamr@2: * williamr@2: * Rules for text and numbers: The rules are the same for both: williamr@2: * (non-zero length) text or number other than williamr@2: * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not williamr@2: * override resource (unless that is zero length or williamr@2: * EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number williamr@2: * given via the specific API for setting them, WILL override resource. williamr@2: * It is assumed that number from resource is very rare. Special text is williamr@2: * somewhat more likely. williamr@2: * williamr@2: * @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY williamr@2: * @param aSettingNumber Number at top left (if present) williamr@2: * @param aControlType Determines the type constructed and how its williamr@2: * resource is read williamr@2: * @param aEditorResourceId Editor resource to use in the setting page williamr@2: * (if present) williamr@2: * @param aSettingPageResourceId Setting Page to use (if present) williamr@2: * @param aIpAddress reference to a duration williamr@2: */ williamr@2: IMPORT_C CAknIpFieldSettingPage( const TDesC* aSettingTitleText, williamr@2: TInt aSettingNumber, williamr@2: TInt aControlType, williamr@2: TInt aEditorResourceId, williamr@2: TInt aSettingPageResourceId, williamr@2: TInetAddr& aIpAddress); williamr@2: williamr@2: /** williamr@2: * Specific 2nd stage contructor for this type. Construction is performed williamr@2: * according to the resources and parameters set in the C++ constructors williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void ConstructL(); williamr@2: /** williamr@2: * Type-specific access to the editor williamr@2: */ williamr@2: IMPORT_C CAknIpFieldEditor* IpFieldEditor(); williamr@2: williamr@2: /** williamr@2: * From CCoeControl williamr@2: */ williamr@2: IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C virtual ~CAknIpFieldSettingPage(); williamr@2: williamr@2: /** williamr@2: * This framework method is called when the editor changes its value and williamr@2: * the mode of execution of the setting page is a continuous update mode. williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void UpdateSettingL(); williamr@2: williamr@2: /** williamr@2: * Called when the user has accepted the value. williamr@2: * The external value is updated once again, in case we were not in williamr@2: * continuous update mode. williamr@2: * A specific observer event is generated for the observer to say that the williamr@2: * value is accepted. williamr@2: */ williamr@2: IMPORT_C virtual void AcceptSettingL(); williamr@2: williamr@2: /** williamr@2: * The backup value, stored at construction time, is re-loaded into williamr@2: * the referenced Date. williamr@2: * An event is sent to the observer saying that the event was dismissed. williamr@2: */ williamr@2: IMPORT_C virtual void RestoreOriginalSettingL(); williamr@2: williamr@2: // williamr@2: // CoeControl Framework and reserved methods williamr@2: // williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * Writes the internal state of the control and its components to aStream. williamr@2: * Does nothing in release mode. williamr@2: * Designed to be overidden and base called by subclasses. williamr@2: * williamr@2: * @param aWriteSteam A connected write stream williamr@2: */ williamr@2: IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; williamr@2: williamr@2: private: williamr@2: williamr@2: /** williamr@2: * Reserved method derived from CCoeControl williamr@2: */ williamr@2: IMPORT_C virtual void Reserved_2(); williamr@2: williamr@2: private: williamr@2: /** williamr@2: * From CAknControl williamr@2: */ williamr@2: IMPORT_C void* ExtensionInterface( TUid aInterface ); williamr@2: williamr@2: /** williamr@2: * New reserved methods for CAknSettingPage hierarchy williamr@2: */ williamr@2: private: williamr@2: IMPORT_C virtual void CAknSettingPage_Reserved_1(); williamr@2: IMPORT_C virtual void CAknSettingPage_Reserved_2(); williamr@2: williamr@2: private: williamr@2: TInetAddr& iIpAddress; williamr@2: TInetAddr iBackupIpAddress; // Not a reference williamr@2: williamr@2: }; williamr@2: #endif