camerauis/cameraapp/generic/GsCamcorderPlugin/inc/CamLocationSettingPage.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Setting page for Location setting.*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 #ifndef CAMLOCATIONSETTINGPAGE_H
       
    20 #define CAMLOCATIONSETTINGPAGE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <aknsettingpage.h>
       
    24 #include "MCamAppController.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MCamAppController;
       
    28 class CCamLocationSettingContainer;
       
    29 class MAknQueryValue;
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 *  Setting page for the location control. This setting page is customised
       
    35 *  so that it contains a custom control and not the editor control
       
    36 *  supplied by CAknSettingPage. The base class doesn't allow for custom
       
    37 *  controls to be used in settings pages, so this class provides this
       
    38 *  functionality.
       
    39 *
       
    40 *  @since 2.8
       
    41 */
       
    42 
       
    43 class CCamLocationSettingPage : public CAknSettingPage
       
    44 	{
       
    45 public: // Constructors, etc.
       
    46 	/**
       
    47 	* Construct the quality setting page
       
    48     * @since 2.8
       
    49     * @param aMode                  The current capture mode
       
    50     * @param aSettingTitleText	    Text at top of setting pane
       
    51     * @param aSettingNumber		      Number at top left (if present)
       
    52     * @param aControlType			      Determines the type constructed and how its resource is read
       
    53     * @param aEditorResourceId	    Editor resource to use in the setting page (if present)
       
    54     * @param aSettingPageResourceId	Setting Page to use (if present)
       
    55     * @param aQueryValue			      reference to a query value object
       
    56     * @param aController            reference tothe application controller
       
    57 	*/
       
    58 	CCamLocationSettingPage( TCamCameraMode aMode, 
       
    59                            TDesC& aSettingTitleText,
       
    60                            TInt aSettingNumber, 
       
    61                            TInt aControlType,
       
    62                            TInt aEditorResourceId, 
       
    63                            TInt aSettingPageResourceId,
       
    64                            MAknQueryValue& aQueryValue,
       
    65                            MCamAppController& aController );
       
    66 
       
    67     /**
       
    68 	* Destructor
       
    69     * @since 2.8
       
    70 	*/
       
    71     ~CCamLocationSettingPage();
       
    72 
       
    73     /**
       
    74     * Symbian 2nd phase constructor.
       
    75     * @since 2.8
       
    76     */
       
    77     void ConstructL();
       
    78 
       
    79 public: // Functions from base classes
       
    80 
       
    81     /**
       
    82     * From CAknSettingPage
       
    83     * Called when the state of the quality control changes.
       
    84     * Used to preview the new setting value
       
    85     * @since 2.8
       
    86     */
       
    87     void UpdateSettingL();
       
    88 
       
    89     /**
       
    90     * From CAknSettingPage
       
    91     * Processes events from the softkeys. Responds to EAknSoftkeyOk and EAknSoftkeyBack
       
    92     * to accept or cancel the pop-up.
       
    93     * @since 2.8
       
    94     * @param aCommandId	Event Id from the soft-key
       
    95     */
       
    96     void ProcessCommandL( TInt aCommandId );
       
    97     
       
    98     /**
       
    99     * From CAknSettingPage
       
   100     * Puts up a constructed dialog. Part of the non-waiting API calls.    
       
   101     * Activity to perform as soon as the setting page is displayed
       
   102     * @since 2.8
       
   103     * @return Whether check succeeded
       
   104     */
       
   105     TBool PostDisplayCheckL();
       
   106 
       
   107     /**
       
   108     * From CAknSettingPage
       
   109     * Used to inform the setting item that a new value has been selected
       
   110     * @since 2.8
       
   111     */
       
   112     void SelectCurrentItemL();
       
   113 
       
   114     /**
       
   115     * From CCoeControl
       
   116     * Standard Constructs the control from the resource
       
   117     * @since 2.8
       
   118     * @param	aReader	The resource reader
       
   119     */
       
   120     void ConstructFromResourceL( TResourceReader& aReader );
       
   121 
       
   122     /**
       
   123     * From CCoeControl
       
   124     * Standard CCoeControl routine to return the number of component controls
       
   125     * @since 2.8
       
   126     * @return the number of component controls
       
   127     */
       
   128 	TInt CountComponentControls() const;
       
   129 
       
   130     /**
       
   131     * From CCoeControl
       
   132     * Standard CCoeControl routine to return the control at a given index
       
   133     * @since 2.8
       
   134     * @param anIndex index at which to return control
       
   135     * @return the control at the given index
       
   136     */ 
       
   137     CCoeControl* ComponentControl( TInt anIndex ) const;
       
   138 
       
   139     /**
       
   140     * From CCoeControl
       
   141     * Used the draw the setting page
       
   142     * @since 2.8
       
   143     * @param aRect the invalid rect to draw
       
   144     */ 
       
   145     void Draw( const TRect& aRect ) const;
       
   146 
       
   147     /**
       
   148     * From CCoeControl
       
   149     * Called when the size of the setting page changes
       
   150     * @since 2.8
       
   151     */ 
       
   152     void SizeChanged();
       
   153 
       
   154     /**
       
   155     * From CCoeControl
       
   156     * Used to handle key events
       
   157     * @since 2.8
       
   158     * @param aKeyEvent the key event to handle
       
   159     * @param aType the type of key event
       
   160     * @return whether the key was handled
       
   161     */ 
       
   162     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   163 
       
   164 private:
       
   165     /**
       
   166     * Called when the setting value is to be previewed
       
   167     * @since 2.8
       
   168     * @param aPtr pointer to the object that called the timer
       
   169     * @return Error code
       
   170     */
       
   171     static TInt PreviewSettingChange( TAny* aPtr );
       
   172 
       
   173 private: // data
       
   174     // used to inform the setting item of a change in setting page
       
   175     MAknQueryValue& iQueryValue;
       
   176     // the custom control (quality container ) used in this setting page
       
   177     CCamLocationSettingContainer* iLocationContainer;
       
   178     // reference to the application controller
       
   179     MCamAppController& iController;
       
   180     // the current camera mode
       
   181     TCamCameraMode iMode;
       
   182     // Used to perform the preview setting change
       
   183     CPeriodic* iTimer;
       
   184     // the setting item
       
   185     TInt iSettingItemId;
       
   186     // the current value of the setting item
       
   187     TInt iCurrentVal;
       
   188 	};
       
   189 
       
   190 #endif // CAMLOCATIONSETTINGPAGE_H
       
   191 
       
   192 // End of File