idlefw/plugins/mcsplugin/settings/inc/mcspluginsettingsapplist.h
branchRCL_3
changeset 30 a5a39a295112
child 31 8baec10861af
equal deleted inserted replaced
29:0efa10d348c0 30:a5a39a295112
       
     1 /*
       
     2 * Copyright (c) 2009 - 2010 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:  Application list for settings listbox.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CMCSPLUGINSETTINGSAPPLIST_H
       
    20 #define CMCSPLUGINSETTINGSAPPLIST_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <bamdesca.h>   // For MDesCArray
       
    24 #include <msvapi.h>     // For MMsvSessionObserver
       
    25 #include <mcsmenu.h>    // For MenuContentService
       
    26 #include <propertymap.h>// For HSPS settings property map
       
    27 
       
    28 struct TSettingItem;
       
    29 class CMenuItem;
       
    30 
       
    31 /**
       
    32  *  @ingroup group_mcsplugin
       
    33  *
       
    34  * MCSPluginSettingsAppList class
       
    35  *
       
    36  * @since S60 v9.1
       
    37  */
       
    38 class CMCSPluginSettingsAppList : public CBase,
       
    39     public MDesCArray, public MMsvSessionObserver
       
    40 {
       
    41 
       
    42 public:
       
    43     /**
       
    44      * Part of the two phased constuction
       
    45      * 
       
    46      * @return CMCSPluginSettingsAppList*
       
    47      */
       
    48     static CMCSPluginSettingsAppList* NewL();
       
    49 
       
    50     /**
       
    51      * CompareNameL
       
    52      * 
       
    53      * @param aFirst
       
    54      * @param aSecond
       
    55      */
       
    56     static TInt CompareNameL(const CMenuItem& aFirst, const CMenuItem& aSecond);
       
    57 
       
    58     /**
       
    59      * Destructor
       
    60      */
       
    61     virtual ~CMCSPluginSettingsAppList();
       
    62 
       
    63     // from base class MDesCArray
       
    64 
       
    65     /**
       
    66      * From MDesCArray
       
    67      * Returns the number of descriptor elements in a descriptor array.
       
    68      *
       
    69      * @since S60 v3.2
       
    70      * @return The number of descriptor elements in a descriptor array.
       
    71      */
       
    72     TInt MdcaCount() const;
       
    73 
       
    74     /**
       
    75      * From MDesCArray
       
    76      * Indexes into a descriptor array.
       
    77      *
       
    78      * @since S60 v3.2
       
    79      * @param aIndex The position of the descriptor element within a descriptor 
       
    80      *               array.
       
    81      * @return A 16 bit non-modifiable pointer descriptor representing the 
       
    82      *         descriptor element located at position aIndex within a descriptor 
       
    83      *         array.
       
    84      */
       
    85     TPtrC MdcaPoint( TInt aIndex ) const;
       
    86 
       
    87     // from base class MMsvSessionObserver
       
    88 
       
    89     /**
       
    90      * Handles an event from the message server.
       
    91      * Not used, but must be defined to be able to use the messaging server.
       
    92      *
       
    93      * @since S60 v3.2
       
    94      * @param aEvent Indicates the event type.
       
    95      * @param aArg1 Event type-specific argument value
       
    96      * @param aArg2 Event type-specific argument value
       
    97      * @param aArg3 Event type-specific argument value
       
    98      */
       
    99     void HandleSessionEventL( TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, 
       
   100         TAny* aArg3 );
       
   101 
       
   102     /**
       
   103      * Starts the asynchronous application list initialization
       
   104      *
       
   105      * @since S60 v3.2
       
   106      */
       
   107     void StartL();
       
   108 
       
   109     /**
       
   110      * Finds item from item array based on property values.
       
   111      *
       
   112      * @since S60 
       
   113      * @param aProperties
       
   114      * @return TSettingItem
       
   115      */
       
   116     TSettingItem FindItemL( RPointerArray<HSPluginSettingsIf::CPropertyMap>& 
       
   117         aProperties );
       
   118 
       
   119     /**
       
   120      * Returns menu item from list, based on given index
       
   121      *
       
   122      * @since S60 
       
   123      * @param aIndex List index
       
   124      * @return
       
   125      */
       
   126     CMenuItem* ItemL(const TInt& aIndex );
       
   127     
       
   128     /**
       
   129      * Returns title for undefined item
       
   130      */
       
   131     TPtrC UndefinedText() { return *iUndefinedText; };
       
   132 
       
   133 private:
       
   134     /**
       
   135      * Constructor
       
   136      */
       
   137     CMCSPluginSettingsAppList();
       
   138 
       
   139     /**
       
   140      * Second-phase constructor.
       
   141      */
       
   142     void ConstructL();
       
   143 
       
   144     /**
       
   145      * Adds the static list items to the application list.
       
   146      * For example "New Message" and "New Email" items are added here.
       
   147      *
       
   148      * @since S60 v3.2
       
   149      */
       
   150     void AddStaticItemsL();
       
   151 
       
   152     /**
       
   153      * Finds all mailboxes defined in the device
       
   154      */
       
   155     CMsvEntry* GetRootEntryL();
       
   156 
       
   157     /**
       
   158      * Adds remote mailboxes to the application list.
       
   159      *
       
   160      * @since S60 v3.2
       
   161      */
       
   162     void AddMailboxesL();
       
   163 
       
   164     /**
       
   165      * Adds a mailbox to the list
       
   166      *
       
   167      * @since S60 v3.2
       
   168      * @param aMailbox Name of the mailbox to add
       
   169      */
       
   170     void AddMailboxL( const TDesC& aMailbox, const TDesC& aMailboxId );
       
   171 
       
   172 private:  // data
       
   173 
       
   174     /**
       
   175      * List of application items
       
   176      * Own.
       
   177      */
       
   178     RPointerArray<CMenuItem> iListItems;
       
   179 
       
   180     /**
       
   181      * Message server session
       
   182      * Own.
       
   183      */
       
   184     CMsvSession* iMsvSession;
       
   185     /**
       
   186      * iMenu
       
   187      */
       
   188     RMenu iMenu;
       
   189 
       
   190     /**
       
   191      * Name of "Undefined" application, own
       
   192      */
       
   193     HBufC* iUndefinedText;
       
   194     
       
   195     /*
       
   196      * Undefined MCS item, own
       
   197      */
       
   198     CMenuItem* iUndefinedItem;
       
   199 };
       
   200 
       
   201 #endif // CMCSPLUGINSETTINGSAPPLIST_H
       
   202 
       
   203 // End of File.