commsconfig/cscsettingsui/inc/cscsettingsuimaincontainer.h
branchRCL_3
changeset 11 6134b5029079
parent 0 a4daefaec16c
child 20 65a3ef1d5bd0
equal deleted inserted replaced
10:ed1e38b404e5 11:6134b5029079
     1 /*
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2007-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".
    17 
    17 
    18 
    18 
    19 #ifndef C_CSCSETTINGSUIMAINCONTAINER_H
    19 #ifndef C_CSCSETTINGSUIMAINCONTAINER_H
    20 #define C_CSCSETTINGSUIMAINCONTAINER_H
    20 #define C_CSCSETTINGSUIMAINCONTAINER_H
    21 
    21 
       
    22 #include "mcscengserviceobserver.h"
       
    23 #include "mcscengprovisioningobserver.h"
       
    24 
    22 class CCSCSettingsUiModel;
    25 class CCSCSettingsUiModel;
    23 class CAknSettingStyleListBox;
    26 class CAknSettingStyleListBox;
       
    27 class MCSCEngServiceObserver;
       
    28 class MCSCEngProvisioningObserver;
    24 
    29 
    25 /**
    30 /**
    26  *  TListBoxItem class
    31  *  TListBoxItem class
    27  *
    32  *
    28  *  @lib CSCSettingsUi.lib
    33  *  @lib CSCSettingsUi.lib
    69  *  @lib CSCSettingsUi.lib
    74  *  @lib CSCSettingsUi.lib
    70  *  @since S60 v3.2
    75  *  @since S60 v3.2
    71  */
    76  */
    72 NONSHARABLE_CLASS( CCSCSettingsUiMainContainer ) : public CCoeControl
    77 NONSHARABLE_CLASS( CCSCSettingsUiMainContainer ) : public CCoeControl
    73     {
    78     {
    74     public:
    79 public:
       
    80 
       
    81     CCSCSettingsUiMainContainer(
       
    82         CCSCSettingsUiModel& aModel );
       
    83     void ConstructL( const TRect& aRect );
       
    84     virtual ~CCSCSettingsUiMainContainer();
       
    85 
       
    86     /**
       
    87      * Updates container and redraws listbox items.
       
    88      *
       
    89      * @since S60 v3.2
       
    90      */
       
    91     void UpdateContainerL();
       
    92 
       
    93     /**
       
    94      * Shows a query which changes handover notification tone setting
       
    95      *
       
    96      * @since S60 v5.0
       
    97      */
       
    98     void HandoverNotificationToneQueryL();
       
    99 
       
   100     /**
       
   101      * Shows a query which changes presence request preference
       
   102      *
       
   103      * @since S60 v3.2
       
   104      */
       
   105     void PresenceReqPrefQueryL();
       
   106 
       
   107     /**
       
   108      * For saving IM tone path to service tab storage.
       
   109      *
       
   110      * @param aTonePath tone path to be saved.
       
   111      * @since S60 v5.0
       
   112      */
       
   113     void SaveImTonePathL( const TDesC& aTonePath );
       
   114 
       
   115     /**
       
   116      * Returns handle to the listbox.
       
   117      *
       
   118      * @since S60 v3.2
       
   119      * @return handle to the listbox
       
   120      */        
       
   121     CAknSettingStyleListBox* ListBox();
       
   122 
       
   123     /**
       
   124      * Returns selected list box item
       
   125      *
       
   126      * @since S60 v3.2
       
   127      * @return selected list box item
       
   128      */
       
   129     TMainListBoxItem CurrentItem() const;
       
   130 
       
   131     /**
       
   132      * Deletes the service in hand.
       
   133      *
       
   134      * @since S60 v5.2
       
   135      */
       
   136     void DeleteServiceL();
       
   137 
       
   138     /**
       
   139      * Launches cleanup plugin to remove settings.
       
   140      *
       
   141      * @since S60 v5.2
       
   142      * @param aServiceId ID of service to be removed.
       
   143      */ 
       
   144     void LaunchCleanupPluginL( TUint aServiceId ) const;
       
   145 
       
   146 // from base class CCoeControl
       
   147 
       
   148     /**
       
   149      * From CCoeControl.
       
   150      */ 
       
   151     CCoeControl* ComponentControl( TInt aIndex ) const;
       
   152 
       
   153     /**
       
   154      * From CCoeControl.
       
   155      */
       
   156     TKeyResponse OfferKeyEventL( 
       
   157         const TKeyEvent& aKeyEvent, 
       
   158         TEventCode aType );
       
   159 
       
   160     /**
       
   161      * From CCoeControl.
       
   162      */ 
       
   163     void HandleResourceChange( TInt aType );
       
   164 
       
   165 private:
    75     
   166     
    76         CCSCSettingsUiMainContainer(
   167     /**
    77             CCSCSettingsUiModel& aModel );
   168      * Creates listbox item for setting items.
    78         
   169      *
    79         
   170      * @since S60 v3.2
    80         void ConstructL(
   171      */
    81             const TRect& aRect );
   172     void ConstructListBoxL();
    82     
   173 
    83     
   174     /**
    84         virtual ~CCSCSettingsUiMainContainer();
   175      * Return caption for setting item.
    85     
   176      *
    86         
   177      * @since S60 v3.2
    87         /**
   178      * @param aItem for setting list item to be constructed
    88          * Updates container and redraws listbox items.
   179      * @return setting item caption
    89          *
   180      */
    90          * @since S60 v3.2
   181     HBufC* GetCaptionL( TMainListBoxItem::TSettingItems aItem );
    91          */
   182 
    92         void UpdateContainerL();
   183     /**
    93 
   184      * Get username.
    94         
   185      *
    95         /**
   186      * @since S60 v5.0
    96          * Shows a query which changes handover notification tone setting
   187      * @param aUsername username is set to this. 
    97          *
   188      */
    98          * @since S60 v5.0
   189     void GetUsernameL( RBuf& aUsername );
    99          */
   190 
   100         void HandoverNotificationToneQueryL();
   191     /**
   101         
   192      * Get preferred service setting.
   102         
   193      *
   103         /**
   194      * @since S60 v5.0
   104          * Shows a query which changes presence request preference
   195      * @param aValue presence pref setting value is stored to this.
   105          *
   196      */
   106          * @since S60 v3.2
   197     void GetPreferredServiceSettingL( RBuf& aValue );
   107          */
   198 
   108         void PresenceReqPrefQueryL();
   199     /**
   109         
   200      * Get preferred service setting when VCC is supported.
   110         /**
   201      *
   111           * For saving IM tone path to service tab storage.
   202      * @since S60 v5.0
   112           *
   203      * @param aValue presence pref setting value is stored to this.
   113           * @param aTonePath tone path to be saved.
   204      */
   114           * @since S60 v5.0
   205     void GetVccPreferredServiceSettingL( RBuf& aValue );
   115           */
   206 
   116          void SaveImTonePathL( const TDesC& aTonePath );
   207     /**
   117 
   208      * Get handover notification tone setting.
   118         
   209      *
   119         /**
   210      * @since S60 v5.0
   120          * Returns handle to the listbox.
   211      * @param aValue handover notification tone setting value is stored 
   121          *
   212      * to this.
   122          * @since S60 v3.2
   213      */
   123          * @return handle to the listbox
   214     void GetHandoverNotificationTonePrefL( RBuf& aValue );
   124          */        
   215 
   125         CAknSettingStyleListBox* ListBox();
   216     /**
   126         
   217      * Get precence preferred setting.
   127         
   218      *
   128        /**
   219      * @since S60 v5.0
   129          * Returns selected list box item
   220      * @param aValue presence pref setting value is stored to this.
   130          *
   221      */
   131          * @since S60 v3.2
   222     void GetPresencePrefSettingL( RBuf& aValue );
   132          * @return selected list box item
   223 
   133          */
   224     /**
   134         TMainListBoxItem CurrentItem() const;
   225      * Get IM message tone setting.
   135 
   226      *
   136 
   227      * @since S60 v5.0
   137         // from base class CCoeControl
   228      * @param aValue im tone setting value is stored to this.
   138 
   229      */
   139         /**
   230     void GetImToneSettingL( RBuf& aValue );
   140          * From CCoeControl.
   231 
   141          */ 
   232     /**
   142         CCoeControl* ComponentControl( TInt aIndex ) const;
   233      * Get SNAP settings.
   143   
   234      *
   144   
   235      * @since S60 v5.0
   145         /**
   236      * @param aValue snap setting value is stored to this.
   146          * From CCoeControl.
   237      */
   147          */
   238     void GetSnapSettingL( RBuf& aValue );
   148         TKeyResponse OfferKeyEventL( 
   239 
   149             const TKeyEvent& aKeyEvent, 
   240     /**
   150             TEventCode aType );
   241      * Draws setting items at the first time 
   151         
   242      * after the initialization is completed.
   152         
   243      *
   153         /**
   244      * @since S60 v3.2
   154          * From CCoeControl.
   245      */
   155          */ 
   246     void InitializeSettingItemsL();
   156         void HandleResourceChange( TInt aType );
   247 
   157 
   248     /**
   158 
   249      * Constructs setting list items.
   159     private:
   250      *
   160         
   251      * @since S60 v3.2
   161         /**
   252      * @param aItem for setting list item to be constructed
   162          * Creates listbox item for setting items.
   253      */
   163          *
   254     void MakeSettingItemL( TMainListBoxItem::TSettingItems aItem );
   164          * @since S60 v3.2
   255 
   165          */
   256     /**
   166         void ConstructListBoxL();
   257      * Cleanup RImplInfoPtrArray
   167         
   258      *
   168         
   259      * @since S60 v5.2
   169         /**
   260      * @param aArray Array to be destroyed.
   170          * Return caption for setting item.
   261      */
   171          *
   262      static void ResetAndDestroy( TAny* aArray );
   172          * @since S60 v3.2
   263 
   173          * @param aItem for setting list item to be constructed
   264 // from base class CCoeControl
   174          * @return setting item caption
   265 
   175          */
   266     /**
   176         HBufC* GetCaptionL( TMainListBoxItem::TSettingItems aItem );
   267      * From CCoeControl.
   177         
   268      */
   178         
   269     TInt CountComponentControls() const;
   179         /**
   270 
   180          * Get username.
   271     /**
   181          *
   272      * From CCoeControl
   182          * @since S60 v5.0
   273      */
   183          * @param aUsername username is set to this. 
   274     void GetHelpContext( TCoeHelpContext& aContext ) const;
   184          */
   275 
   185         void GetUsernameL( RBuf& aUsername );
   276     /**
   186         
   277      * From CCoeControl.
   187         
   278      */
   188         /**
   279     void SizeChanged();
   189          * Get preferred service setting.
   280 
   190          *
   281     /**
   191          * @since S60 v5.0
   282      * From CoeControl.
   192          * @param aValue presence pref setting value is stored to this.
   283      */        
   193          */
   284     void FocusChanged( TDrawNow aDrawNow );
   194         void GetPreferredServiceSettingL( RBuf& aValue );
   285 
   195         
   286 private:  // data
   196         
   287 
   197         /**
   288     /**
   198          * Get preferred service setting when VCC is supported.
   289      * Reference to model class for settings handling.
   199          *
   290      */
   200          * @since S60 v5.0
   291     CCSCSettingsUiModel& iModel;
   201          * @param aValue presence pref setting value is stored to this.
   292 
   202          */
   293     /**
   203         void GetVccPreferredServiceSettingL( RBuf& aValue );
   294      * Listbox for main view setting page items.
   204         
   295      * Own.
   205         
   296      */
   206         /**
   297     CAknSettingStyleListBox* iListBox;    
   207          * Get handover notification tone setting.
   298 
   208          *
   299     /**
   209          * @since S60 v5.0
   300      * Listbox item array
   210          * @param aValue handover notification tone setting value is stored 
   301      */
   211          * to this.
   302     RArray<TMainListBoxItem> iListBoxItemArray;
   212          */
   303 
   213         void GetHandoverNotificationTonePrefL( RBuf& aValue );
   304     /**
   214         
   305      * Setting item caption
   215         
   306      */
   216         /**
   307     HBufC* iCaption;
   217          * Get precence preferred setting.
   308 
   218          *
       
   219          * @since S60 v5.0
       
   220          * @param aValue presence pref setting value is stored to this.
       
   221          */
       
   222         void GetPresencePrefSettingL( RBuf& aValue );
       
   223         
       
   224                 
       
   225         /**
       
   226          * Get IM message tone setting.
       
   227          *
       
   228          * @since S60 v5.0
       
   229          * @param aValue im tone setting value is stored to this.
       
   230          */
       
   231         void GetImToneSettingL( RBuf& aValue );
       
   232         
       
   233         
       
   234         /**
       
   235          * Get SNAP settings.
       
   236          *
       
   237          * @since S60 v5.0
       
   238          * @param aValue snap setting value is stored to this.
       
   239          */
       
   240         void GetSnapSettingL( RBuf& aValue );
       
   241         
       
   242         
       
   243         /**
       
   244          * Draws setting items at the first time 
       
   245          * after the initialization is completed.
       
   246          *
       
   247          * @since S60 v3.2
       
   248          */
       
   249         void InitializeSettingItemsL();
       
   250         
       
   251         
       
   252          /**
       
   253          * Constructs setting list items.
       
   254          *
       
   255          * @since S60 v3.2
       
   256          * @param aItem for setting list item to be constructed
       
   257          */
       
   258         void MakeSettingItemL( TMainListBoxItem::TSettingItems aItem );
       
   259         
       
   260         
       
   261         // from base class CCoeControl
       
   262     
       
   263         /**
       
   264         * From CCoeControl.
       
   265         */
       
   266         TInt CountComponentControls() const;
       
   267         
       
   268         
       
   269         /**
       
   270         * From CCoeControl
       
   271         */
       
   272         void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   273 
       
   274 
       
   275         /**
       
   276         * From CCoeControl.
       
   277         */
       
   278         void SizeChanged();
       
   279 
       
   280 
       
   281         /**
       
   282         * From CoeControl.
       
   283         */        
       
   284         void FocusChanged( TDrawNow aDrawNow );        
       
   285 
       
   286     private:  // data
       
   287         
       
   288         /**
       
   289          * Reference to model class for settings handling.
       
   290          */
       
   291         CCSCSettingsUiModel& iModel;
       
   292                             
       
   293         /**
       
   294          * Listbox for main view setting page items.
       
   295          * Own.
       
   296          */
       
   297         CAknSettingStyleListBox* iListBox;    
       
   298                 
       
   299         /**
       
   300          * Listbox item array
       
   301          */
       
   302         RArray<TMainListBoxItem> iListBoxItemArray;
       
   303         
       
   304         /**
       
   305          * Setting item caption
       
   306          */
       
   307         HBufC* iCaption;
       
   308         
       
   309 #ifdef _DEBUG
   309 #ifdef _DEBUG
   310     friend class UT_cscsettingsui;
   310     friend class UT_cscsettingsui;
   311 #endif        
   311 #endif        
   312         
   312 
   313     };
   313     };
   314 
   314 
   315 #endif // C_CSCSETTINGSUIMAINCONTAINER_H
   315 #endif // C_CSCSETTINGSUIMAINCONTAINER_H
   316 
   316