idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsapplist.h
branchRCL_3
changeset 14 15e4dd19031c
parent 8 d0529222e3f0
equal deleted inserted replaced
12:502e5d91ad42 14:15e4dd19031c
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 #ifndef CMCSPLUGINSETTINGSAPPLIST_H
    19 #ifndef CMCSPLUGINSETTINGSAPPLIST_H
    20 #define CMCSPLUGINSETTINGSAPPLIST_H
    20 #define CMCSPLUGINSETTINGSAPPLIST_H
    21 
    21 
    22 #include <e32base.h>
    22 #include <e32base.h>
    23 #include <bamdesca.h>   // For MDesCArray
    23 #include <bamdesca.h>   // For MDesCArray
    24 #include <apgcli.h>     // For RApaLsSession
       
    25 #include <msvapi.h>     // For MMsvSessionObserver
    24 #include <msvapi.h>     // For MMsvSessionObserver
    26 #include <apgnotif.h>   // For MApaAppListServObserver
       
    27 #include <mcsmenu.h>    // For MenuContentService
    25 #include <mcsmenu.h>    // For MenuContentService
    28 #include <propertymap.h>// For HSPS settings property map
    26 #include <propertymap.h>// For HSPS settings property map
    29 
    27 
    30 /**
       
    31  *  @ingroup group_mcsplugin
       
    32  *
       
    33  * Observer interface for application list events
       
    34  *
       
    35  * @since S60 v3.2
       
    36  */
       
    37 class MMCSPluginListObserver
       
    38 {
       
    39 public:
       
    40 
       
    41     /**
       
    42      * AppList event codes
       
    43      */
       
    44     enum TScutListEvent
       
    45     {
       
    46         EAppListReady,
       
    47         EAppListUpdated,
       
    48         EBkmListUpdated
       
    49     };
       
    50 
       
    51     /**
       
    52      * Callback for application list events
       
    53      *
       
    54      * @since S60 v3.2
       
    55      * @param aEvent AppList event code
       
    56      * @param aAdded ETrue if applications were added, EFalse if removed
       
    57      */
       
    58     virtual void HandleScutListEventL( 
       
    59         TScutListEvent aEvent, TBool aAdded ) = 0;
       
    60 
       
    61    // virtual TBool IsHidden(const TUid& aAppUid) const = 0;
       
    62 
       
    63 };
       
    64 
       
    65 struct TSettingItem;
    28 struct TSettingItem;
    66 /**
    29 class CMenuItem;
    67  * Application list for settings listbox
       
    68  *
       
    69  * @since S60 v3.2
       
    70  */
       
    71 
       
    72 class CMCSPluginWatcher;
       
    73 
    30 
    74 /**
    31 /**
    75  *  @ingroup group_mcsplugin
    32  *  @ingroup group_mcsplugin
    76  *
    33  *
    77  * MCSPluginSettingsAppList class
    34  * MCSPluginSettingsAppList class
    78  *
    35  *
    79  * @since S60 v9.1
    36  * @since S60 v9.1
    80  */
    37  */
    81 class CMCSPluginSettingsAppList : public CBase, //public CActive
    38 class CMCSPluginSettingsAppList : public CBase,
    82     public MDesCArray, public MMsvSessionObserver
    39     public MDesCArray, public MMsvSessionObserver
    83 {
    40 {
    84 
    41 
    85 public:
    42 public:
    86     /**
    43     /**
   141      */
    98      */
   142     void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, 
    99     void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, 
   143         TAny* aArg3 );
   100         TAny* aArg3 );
   144 
   101 
   145     /**
   102     /**
   146      * Starts the asynchronous appliation list initialization
   103      * Starts the asynchronous application list initialization
   147      *
   104      *
   148      * @since S60 v3.2
   105      * @since S60 v3.2
   149      */
   106      */
   150     void StartL();
   107     void StartL();
   151 
   108 
   152     /**
   109     /**
   153      * FindItemL
   110      * Finds item from item array based on property values.
   154      *
   111      *
   155      * @since S60 
   112      * @since S60 
   156      * @param aProperties
   113      * @param aProperties
   157      * @return TSettingItem
   114      * @return TSettingItem
   158      */
   115      */
   159     TSettingItem FindItemL( RPointerArray<HSPluginSettingsIf::CPropertyMap>& 
   116     TSettingItem FindItemL( RPointerArray<HSPluginSettingsIf::CPropertyMap>& 
   160         aProperties );
   117         aProperties );
   161 
   118 
   162     /**
   119     /**
   163      * 
   120      * Returns menu item from list, based on given index
   164      *
   121      *
   165      * @since S60 
   122      * @since S60 
   166      * @param 
   123      * @param aIndex List index
   167      * @return
   124      * @return
   168      */
   125      */
   169     CMenuItem& ItemL(const TInt& aIndex );
   126     CMenuItem* ItemL(const TInt& aIndex );
   170     /**
   127     
   171      * RemoveMenuItemL
   128     /**
   172      * 
   129      * Returns title for undefined item
   173      * @param aIndex
   130      */
   174      */
   131     TPtrC UndefinedText() { return *iUndefinedText; };
   175     void RemoveMenuItemL( TInt aIndex );
       
   176 
       
   177 protected:
       
   178 
   132 
   179 private:
   133 private:
   180     /**
   134     /**
   181      * Constructor
   135      * Constructor
   182      */
   136      */
   213      * @since S60 v3.2
   167      * @since S60 v3.2
   214      * @param aMailbox Name of the mailbox to add
   168      * @param aMailbox Name of the mailbox to add
   215      */
   169      */
   216     void AddMailboxL( const TDesC& aMailbox, const TDesC& aMailboxId );
   170     void AddMailboxL( const TDesC& aMailbox, const TDesC& aMailboxId );
   217 
   171 
   218     /**
       
   219      * GetID of MCS Plugin Folder
       
   220      * 
       
   221      * @return TInt
       
   222      */
       
   223     TInt GetMCSPluginFolderIdL();
       
   224 
       
   225     /**
       
   226      * Update menu items
       
   227      * 
       
   228      * @return TInt
       
   229      */
       
   230     TInt UpdateMenuItemsRefCountL( CMenuItem* aItem, TInt aValueToAdd );
       
   231 
       
   232 private:  // data
   172 private:  // data
   233 
   173 
   234     /**
   174     /**
   235      * List of application items
   175      * List of application items
   236      * Own.
   176      * Own.
   240     /**
   180     /**
   241      * Message server session
   181      * Message server session
   242      * Own.
   182      * Own.
   243      */
   183      */
   244     CMsvSession* iMsvSession;
   184     CMsvSession* iMsvSession;
   245 
       
   246     /**
       
   247      * Registered observer for application list events
       
   248      */
       
   249     //MMCSPluginListObserver& iObserver;
       
   250 
       
   251     /**
       
   252      * A flag indicating if the app list should observe changes
       
   253      */
       
   254     TBool iObserving;
       
   255 
       
   256     /**
   185     /**
   257      * iMenu
   186      * iMenu
   258      */
   187      */
   259     RMenu iMenu;
   188     RMenu iMenu;
   260 
   189 
   261     /**
   190     /**
   262      * iSaveWatcher
   191      * Name of "Undefined" application, own
   263      */
       
   264     CMCSPluginWatcher* iSaveWatcher;
       
   265 
       
   266     /**
       
   267      * iUpdateWatcher
       
   268      */
       
   269     CMCSPluginWatcher* iUpdateWatcher;
       
   270 
       
   271     /**
       
   272      * iRemoveWatcher
       
   273      */
       
   274     CMCSPluginWatcher* iRemoveWatcher;
       
   275 
       
   276     /**
       
   277      * iMCSPluginFolderId
       
   278      */
       
   279     TInt iMCSPluginFolderId;
       
   280 
       
   281 public:
       
   282     /**
       
   283      * Name of "Undefined" application
       
   284      */
   192      */
   285     HBufC* iUndefinedText;
   193     HBufC* iUndefinedText;
       
   194     
       
   195     /*
       
   196      * Undefined MCS item, own
       
   197      */
       
   198     CMenuItem* iUndefinedItem;
   286 };
   199 };
   287 
   200 
   288 #endif // CMCSPLUGINSETTINGSAPPLIST_H
   201 #endif // CMCSPLUGINSETTINGSAPPLIST_H
   289 
   202 
   290 // End of File.
   203 // End of File.