gssettingsuis/Gs/GSDisplayPlugin/Inc/GSDisplayPlugin.h
branchRCL_3
changeset 24 8ee96d21d9bf
parent 23 8bda91a87a00
child 25 7e0eff37aedb
equal deleted inserted replaced
23:8bda91a87a00 24:8ee96d21d9bf
     1 /*
       
     2 * Copyright (c) 2005 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:  View for Display settings.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef GSDISPLAYPLUGIN_H
       
    20 #define GSDISPLAYPLUGIN_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <aknsettingpage.h>
       
    24 #include <ConeResLoader.h>
       
    25 #include <gsplugininterface.h>
       
    26 #include <gsfwviewuids.h>
       
    27 #include <gsbaseview.h>
       
    28 #include <MMGFetchVerifier.h>
       
    29 #include <mgsasyncimagehandlingobserver.h>
       
    30 #include <backgroundimage.h>
       
    31 #include <eikmenup.h>
       
    32 
       
    33 #ifdef FF_POWER_SAVE
       
    34     #include <psmtypes.h>
       
    35 #endif // FF_POWER_SAVE
       
    36 
       
    37 // CONSTANTS
       
    38 const TUid KGSDisplayPluginUid = { 0x10207441 };
       
    39 _LIT( KGSDefaultDisplayIconFileName, "Z:\\resource\\apps\\GSDisplayplugin.mbm");
       
    40 _LIT( KGSDisplayPluginIconFileName, "\\resource\\apps\\GSDisplayplugin.mif");
       
    41 
       
    42 const TInt KGSOpLogoLbxIndexOn = 0;
       
    43 const TInt KGSOpLogoLbxIndexOff = 1;
       
    44 // MACROS
       
    45 
       
    46 // DATA TYPES
       
    47 
       
    48 // FUNCTION PROTOTYPES
       
    49 
       
    50 // FORWARD CLASS DECLARATION
       
    51 class CAknViewAppUi;
       
    52 class CAknWaitDialog;
       
    53 class CAknRadioButtonSettingPage;
       
    54 //class CAknQueryDialog;
       
    55 class CGSDisplayPluginContainer;
       
    56 class CGSDisplayPluginModel;
       
    57 
       
    58 #ifdef FF_POWER_SAVE
       
    59     class CGSDisplayPluginAO;
       
    60 #endif // FF_POWER_SAVE
       
    61     
       
    62 // CLASS DECLARATION
       
    63 /**
       
    64 *  CGSDisplayPlugin view class
       
    65 *
       
    66 *  Plugin implementation for Display settings
       
    67 *  @lib GSDisplayPlugin.lib
       
    68 *  @since Series 60_3.1
       
    69 */
       
    70 class CGSDisplayPlugin : public CGSBaseView, 
       
    71                          public MAknSettingPageObserver,
       
    72                          public MMGFetchVerifier,
       
    73                          public MGSAsyncImageHandlingObserver
       
    74     {
       
    75     public:
       
    76     
       
    77        enum TGSSettingIds
       
    78             {
       
    79             KGSContrastSettingId,
       
    80             KGSBrightnessSettingId,
       
    81             KGSSaverObjectSettingId,
       
    82             KGSAutodisconSettingId,
       
    83             KGSWelcomeNoteSettingId,
       
    84             KGSAmbientLightSensorId
       
    85             };
       
    86             
       
    87     public: // Constructors and destructor
       
    88 
       
    89         /**
       
    90         * Symbian OS two-phased constructor
       
    91         * @return GS connection view.
       
    92         */
       
    93         static CGSDisplayPlugin* NewL( TAny* aInitParams );
       
    94 
       
    95         /**
       
    96         * Destructor.
       
    97         */
       
    98         ~CGSDisplayPlugin();
       
    99 
       
   100     public: // from base classes
       
   101         
       
   102         /**
       
   103         * Returns view id.
       
   104         * @return TUid
       
   105         */
       
   106         TUid Id() const;
       
   107 
       
   108         /**
       
   109         * Handles commands.
       
   110         * @param aCommand Command to be handled.
       
   111         * 
       
   112         */
       
   113         void HandleCommandL( TInt aCommand );
       
   114 
       
   115     public: // From CGSPluginInterface
       
   116 
       
   117         /**
       
   118         * @see CGSPluginInterface header file.
       
   119         */
       
   120         void GetCaptionL( TDes& aCaption ) const;
       
   121         
       
   122         /**
       
   123         * @see CGSPluginInterface header file.
       
   124         */
       
   125         TInt PluginProviderCategory() const;
       
   126         
       
   127         /**
       
   128         * See base class.
       
   129         */
       
   130         CGulIcon* CreateIconL( const TUid aIconType );
       
   131         
       
   132     public: // from MAknSettingPageObserver
       
   133         
       
   134         /**
       
   135         * Handle setting page events
       
   136         */
       
   137         virtual void HandleSettingPageEventL( CAknSettingPage* aSettingPage,
       
   138                                             TAknSettingPageEvent aEventType );
       
   139             
       
   140     public: //new
       
   141 
       
   142         /**
       
   143         * Updates listbox's item's value.
       
   144         * @param aItemId An item which is updated.
       
   145         * 
       
   146         */
       
   147         void UpdateListBoxL( TInt aItemId );
       
   148         
       
   149         /**
       
   150         * Get CGSDisplayPlugin's ccontainer.
       
   151         */
       
   152         CGSDisplayPluginContainer* Container();
       
   153 
       
   154         
       
   155         /**
       
   156         * Updates display plugin view.
       
   157         */
       
   158         void UpdateViewL();
       
   159         void CloseDialog();
       
   160         
       
   161     protected: // From CAknView 
       
   162 
       
   163         void DoActivateL( const TVwsViewId& aPrevViewId,
       
   164                           TUid aCustomMessageId,
       
   165                           const TDesC8& aCustomMessage );
       
   166         void DoDeactivate();
       
   167         
       
   168     protected: // From MEikMenuObserver
       
   169 
       
   170         void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
       
   171     
       
   172     protected:
       
   173 
       
   174         /**
       
   175         * C++ default constructor.
       
   176         */
       
   177         CGSDisplayPlugin();
       
   178 
       
   179         /**
       
   180         * Symbian OS default constructor.
       
   181         * 
       
   182         */
       
   183         void ConstructL();
       
   184         
       
   185         void HandleClientRectChange();
       
   186 
       
   187     private: // from CGSBaseView
       
   188         
       
   189         void NewContainerL();
       
   190         void HandleListBoxSelectionL();
       
   191         
       
   192     private: //from MMGFetchVerifier
       
   193         
       
   194         /**
       
   195         * Display Backlight setting page
       
   196         */
       
   197         TBool VerifySelectionL( const MDesCArray* aSelectedFiles );
       
   198     
       
   199     private: //from MGSSyncImageHandlingObserver
       
   200         /**
       
   201         * Display Welcome note image list from media gallery
       
   202         */
       
   203         void ImageHandlingCompleteL( TInt aError );
       
   204     
       
   205     private: //new methods
       
   206         
       
   207         /**
       
   208         * Display Constrast setting page
       
   209         */
       
   210         void ShowContrastSettingPageL();
       
   211         
       
   212         /**
       
   213         * Display Brightness setting page
       
   214         */
       
   215         void ShowBrightnessSettingPageL();
       
   216         
       
   217         /**
       
   218         * Display ALS setting page
       
   219         */
       
   220         void ShowAmbientLightSensorSettingPageL();
       
   221         
       
   222         /**
       
   223         * Display Screen saver timeout setting page
       
   224         */
       
   225         void ShowScreenSaverPeriodSettingPageL();
       
   226         
       
   227         /**
       
   228         * Display Backlight setting page
       
   229         */
       
   230         void ShowBacklightSettingPageL();
       
   231         
       
   232         /**
       
   233         * Display Welcome note setting page
       
   234         */
       
   235         void ShowWelcomeNoteSettingPageL();
       
   236         
       
   237         /**
       
   238         * Display Welcome note text input dialog
       
   239         */
       
   240         void ShowWelcomeNoteTextQueryL();
       
   241     
       
   242         /**
       
   243         * Display Welcome note image list from media gallery
       
   244         */
       
   245         void ShowWelcomeNoteImageListL();
       
   246 
       
   247 
       
   248         /**
       
   249         * Show display text size setting page
       
   250         */
       
   251         void ShowDisplayTextSizeSettingPageL();
       
   252 
       
   253 
       
   254         /**
       
   255         * Display Power save LED setting page
       
   256         * @param aSettingPage ETrue if setting page is to be shown
       
   257         *                     EFalse, otherwise
       
   258         */
       
   259         void ShowPowerSaveLedSettingPageL( TBool aSettingPage );
       
   260         
       
   261         /**
       
   262         * Display load wait-note dialog during image loading
       
   263         */
       
   264         void ShowImageLoadWaitNoteL();
       
   265         
       
   266         /**
       
   267         * Hide load wait-note dialog after the image is loaded
       
   268         */
       
   269         void HideImageLoadWaitNoteL();
       
   270         
       
   271         /**
       
   272         * Check if the input file is DRM protected
       
   273         * @param aOriginalFileName Path of the bitmap file
       
   274         * @return ETrue if file is DRM protected.
       
   275         *         EFalse otherwise.
       
   276         */
       
   277         TBool CheckDRMProtectionL( const TDesC& aOriginalFileName );
       
   278         
       
   279         /**
       
   280         * Handle any errors during image processing
       
   281         * @param aError system wide error code
       
   282         */
       
   283         void HandleImageErrorsL( TInt aError );
       
   284 
       
   285         /**
       
   286         * Changes operator logo value.
       
   287         * @param aUseSettingPage ETrue if setting page should be used.
       
   288         *                        EFalse is just switch between the values.
       
   289         */
       
   290         void ChangeOperatorLogoSettingL( TBool aUseSettingPage );
       
   291 
       
   292         /**
       
   293         * Displays operator logo setting page.
       
   294         * @param aOperatorLogoValue current operator logo value.
       
   295         */
       
   296         TBool ShowOperatorLogoSettingPageL( TInt& aOperatorLogoValue );
       
   297 #ifdef FF_POWER_SAVE    
       
   298         /**
       
   299          *  Displays blocking note. Used if PSM is on.
       
   300          */
       
   301         void DisplayBlockNoteL();
       
   302 #endif // FF_POWER_SAVE
       
   303         
       
   304     protected:
       
   305         //check if screen saver text is to be updated
       
   306         TBool iUpdateSSText;
       
   307         //check if welcome note is supported
       
   308         TBool iUpdateWNote;
       
   309         // for load wait dialog
       
   310         CAknWaitDialog* iWaitDialog;
       
   311         CAknRadioButtonSettingPage* iOprtLogoSettingPage;
       
   312                 
       
   313     private:
       
   314         // plugin model
       
   315         CGSDisplayPluginModel *iModel;
       
   316         // resource loader
       
   317         RConeResourceLoader iResourceLoader;
       
   318         //for image handling
       
   319         CGSAsyncImageHandling* iImageHandler;
       
   320         //welcome note type: none, text, image       
       
   321         TInt iWelcomeNoteType;
       
   322         TBool iReshowOprtSetPage;
       
   323 #ifdef FF_POWER_SAVE
       
   324         // Active object for handling PSM realted CenRep events.
       
   325         CGSDisplayPluginAO* iPsmActive;
       
   326 #endif // FF_POWER_SAVE
       
   327         // Prevent multiple launch the MFetch.
       
   328         TBool iLaunchedImageFetch;
       
   329         
       
   330     };
       
   331 
       
   332    
       
   333     #endif // GSDISPLAYPLUGIN_H
       
   334 
       
   335 //End of File