profilesapplication/Profiles/GSProfilesPlugin/inc/GSProfilesPlugin.h
branchRCL_3
changeset 18 b7fa36b488f8
parent 17 861562a14a53
child 19 cd54903d48da
equal deleted inserted replaced
17:861562a14a53 18:b7fa36b488f8
     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:  GSProfilesPlugin implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef GSPROFILESPLUGIN_H
       
    19 #define GSPROFILESPLUGIN_H
       
    20 
       
    21 // User includes
       
    22 
       
    23 #include <psmpluginbase.h>  // power save management plugin base
       
    24 
       
    25 
       
    26 // System includes
       
    27 #include <gsplugininterface.h>
       
    28 #include <ConeResLoader.h>
       
    29 #include <AknServerApp.h>
       
    30 
       
    31 // Classes referenced
       
    32 class CAknNullService;
       
    33 class CRepository;
       
    34 class CApaDocument;
       
    35 // Constants
       
    36 const TUid KGSProfilesPluginUID       = { 0x10283386 };  // dll uid
       
    37 const TUid KGSProfilesPluginImplUID   = { 0x10283387 };  // dll impl uid
       
    38 const TUid KGsProfilesAppUid          = { 0x100058F8 };  // from ProfileApp.mmp
       
    39 
       
    40 _LIT( KGSProfilesApp,    "z:\\sys\\bin\\ProfileApp.exe" );
       
    41 _LIT( KGSProfilesPluginResourceFileName, "z:GSProfilesPluginRsc.rsc" );
       
    42 _LIT( KGSProfilesPluginIconDirAndName, "z:GSProfilesPlugin.mbm"); // Use KDC_BITMAP_DIR
       
    43 
       
    44 
       
    45 enum TPsmPluginKeys
       
    46     {
       
    47     EPsmPluginKeyVibra = 1,
       
    48     EPsmPluginKeyKbdVolume = 2,
       
    49     EPsmPluginTactileFeedback = 3,
       
    50     EPsmPluginAudioFeedback = 4
       
    51     };
       
    52 
       
    53 
       
    54 // CLASS DECLARATION
       
    55 
       
    56 //For embedding CC in CS
       
    57 class TAppInfo
       
    58     {
       
    59     public:
       
    60         TAppInfo( TUid aUid, const TDesC& aFile )
       
    61             : iUid( aUid ), iFile( aFile )
       
    62             {}
       
    63         TUid iUid;
       
    64         TFileName iFile;
       
    65     };
       
    66 
       
    67 
       
    68 /**
       
    69 * CGSProfilesPlugin.
       
    70 *
       
    71 * This class handles state and application logic of CGSProfilesPlugin.
       
    72 * The plugin is a type of EGSItemTypeSettingDialog and therefore the GS FW will
       
    73 * call HandleSelection() instead of DoActivate(). No CAknView functionality is
       
    74 * supported even though the base class is CAknView derived via
       
    75 * CGSPluginInterface.
       
    76 *
       
    77 */
       
    78 class CGSProfilesPlugin : public CGSPluginInterface,
       
    79                           public MAknServerAppExitObserver // Embedding
       
    80     {
       
    81     public: // Constructors and destructor
       
    82 
       
    83         /**
       
    84         * Symbian OS two-phased constructor
       
    85         * @return
       
    86         */
       
    87         static CGSProfilesPlugin* NewL( TAny* aInitParams );
       
    88 
       
    89         /**
       
    90         * Destructor.
       
    91         */
       
    92         ~CGSProfilesPlugin();
       
    93 
       
    94     public: // From CAknView
       
    95 
       
    96         /**
       
    97         * See base class.
       
    98         */
       
    99         TUid Id() const;
       
   100 
       
   101     public: // From CGSPluginInterface
       
   102 
       
   103         /**
       
   104         * See base class.
       
   105         */
       
   106         void GetCaptionL( TDes& aCaption ) const;
       
   107 
       
   108         /**
       
   109         * See base class.
       
   110         */
       
   111         TInt PluginProviderCategory() const;
       
   112 
       
   113         /**
       
   114         * See base class.
       
   115         */
       
   116         TGSListboxItemTypes ItemType();
       
   117 
       
   118         /**
       
   119         * See base class.
       
   120         */
       
   121         void GetValue( const TGSPluginValueKeys aKey,
       
   122                        TDes& aValue );
       
   123 
       
   124         /**
       
   125         * See base class.
       
   126         */
       
   127         void HandleSelection( const TGSSelectionTypes aSelectionType );
       
   128         
       
   129         /**
       
   130         * See base class.
       
   131         */
       
   132         CGulIcon* CreateIconL( const TUid aIconType );
       
   133 
       
   134     protected: // New
       
   135 
       
   136         /**
       
   137         * C++ default constructor.
       
   138         */
       
   139         CGSProfilesPlugin();
       
   140 
       
   141         /**
       
   142         * Symbian OS default constructor.
       
   143         */
       
   144         void ConstructL();
       
   145 
       
   146     protected: // From CAknView
       
   147 
       
   148         /**
       
   149         * This implementation is empty because this class, being just a dialog,
       
   150         * does not implement the CAknView finctionality.
       
   151         */
       
   152         void DoActivateL( const TVwsViewId& aPrevViewId,
       
   153                           TUid aCustomMessageId,
       
   154                           const TDesC8& aCustomMessage );
       
   155 
       
   156         /**
       
   157         * This implementation is empty because this class, being just a dialog,
       
   158         * does not implement the CAknView finctionality.
       
   159         */
       
   160         void DoDeactivate();
       
   161 
       
   162     private:
       
   163 
       
   164         /**
       
   165         * Opens localized resource file.
       
   166         */
       
   167         void OpenLocalizedResourceFileL(
       
   168             const TDesC& aResourceFileName,
       
   169             RConeResourceLoader& aResourceLoader );
       
   170 
       
   171         /**
       
   172         * Launches provisioning application.
       
   173         */
       
   174         void LaunchProfilesAppL();
       
   175         
       
   176         /**
       
   177         * Launches application as embedded.
       
   178         */
       
   179         void EmbedAppL( const TAppInfo& aApp );
       
   180         
       
   181     protected:
       
   182 
       
   183         // Resource loader.
       
   184         RConeResourceLoader iResources;
       
   185         
       
   186         CAknNullService* iNullService;
       
   187         
       
   188         CApaDocument* iEmbedded;
       
   189     };
       
   190 
       
   191 
       
   192 
       
   193 
       
   194 class TPsmSettingItems
       
   195     {
       
   196     public:
       
   197         TInt iVibraAlert;
       
   198         TInt iKeypadVolume;
       
   199         TInt iTactileFeedback;
       
   200         TInt iAudioFeedback;
       
   201     };
       
   202 
       
   203 
       
   204 /**
       
   205 * CPSMProfilesPlugin.
       
   206 *
       
   207 * Psm server calls this plugin is when power save mode changes. Plugin
       
   208 * is needed for writing psm specific setting values into profile 
       
   209 * central repository. These settings are vibrating alert, keypad volume,
       
   210 * tactile feedback and audio feedback. Psm values come from
       
   211 * psm server which reads them from CPSMProfilesPlugin .xml file
       
   212 * (10283386.xml).
       
   213 *
       
   214 */
       
   215 class CPSMProfilesPlugin : public CPsmPluginBase
       
   216     {
       
   217     public:
       
   218         
       
   219         /**
       
   220         * Two-phased constructor.
       
   221 		* @return The created object.
       
   222         */
       
   223         static CPSMProfilesPlugin* NewL( TPsmPluginCTorParams& initParams );
       
   224         
       
   225         /**
       
   226         * Destructor.
       
   227         */
       
   228         virtual ~CPSMProfilesPlugin();
       
   229 
       
   230 	private:
       
   231 	    CPSMProfilesPlugin( TPsmPluginCTorParams& aInitParams );
       
   232 	    void ConstructL();
       
   233 	    
       
   234 
       
   235     public: // From CPsmPluginBase
       
   236         void NotifyModeChange( const TInt aMode );
       
   237 
       
   238 	private:
       
   239 	    void NotifyModeChangeL( const TInt aMode );
       
   240         void GetPsmConfigSettingsL( TPsmSettingItems& aItems );
       
   241 	    void GetActiveProfileSettingsL( TPsmSettingItems& aItems );
       
   242 	    //void GetActiveProfileSettings2L( TPsmSettingItems& aItems );
       
   243 	    TUint32 ResolveKey( TUint aPartialKey, TInt aProfileId );
       
   244 	    void CPSMProfilesPlugin::Panic( TInt aReason );
       
   245     };
       
   246 
       
   247 
       
   248 
       
   249 
       
   250 #endif // GSPROFILESPLUGIN_H
       
   251 // End of File