camerauis/cameraapp/generic/inc/CamContextAwareSettingPage.h
changeset 0 1ddebce53859
equal deleted inserted replaced
-1:000000000000 0:1ddebce53859
       
     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 CAknEnumeratedItems.*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CAMCONTEXTAWARESETTINGPAGE_H
       
    21 #define CAMCONTEXTAWARESETTINGPAGE_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <AknPopupSettingPage.h>
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // MACROS
       
    29 
       
    30 // DATA TYPES
       
    31 
       
    32 // FUNCTION PROTOTYPES
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CAknEnumeratedTextPopupSettingItem;
       
    36 class CCamAppController;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  Setting page class similar to standard avkon CAknPopupSettingPage.
       
    42 *  Allows the Cba to be updated dynamically according to any limitations 
       
    43 *  on available items imposed by other setting values or available
       
    44 *  memory
       
    45 *
       
    46 *  @since 2.8
       
    47 */
       
    48 
       
    49 class CCamContextAwareSettingPage : public CAknPopupSettingPage
       
    50 	{
       
    51 public: // Constructors, etc.
       
    52 	/**
       
    53 	* Construct a list, storing in it a resource (to be read at 2nd stage construction)
       
    54 	* and a reference to an externally owned integer - the value to be manipulated
       
    55     * @since 2.8
       
    56     * @param aSettingText	Text at top of setting pane
       
    57     * @param aSettingNumber		Number at top left (if present)
       
    58     * @param aControlType			Determines the type constructed and how its resource is read
       
    59     * @param aEditorResourceId	Editor resource to use in the setting page (if present)
       
    60     * @param aSettingPageResourceId		Setting Page to use (if present)
       
    61     * @param aQueryValue			reference to a query value object
       
    62     * @param aParent reference to the list that created this page.
       
    63     * @param aController reference the the application controller
       
    64 	*/
       
    65 	CCamContextAwareSettingPage( 
       
    66 					const TDesC* aSettingText, 
       
    67 					TInt aSettingNumber, 
       
    68 					TInt aControlType,
       
    69 					TInt aEditorResourceId, 
       
    70 					TInt aSettingPageResourceId, 
       
    71 					MAknQueryValue& aQueryValue,
       
    72                     CAknEnumeratedTextPopupSettingItem& aParent,
       
    73                     CCamAppController& aController );
       
    74 
       
    75     /**
       
    76 	* Destructor
       
    77     * @since 2.8
       
    78 	*/
       
    79     ~CCamContextAwareSettingPage();
       
    80 
       
    81     /**
       
    82     * Symbian 2nd phase constructor.
       
    83     * @since 2.8
       
    84     */
       
    85     void ConstructL();
       
    86 
       
    87 public: // From base class
       
    88 
       
    89     /**
       
    90     * From CAknSettingPage
       
    91     * Called when the state of the list box changes.
       
    92     * Used to update the Cba when the list box is navigated.
       
    93     * @since 2.8
       
    94     */
       
    95     void UpdateSettingL();
       
    96 
       
    97     /**
       
    98     * From CAknSettingPage
       
    99     * Processes events from the softkeys. Responds to EAknSoftkeyOk and EAknSoftkeyBack
       
   100     * to accept or cancel the pop-up.
       
   101     * @since 2.8
       
   102     * @param aCommandId	Event Id from the soft-key
       
   103     */
       
   104     void ProcessCommandL( TInt aCommandId );
       
   105     
       
   106     /**
       
   107     * From CAknSettingPage
       
   108     * Puts up a constructed dialog. Part of the non-waiting API calls.    
       
   109     * Activity to perform as soon as the setting page is displayed
       
   110     * @since 2.8
       
   111     * @return Whether check succeeded
       
   112     */
       
   113     TBool PostDisplayCheckL();
       
   114 
       
   115 private:
       
   116     /**
       
   117     * Called when the setting value is to be previewed
       
   118     * @since 2.8
       
   119     * @param aPtr pointer to the object that called the timer
       
   120     * @return Error code
       
   121     */
       
   122     static TInt PreviewSettingChange( TAny* aPtr );
       
   123 
       
   124 private: // data
       
   125     // Used to retrieve the settings value for the currently
       
   126     // highlighted list item.
       
   127     CAknEnumeratedTextPopupSettingItem& iParent;
       
   128     // Used to determine whether a particular setting value is
       
   129     // enabled or disabled for selection.
       
   130     CCamAppController& iController;
       
   131     // Used to perform the preview setting change
       
   132     CPeriodic* iTimer;
       
   133     // the current value of the setting item
       
   134     TInt iCurrentVal;
       
   135 	};
       
   136 
       
   137 #endif // CAMCONTEXTAWARESETTINGITEM_H
       
   138 
       
   139 // End of File