idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingscontainer.h
changeset 0 79c6a41cd166
child 1 844b978f8d5e
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2009 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:  MCS settings plug-in container.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMCSPLUGINSETTINGSCONTAINER_H
       
    20 #define CMCSPLUGINSETTINGSCONTAINER_H
       
    21 
       
    22 // External includes
       
    23 #include <gsbasecontainer.h>
       
    24 #include <mcsmenu.h>
       
    25 #include <mcsmenunotifier.h>
       
    26 #include <FavouritesDbObserver.h>   // For MFavouritesDbObserver
       
    27 #include <FavouritesDb.h>           // For RFavouritesDb
       
    28 #include <msvapi.h>                 // For MMsvSessionObserver
       
    29 
       
    30 // Internal includes
       
    31 #include "mcspluginwatcher.h"
       
    32 
       
    33 // Forward declaration
       
    34 class CAknRadioButtonSettingPage;
       
    35 class CMCSPluginSettingsModel;
       
    36 class CActiveFavouritesDbNotifier;
       
    37 class CMCSPluginWatcher;
       
    38 
       
    39 /**
       
    40  *  @ingroup group_mcsplugin
       
    41  *
       
    42  * Shortcut settings plug-in container
       
    43  *
       
    44  * @lib mcspluginsettings.lib
       
    45  * @since S60 v3.2
       
    46  */
       
    47 class CMCSPluginSettingsContainer : public CGSBaseContainer, 
       
    48     public MFavouritesDbObserver, public MMsvSessionObserver,
       
    49     public MMCSPluginWatcherObserver
       
    50 {
       
    51 
       
    52 public:
       
    53     /**
       
    54      * Public constructor
       
    55      */
       
    56     CMCSPluginSettingsContainer();
       
    57 
       
    58     /*
       
    59      * Descructor
       
    60      */
       
    61     virtual ~CMCSPluginSettingsContainer();
       
    62 
       
    63     /**
       
    64      * Sets pointer to settings plug-in model.
       
    65      *
       
    66      * @since S60 v3.2
       
    67      * @param aModel Pointer to settings plug-in model
       
    68      */
       
    69     void SetModel(CMCSPluginSettingsModel* aModel);
       
    70 
       
    71     /**
       
    72      * Handles a setting change command
       
    73      *
       
    74      * @since S60 v3.2
       
    75      */
       
    76     void HandleChangeCommandL();
       
    77 
       
    78     /**
       
    79      * Handles a help command
       
    80      *
       
    81      * @since S60 v9.1
       
    82      */
       
    83     void HandleHelpCommandL();
       
    84 
       
    85     /**
       
    86      * Dialog showing changed
       
    87      *
       
    88      * @since S60 v3.2
       
    89       */
       
    90     TBool IsChangeDialogShowing();
       
    91 
       
    92     /**
       
    93      * Close change dialog
       
    94      *
       
    95      * @since S60 v3.2
       
    96      */
       
    97     void CloseChangeDialog();
       
    98 
       
    99     /**
       
   100      * Reset current list
       
   101      *
       
   102      * @since S60 v3.2
       
   103      */
       
   104     void ResetCurrentListL(TInt aIndex);
       
   105 
       
   106     // from base class MMsvSessionObserver
       
   107 
       
   108     /**
       
   109      * Handles an event from the message server.
       
   110      * Not used, but must be defined to be able to use the messaging server.
       
   111      *
       
   112      * @since S60 v3.2
       
   113      * @param aEvent Indicates the event type.
       
   114      * @param aArg1 Event type-specific argument value
       
   115      * @param aArg2 Event type-specific argument value
       
   116      * @param aArg3 Event type-specific argument value
       
   117      */
       
   118     void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, 
       
   119         TAny* aArg2, TAny* aArg3 );
       
   120 
       
   121     // from base class MMCSPluginWatcherObserver
       
   122 
       
   123     /**
       
   124      * Hanle notify
       
   125      */
       
   126     void HandleNotifyL();
       
   127 
       
   128 private:
       
   129 
       
   130     /*
       
   131      * Leaving constructor
       
   132      * 
       
   133      * @param aRect
       
   134      */
       
   135     void ConstructL(const TRect& aRect);
       
   136 
       
   137     /**
       
   138      * Tells the settings container to start observing for changes in favorites
       
   139      * database and mailbox db.
       
   140      *
       
   141      */
       
   142     void StartObservingL();
       
   143 
       
   144     /**
       
   145      * Tells the settings container to stop observing for changes in favorites
       
   146      * database and mailbox db.
       
   147      *
       
   148      */
       
   149     void StopObserving();
       
   150 
       
   151     // from base class CGSBaseContainer
       
   152 
       
   153     /**
       
   154      * From CGSBaseContainer
       
   155      * Constructs the settings listbox
       
   156      *
       
   157      * @since S60 v3.2
       
   158      * @param aResLbxId Listbox resource id
       
   159      */
       
   160     void ConstructListBoxL(TInt aResLbxId);
       
   161 
       
   162     /**
       
   163      * Chandles a setting change command to select application from a list
       
   164      *
       
   165      * @since S60 v3.2
       
   166      * @param aItem Applist item to modify
       
   167      * @param aNew ETrue if selecting an application for first time, 
       
   168      *             EFalse if not
       
   169      * @return ETrue if shortcut was changed. EFalse if not
       
   170      */
       
   171     TBool HandleAppListChangeCommandL( const TInt& aIndex,
       
   172         const TInt& aSettingIndex );
       
   173 
       
   174     /**
       
   175      * Chandles a setting change command to select bookmark from a list
       
   176      *
       
   177      * @since S60 v3.2
       
   178      * @param aItem Applist item to modify
       
   179      * @param aNew ETrue if selecting an application for first time, 
       
   180      *             EFalse if not
       
   181      * @return ETrue if shortcut was changed. EFalse if not
       
   182      */
       
   183     TBool HandleBookmarkChangeCommandL( const TInt& aIndex,
       
   184         const TInt& aSettingIndex );
       
   185 
       
   186     /**
       
   187      * Creates Help Context for launching Shortcuts Help page.
       
   188      */
       
   189     TCoeHelpContext GetHelpContext() const;
       
   190 
       
   191     /**
       
   192      * Offer key event
       
   193      * 
       
   194      * @param aKeyEvent
       
   195      * @param aType
       
   196      */
       
   197     TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
   198 
       
   199     /**
       
   200      * Checks if there is a need to update the middle softkey label.
       
   201      */
       
   202     void CheckMiddleSoftkeyLabelL();
       
   203 
       
   204     // From MFavouritesDbObserver
       
   205     /**
       
   206      * Handles database event.
       
   207      * @param aEvent Database event.
       
   208      */
       
   209     void HandleFavouritesDbEventL(RDbNotifier::TEvent aEvent);
       
   210 
       
   211 private:  // data
       
   212 
       
   213     /**
       
   214      * Settings plug-in model.
       
   215      * Not own.
       
   216      */
       
   217     CMCSPluginSettingsModel*       iModel;
       
   218 
       
   219     /**
       
   220      * Application selection list page.
       
   221      * Own.
       
   222      */
       
   223     CAknRadioButtonSettingPage* iAppListDialog;
       
   224 
       
   225     /**
       
   226      * Bookmark selection list page.
       
   227      * Own.
       
   228      */
       
   229     CAknRadioButtonSettingPage* iBkmListDialog;
       
   230 
       
   231     /**
       
   232      * Bookmark database change observer.
       
   233      * Own.
       
   234      */
       
   235     CActiveFavouritesDbNotifier* iBookmarkDbObserver;
       
   236 
       
   237     /**
       
   238      * Bookmark database.
       
   239      */
       
   240     RFavouritesDb iBookmarkDb;
       
   241 
       
   242     /**
       
   243      * Bookmark database session.
       
   244      */
       
   245     RFavouritesSession iBookmarkSession;
       
   246 
       
   247     /**
       
   248      * Message server session
       
   249      * Own.
       
   250      */
       
   251     CMsvSession* iMsvSession;
       
   252 
       
   253     // MCS resource
       
   254     RMenu iMenu;
       
   255 
       
   256     // MCS change notifier
       
   257     RMenuNotifier iNotifier;
       
   258 
       
   259     /* MCS change notifier watcher
       
   260      * Own
       
   261      */
       
   262     CMCSPluginWatcher* iNotifyWatcher;
       
   263 };
       
   264 
       
   265 #endif // CMCSPLUGINSETTINGSCONTAINER_H
       
   266 
       
   267 // End of File.