williamr@2: /* williamr@4: * Copyright (c) 2002-2009 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: * Base class for setting page (setting item editing) UI williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef __AKNSETTINGPAGE_H__ williamr@2: #define __AKNSETTINGPAGE_H__ williamr@2: williamr@2: #include williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: // For menu support williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: // for layout support williamr@4: #include williamr@2: williamr@2: // for navipane support (hint text) williamr@2: #include williamr@2: williamr@2: // williamr@2: // Forward declarations williamr@2: // williamr@2: class CEikLabel; williamr@2: class CAknSettingPageSkinsInfo; williamr@2: class MAknsControlContext; williamr@2: class CAknsFrameBackgroundControlContext; williamr@2: class CAknSettingPageExtension; williamr@2: williamr@2: williamr@2: // Used as the return value of SettingId() if not yet set. williamr@2: // This because the Id might want to be the index of a 0-based array williamr@2: williamr@2: const TInt KAknSettingPageNoIdSet = -1; williamr@2: williamr@2: class CAknSettingPage; williamr@2: williamr@2: // This class is used as a means of notifying change in settings. williamr@2: williamr@2: class MAknSettingPageObserver williamr@2: { williamr@2: public: williamr@2: enum TAknSettingPageEvent williamr@2: { williamr@2: EEventSettingChanged, williamr@2: EEventSettingCancelled, williamr@2: EEventSettingOked williamr@2: }; williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Handles an event of type aEventType reported by the Setting Page to this observer. williamr@2: */ williamr@2: virtual void HandleSettingPageEventL(CAknSettingPage* aSettingPage,TAknSettingPageEvent aEventType )=0; williamr@2: williamr@2: }; williamr@2: williamr@2: class CAknSettingPage : public CAknControl, public MCoeControlObserver, public MEikMenuObserver williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: * This enumeration is passed in the ExecuteLD() method to control how often the setting page williamr@2: * updates the externally held client object williamr@2: */ williamr@2: enum TAknSettingPageUpdateMode williamr@2: { williamr@2: EUpdateWhenChanged, williamr@2: EUpdateWhenAccepted williamr@2: }; williamr@2: williamr@2: /** williamr@2: * This enumeration is used to select the type and IIDs for the various classes defined in the williamr@2: * Skins LAF spec for "Opened Setting Items" williamr@2: */ williamr@2: enum TEditedItemSkinClass williamr@2: { williamr@2: ESettingPageSkinEditedItemClassValueItemList, williamr@2: ESettingPageSkinEditedItemClassVolume, williamr@2: ESettingPageSkinEditedItemClassSlider, williamr@2: ESettingPageSkinEditedItemClassTextEntry, williamr@2: ESettingPageSkinEditedItemClassCodeDateTimeEntry williamr@2: }; williamr@2: /** williamr@2: * Simple contructor for using a single setting page resource which itself gives all williamr@2: * the setup williamr@2: */ williamr@2: IMPORT_C CAknSettingPage( TInt aSettingPageResourceId ); williamr@2: /** williamr@2: * Constructor that allows separate setting page and editor resources 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 & number overridden) williamr@2: * = 0 present Editor resource is used via SP resource williamr@2: * present = 0 Default Avkon SP resource if used williamr@2: * = 0 = 0 Not permitted williamr@2: * williamr@2: * Note: The first argument is a TDesC* (rather than TDesC&) because the other constructor williamr@2: * cannot initialize such a member without allocation or having an internal dummy buffer. williamr@2: * williamr@2: * Rules for text and numbers: The rules are the same for both: (non-zero length) text or number other williamr@2: * than EAknSettingPageNoOrdinalDisplayed if given in this constructor will not override resource williamr@2: * (unless that is zero length or EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number given via the williamr@2: * specific API for setting them, WILL override resource. williamr@2: * It is assumed that number from resource is very rare. Special text is somewhat more likely. williamr@2: * williamr@2: * @param aSettingTitleText Text at top of setting pane (not copied; must be owned externally until ExecuteLD is called) williamr@2: * @param aSettingNumber Number at top left (if present) williamr@2: * @param aControlType Determines the type constructed and how its resource is read williamr@2: * @param aEditorResourceId Editor resource to use in the setting page (if present) williamr@2: * @param aSettingPageResourceId Setting Page to use (if present) williamr@2: */ williamr@2: IMPORT_C CAknSettingPage( const TDesC* aSettingTitleText, williamr@2: TInt aSettingNumber, williamr@2: TInt aControlType, williamr@2: TInt aEditorResourceId, williamr@2: TInt aSettingPageResourceId = 0 ); williamr@2: /** williamr@2: * C++ destructor williamr@2: */ williamr@2: IMPORT_C virtual ~CAknSettingPage(); williamr@2: williamr@2: /** williamr@2: * Executes a waiting dialog-like setting page williamr@2: * williamr@2: * The passed mode determines if the editor's value is updated continuously, or just williamr@2: * when it is accepted. williamr@2: * williamr@2: * @param aMode The update mode of the class williamr@2: */ williamr@2: IMPORT_C TBool ExecuteLD( enum CAknSettingPage::TAknSettingPageUpdateMode aMode=EUpdateWhenAccepted ); williamr@2: williamr@2: /** williamr@2: * public method for construction. Only thing required to do in this class is to call the williamr@2: * BaseConstructL(). Derived classes may be required to do more williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void ConstructL(); williamr@2: williamr@2: /** williamr@2: * Returns reference to the hosted "editor" control as a CCoeControl. williamr@2: * This routine is used in derived classes, which may then cast to the specific run-time type williamr@2: * Note also that derived classes may provide type-specific access that performs these casts already williamr@2: * williamr@2: * @return CCoeControl* pointer to the hosted editor control williamr@2: */ williamr@2: IMPORT_C CCoeControl* EditorControl() const; williamr@2: williamr@2: /** williamr@2: * Returns the setting Id. williamr@2: * williamr@2: * @return TInt the setting Id williamr@2: */ williamr@2: IMPORT_C TInt SettingId() const; williamr@2: williamr@2: /** williamr@2: * Sets the setting Id. The Id may be used to unabiguously number a setting in some context. williamr@2: * It would be useful to call SettingId() on aSettingPageControl in handling an observer williamr@2: * callback. The Id is not used internally. williamr@2: * williamr@2: * @param aSettingId An id to provide to the observer in the callback williamr@2: */ williamr@2: IMPORT_C void SetSettingId( TInt aSettingId ); williamr@2: /** williamr@2: * Substitutes the new setting number. williamr@2: * williamr@2: * @param aSettingNumber The new setting number to display williamr@2: */ williamr@2: IMPORT_C void SetSettingNumberL( const TInt aSettingNumber ); williamr@2: williamr@2: /** williamr@2: * Substitutes the new setting text. Memory is allocated for a copy. williamr@2: * If already constructed, the label is reformatted. williamr@2: * williamr@2: * Note that calling this will over-ride text in Setting Page resource williamr@2: * williamr@2: * @param aSettingText The new setting text to display williamr@2: */ williamr@2: IMPORT_C void SetSettingTextL( const TDesC& aSettingText ); williamr@2: williamr@2: /** williamr@2: * Sets the observer for the setting page. williamr@2: * williamr@2: * @param aObserver The observer for changes to the setting williamr@2: */ williamr@2: IMPORT_C void SetSettingPageObserver( MAknSettingPageObserver* aObserver); williamr@2: williamr@2: /** williamr@2: * Access method for the number of the setting page williamr@2: * williamr@2: */ williamr@2: IMPORT_C TInt SettingNumber() const; williamr@2: williamr@2: /** williamr@2: * Access method for whether the setting page is numbered or not williamr@2: * williamr@2: */ williamr@2: IMPORT_C TBool IsNumbered() const; williamr@2: williamr@2: /** williamr@2: * Set method for whether the setting page is numbered or not williamr@2: * williamr@2: */ williamr@2: IMPORT_C void SetNumbered( TBool aNumbered ); williamr@2: williamr@2: /** williamr@2: * Reads the passed-in setting page resource in order to read the contained editor control williamr@2: * resource information williamr@2: * @param aSettingPageResoruceId This is used to specifiy what resource to read williamr@2: * @param aControlType Returns the control type (MAY return 0 - that's a valid control type! williamr@2: * @param aEditorResourceId Returns the setting page's LLINK editor resource, but returns 0 if not present williamr@2: * williamr@2: * This will leave if an invalid resource ID is passed williamr@2: */ williamr@2: IMPORT_C static void GetEditorResourceInfoL( williamr@2: TInt aSettingPageResourceId, williamr@2: TInt& aControlType, williamr@2: TInt& aEditorResourceId ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Set the edit-state of the setting page. The setting page can be edited or williamr@2: * it can be only viewed by the user. williamr@2: * williamr@2: * @since 3.1 williamr@2: * @param aEditable If false, the setting page cannot be modified by the user williamr@2: */ williamr@2: IMPORT_C void SetEditState(const TBool aEditable); williamr@2: williamr@2: /** williamr@2: * Is the setting page possible to edit by the user. williamr@2: * williamr@2: * @since 3.1 williamr@2: * @return Can user modify the setting page. True if can, false if cannot. williamr@2: */ williamr@2: IMPORT_C TBool IsEditable() const; williamr@2: williamr@2: /** williamr@2: * Used for aknsettingpage's extenstion corresponding function williamr@2: * williamr@2: * @since 5.0 williamr@2: * @param aCaption On return, this should be set to the caption of the target control. williamr@2: */ williamr@2: void GetCaptionForFep(TDes& aCaption) const; williamr@4: williamr@4: /** williamr@4: * Calculates and returns setting item content rect. williamr@4: * williamr@4: * @param aScrollBarUsed @c ETrue if the setting page content should have williamr@4: * scrollbar, @c EFalse otherwise. williamr@4: * williamr@4: * @internal williamr@4: * @since 5.2 williamr@4: * @return Setting item content rectangle. williamr@4: */ williamr@4: TRect SettingItemContentRect( TBool aScrollBarUsed ); williamr@4: williamr@4: /** williamr@4: * Is the setting page drawing the background itself or not (= "transparency") williamr@4: */ williamr@4: TBool IsBackgroundDrawingEnabled() const; williamr@4: williamr@4: /** williamr@4: * Access method to the Command button array williamr@4: * williamr@4: * Must be called after full construction, or null reference will be returned. williamr@4: * williamr@4: * @return CEikButtonGroupContainer* a pointer to the cba owned by the setting page williamr@4: */ williamr@4: IMPORT_C CEikButtonGroupContainer* Cba() const ; williamr@4: williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * From CCoeControl williamr@2: * This routine is called as part of the set-up of the control. It is the place to put williamr@2: * layout code. williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void SizeChanged(); williamr@2: williamr@2: williamr@2: /** williamr@2: * From CCoeControl williamr@2: * Takes any action required when the control gains or loses focus e.g. to change its appearance. williamr@2: * The control should be redrawn depending on the value of aDrawNow. Empty by default. williamr@2: */ williamr@2: IMPORT_C virtual void FocusChanged(TDrawNow aDrawNow); williamr@2: williamr@2: /** williamr@2: * From MEikCommandObserver williamr@2: * Processes events from the softkeys. Responds to EAknSoftkeyOk and EAknSoftkeyBack williamr@2: * to accept or cancel the pop-up. williamr@2: * williamr@2: * @param aCommandId Event Id from the soft-key williamr@2: */ williamr@2: IMPORT_C virtual void ProcessCommandL(TInt aCommandId); williamr@2: williamr@2: /** williamr@2: * From MCoeControlObserver: williamr@2: * Acts upon changes in the hosted control's state. williamr@2: * williamr@2: * This class's implementation is trivial and should be able to be williamr@2: * safely re-implemented in directly client-derived classes. williamr@2: * For non-base setting page classes, a call to the base class should be made 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,TCoeEvent aEventType); williamr@2: williamr@2: // williamr@2: // williamr@2: // Framework functions. New in this class williamr@2: // williamr@2: // williamr@2: /** williamr@2: * Framework method to determine if it is OK to exit the setting page. williamr@2: * Derived classes may check for valid data before allowing the dismissal of the williamr@2: * setting page. williamr@2: * williamr@2: * @param aAccept ETrue if the user has indicated to accept the setting page; EFalse otherwise williamr@2: * @return TBool a value indicating whether the setting page should be dismissed williamr@2: */ williamr@2: IMPORT_C virtual TBool OkToExitL(TBool aAccept); williamr@2: williamr@2: /** williamr@2: * Called immediately prior to activation of the dialog. Framework routine for derived williamr@2: * classes. williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void DynamicInitL(); williamr@2: williamr@2: /** williamr@2: * Called when something has changed and the client's object needs to have its value updated williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void UpdateSettingL(); williamr@2: williamr@2: /** williamr@2: * Called when the user accepts a setting and the setting page is about to be dismissed. The latest value of the williamr@2: * setting is written to the client's object williamr@2: */ williamr@2: IMPORT_C virtual void AcceptSettingL(); williamr@2: williamr@2: /** williamr@2: * Called when the user rejects the setting. A backup copy may need to be restored if UpdateWhenChanged flag was set williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void RestoreOriginalSettingL(); williamr@2: williamr@2: /** williamr@2: * Display the menu williamr@2: */ williamr@2: IMPORT_C virtual void DisplayMenuL() ; williamr@2: williamr@2: /** williamr@2: * Hide the menu williamr@2: */ williamr@2: IMPORT_C virtual void HideMenu() ; williamr@2: williamr@2: /** williamr@2: * Puts the focus back on the editor. For complicated setting pages that have focus removed from them williamr@2: * at some point, then a re-implementation may have to do some work here. williamr@2: */ williamr@2: IMPORT_C virtual void SetFocusToEditor(); williamr@2: williamr@2: /** williamr@2: * This method should be implemented in listbox classes to move the selection in williamr@2: * listbox editors prior to exiting from the setting page. It is called on a williamr@2: * CAknSettingPage* reference, and is therefore declared here. williamr@2: */ williamr@2: IMPORT_C virtual void SelectCurrentItemL(); williamr@2: williamr@2: /** williamr@2: * Protected non-virtual base method for construction. Only thing required to do in this class is williamr@2: * call the ConstructFromResourceL routine and set the flag that says construction has occured williamr@2: * williamr@2: */ williamr@2: IMPORT_C void BaseConstructL(); williamr@2: williamr@2: /** williamr@2: * Called to remove the setting page. Should not be called except from within re-implemented williamr@2: * AttemptExitL williamr@2: * williamr@2: * @param aAccept ETrue to accept the current value; EFalse otherwise williamr@2: */ williamr@2: IMPORT_C void DismissL( TBool aAccept ); williamr@2: williamr@2: /** williamr@2: * This is used as a protected access function for the state of the menu bar williamr@2: * williamr@2: * @return TBool ETrue if the menu is currently showing williamr@2: */ williamr@2: IMPORT_C TBool MenuShowing() const ; williamr@2: williamr@2: /** williamr@2: * This constructs the control based upon the id passed williamr@2: * williamr@2: */ williamr@2: IMPORT_C void ConstructFromResourceL( TInt aResourceId); williamr@2: williamr@2: /** williamr@2: * This constructs the control based upon a constructed and positioned reader williamr@2: * williamr@2: */ williamr@2: IMPORT_C void ConstructFromResourceL(TResourceReader& aRes); williamr@2: williamr@2: /** williamr@2: * Called when the user accepts or cancels the setting. Default implementation williamr@2: * sets the return value and exists. williamr@2: * williamr@2: * Re-implementations must call DismissL and StopActiveScheduler() if the setting is williamr@2: * to leave. williamr@2: * williamr@2: * @param aAccept ETrue if the user accepted. EFalse if the user cancelled. williamr@2: */ williamr@2: IMPORT_C void AttemptExitL(TBool aAccept); williamr@2: /** williamr@2: * Method to determine the current running state of the setting page's williamr@2: * ActiveScheduler level. williamr@2: * williamr@2: * @return EFalse only if the CActiveSheduler level is not running williamr@2: */ williamr@2: IMPORT_C TBool Waiting(); williamr@2: williamr@2: /** williamr@2: * This is used to access the default resource id for the cba - the one used when williamr@2: * data is valid. williamr@2: * williamr@2: * @return TInt the default resource Id williamr@2: */ williamr@2: IMPORT_C TInt DefaultCbaResourceId() const; williamr@2: williamr@2: /** williamr@2: * This routine routes the keys to the editor. williamr@2: * However, if the menu is showing, then events are sent to the menu. williamr@2: * williamr@2: * @param aKeyEvent event information williamr@2: * @param aType type of event being handled williamr@2: * williamr@2: */ williamr@2: IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType); williamr@2: williamr@2: /** williamr@2: * This routine is the base layout for CAknSettingPage. It lays out the labels and configures williamr@2: * the drawing in general. williamr@2: */ williamr@2: IMPORT_C void StandardSettingPageLayout(); williamr@2: williamr@2: /** williamr@2: * This method can be used to test if BaseConstructL() has been called yet williamr@2: * successfully williamr@2: * williamr@2: * @return TBool ETrue if BaseContructL has been called (and not left) williamr@2: */ williamr@2: IMPORT_C TBool IsBaseConstructed(); williamr@2: williamr@2: /** williamr@2: * Access method for the internally held resource Id williamr@2: * williamr@2: */ williamr@2: IMPORT_C TInt SettingPageResourceId(); williamr@2: /** williamr@2: * Perform the drawing of coded within CAknSettingPage williamr@2: * williamr@2: */ williamr@2: IMPORT_C void BaseDraw(const TRect& aRect) const; williamr@2: williamr@2: /** williamr@2: * Set default construction values of internal state williamr@2: */ williamr@2: IMPORT_C void ResetFlags(); williamr@2: williamr@2: /** williamr@2: * Framework method called as soon as the setting page is displayed, but before the new active sheduler level williamr@2: * is started. Returning EFalse will dismiss the setting page right away williamr@2: * williamr@2: * @return TBool ETrue if the setting page is to continue williamr@2: */ williamr@2: IMPORT_C virtual TBool PostDisplayCheckL(); williamr@2: williamr@2: /** williamr@2: * This framework method is used to update the contents of the CBA in a custom way. williamr@2: * Some setting page classes implement a degree of validation and will implement this. williamr@2: * Derived classes should ensure that this is being called frequently enough for their williamr@2: * purposes. williamr@2: */ williamr@2: IMPORT_C virtual void UpdateCbaL(); williamr@2: williamr@2: /** williamr@2: * Called to access the validity state of the data williamr@2: * williamr@2: * @return TBool ETRrue if the data is valid williamr@2: */ williamr@2: IMPORT_C TBool DataValidity() const; williamr@2: williamr@2: /** williamr@2: * used to set the validity of the data williamr@2: * williamr@2: * @param TBool aValid Sets the validity true or false williamr@2: */ williamr@2: IMPORT_C void SetDataValidity(TBool aValid); williamr@2: williamr@2: /** williamr@2: * Framework method to set the validity of the data williamr@2: * This is called when the data changes. williamr@2: * williamr@2: */ williamr@2: IMPORT_C virtual void CheckAndSetDataValidity(); williamr@2: williamr@4: /** williamr@4: * Sets the outer and inner rectangle for the frame graphics that is drawn williamr@4: * around the setting item. williamr@4: * williamr@4: * @param aOuterRect Frame outer rectangle. williamr@4: * @param aInnerRect Frame inner rectangle. williamr@4: * williamr@4: * @since 5.2 williamr@4: */ williamr@4: void SetEditedItemFrameRects( const TRect& aOuterRect, williamr@4: const TRect& aInnerRect ); williamr@4: williamr@4: /** williamr@4: * Sets the skin item ID for the frame graphics that is drawn williamr@4: * around the setting item. williamr@4: * williamr@4: * @param aFrameIID Skin item ID of the frame graphics. williamr@4: * @param aFrameCenterIID Skin item ID of the center piece of the frame williamr@4: * graphics williamr@4: * williamr@4: * @since 5.2 williamr@4: */ williamr@4: void SetEditedItemFrameIID( const TAknsItemID& aFrameIID, williamr@4: const TAknsItemID& aFrameCenterIID ); williamr@4: williamr@4: /** williamr@4: * Sets the rectangle for the editing state indicators. williamr@4: * Should only be called by setting pages that have an editor which williamr@4: * displays the editor indicators as the editor control. williamr@4: * williamr@4: * @param aRect Editor indicator rectangle. williamr@4: * williamr@4: * @since 5.2 williamr@4: */ williamr@4: void SetEditorIndicatorRect( const TRect& aRect ); williamr@2: williamr@2: /** williamr@2: * Indicates whether skin system will be able to draw the editor frame and background williamr@2: * williamr@2: * @return TBool ETrue iff the drawing of the edited item frame is going to be handled by williamr@2: * the base CAknSettingPage class itself using Skins williamr@2: * @since 2.0 williamr@2: */ williamr@2: TBool IsSkinsHandlingEditorFrameDrawing() const; williamr@2: williamr@2: /** williamr@2: * Control context for providing to the skinning for the hosted editor and its framing williamr@2: * williamr@2: * @return A valid control context for frame drawing for a hosted editor or NULL williamr@2: * @since 2.0 williamr@2: */ williamr@2: CAknsFrameBackgroundControlContext* EditedItemControlContext() const; williamr@2: williamr@4: /** williamr@4: * Performs base construction and takes possible flags into account. williamr@4: * williamr@4: * @param aFlags Construction flags williamr@4: * williamr@4: * @since 5.2 williamr@4: */ williamr@4: void BaseConstructL( TUint aFlags ); williamr@4: williamr@4: /** williamr@4: * Stop current (additional) level on the active scheduler. williamr@4: */ williamr@4: void StopActiveScheduler(); williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * From MEikMenuObserver williamr@2: * Called when menu is cancelled. williamr@2: */ williamr@2: IMPORT_C virtual void SetEmphasis(CCoeControl* /*aMenuControl*/,TBool aEmphasis); williamr@2: williamr@2: /** williamr@2: * From MEikMenuObserver williamr@2: * This function intializes the items on the menu. It is used to disable and enable menu items and may be williamr@2: * over ridden to add new ones. williamr@2: * In addition it adds menu items which have been provided in the ConstructL in the form of a Menu Bar resource. williamr@2: * Instead of using the Menu Bar directly it extracts the menu panes and adds them to its own menu pane. williamr@2: * It must be called in the DynInitMenuPaneL() function of any derived class before anything else. williamr@2: */ williamr@2: IMPORT_C virtual void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); williamr@2: williamr@2: public: // From CCoeControl williamr@2: /** williamr@2: * Handles a change to the control's resources of type aType williamr@2: * which are shared across the environment, e.g. colors or fonts. williamr@2: * williamr@2: * @since 2.0 williamr@2: * @param aType Reason for the "resource" change, usually an system event UID williamr@2: */ williamr@2: IMPORT_C void HandleResourceChange(TInt aType); 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: williamr@2: IMPORT_C CCoeControl* ComponentControl(TInt anIndex) const; williamr@2: williamr@2: /** williamr@2: * Handles pointer events williamr@2: */ williamr@2: IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); williamr@2: /** williamr@2: * From CCoeControl. williamr@2: * Gets the control's input capabilities. williamr@2: * williamr@2: * @return The control's input capabilities. williamr@2: */ williamr@2: IMPORT_C TCoeInputCapabilities InputCapabilities() const; williamr@2: williamr@2: private: williamr@2: IMPORT_C virtual void Reserved_MtsmPosition(); williamr@2: IMPORT_C virtual void Reserved_MtsmObject(); williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * Access method for the softkey resource used when there is invalid data williamr@2: * williamr@2: * @return TInt The resource Id of the softkey bindings. williamr@2: */ williamr@2: IMPORT_C TInt InvalidDataCbaResourceId() const; williamr@2: williamr@2: protected: // from MObjectProvider williamr@2: IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId); williamr@2: williamr@2: protected: williamr@2: /** williamr@2: * Hold the update mode passed in the constructor williamr@2: */ williamr@2: TInt iUpdateMode; williamr@2: williamr@2: // The following are not owned: williamr@2: williamr@2: /** williamr@2: * Pointer to setting page observer; may be NULL williamr@2: */ williamr@2: MAknSettingPageObserver* iSettingPageObserver; williamr@2: williamr@2: private: williamr@2: //From CCoeControl williamr@2: IMPORT_C void Draw(const TRect& aRect) const; 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: 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: /** williamr@2: * Activate another level on the active scheduler williamr@2: */ williamr@2: void StartActiveScheduler(); williamr@2: williamr@2: /** williamr@2: * Pop the navidecorator. The iNaviPane is used as a flag to show if popping is required to williamr@2: * be done or not. It is zeroed by this method. williamr@2: * williamr@2: */ williamr@2: void PopNaviDecoratorIfRequired(); williamr@2: williamr@2: private: 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: protected: williamr@2: /** williamr@2: * Enables / disables transparency effect, i.e. does the setting page draw its own background or not. williamr@2: * @param aDrawBackground EFalse enables transparency williamr@2: */ williamr@2: void SetDrawBackground(const TBool aDrawBackground); williamr@2: williamr@2: /** williamr@2: * Set the flag to indicate that if the function CAknSettingPage::StopActiveScheduler called or not williamr@2: *@param aStopCalled ETrue means the StopActiveScheduler is called. williamr@2: */ williamr@2: void SetStopActiveSchedulerFlag(const TBool aStopCalled ); williamr@2: williamr@2: /** williamr@2: * Is the setting page call the StopActiveScheduler or not williamr@2: */ williamr@2: TBool IsStopActiveSchudlerCalled()const; williamr@2: williamr@2: /** williamr@2: * Pointer to setting text label williamr@2: * @return pointer to the label williamr@2: * williamr@2: * @since 5.0 williamr@2: */ williamr@2: IMPORT_C CEikLabel* TextLabel() const; williamr@2: williamr@2: /** williamr@2: * Pointer to shadow text label williamr@2: * @return pointer to the label williamr@2: * williamr@2: * @since 5.0 williamr@2: */ williamr@2: IMPORT_C CEikLabel* ShadowText() const; williamr@2: williamr@2: private: williamr@2: /** williamr@2: * This member points to the setting title text that is passed as part of its more complicated constructor. williamr@2: * The descriptor pointed to is not owned, and therefor must be preserved in the client, at least until the williamr@2: * 2nd stage construction is performed (inside ExecuteLD). williamr@2: * williamr@2: * Since, however, setting pages are all waiting, the descriptor can usually be on the stack in the client. williamr@2: * williamr@2: */ williamr@2: const TDesC* iSettingTextFromConstructor; williamr@2: TInt iResourceId; williamr@2: williamr@2: TInt iSettingNumber; williamr@2: TInt iSettingId; williamr@2: TInt iMenuBarId; williamr@2: TInt iControlType; williamr@2: TInt iEditorResourceId; williamr@2: TInt iExtensionId; williamr@2: TInt iCbaResourceId; williamr@2: williamr@2: TAknLayoutRect iShadow; williamr@2: TAknLayoutRect iHighlight; williamr@2: williamr@2: // pointer to the return value from the setting page. williamr@2: // Needed when presented in waiting mode. williamr@2: TBool* iReturn; williamr@2: williamr@2: // Internal flags williamr@2: TBitFlags iFlags ; williamr@2: williamr@2: enum TFlagIndices williamr@2: { williamr@2: EMenuShowingIndex = 0, williamr@2: ENumberedStyleIndex, williamr@2: EIsBaseConstructedIndex, williamr@2: EHasValidDataIndex williamr@2: }; williamr@2: williamr@2: // Heap objects pointed to here are owned: williamr@2: CCoeControl* iEditorControl; williamr@2: CEikLabel* iNumberLabel; williamr@2: CEikLabel* iTextLabel; williamr@2: CEikButtonGroupContainer* iCba; williamr@2: CEikMenuBar* iMenuBar ; williamr@2: HBufC* iHintText; williamr@2: HBufC* iSettingText; williamr@2: CAknNavigationDecorator* iNaviDecorator; williamr@2: williamr@2: // The following are not owned: williamr@2: // For hint text support williamr@2: CAknNavigationControlContainer* iNaviPane; williamr@2: williamr@2: // Softkey resource when the data is invalid williamr@2: TInt iInvalidDataCbaResourceId; williamr@2: williamr@2: // The following object is used to contain all skinning information required williamr@2: CAknSettingPageSkinsInfo* iSkinsInfo; williamr@2: williamr@2: CActiveSchedulerWait iWait; // owned, safe to use as direct member data. williamr@2: williamr@2: // is setting page editable williamr@2: TInt iIsProtected; williamr@2: williamr@2: // extension to setting page williamr@2: CAknSettingPageExtension* iExtension; williamr@2: }; williamr@2: williamr@2: #endif