mediasettings/feedsettingsviews/inc/feedsettingsviewserviceselection.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2006-2008 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 the License "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:    Class for "service selection list" in Settings UI.*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 #ifndef VCXNSSETTINGSVIEWSERVICESELECTION_H
       
    20 #define VCXNSSETTINGSVIEWSERVICESELECTION_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <AknServerApp.h>
       
    24 #include "feedsettingsviewcontainer.h"
       
    25 #include "CIptvService.h"
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CAknDoubleStyleListBox;
       
    31 class CIptvService;
       
    32 class CVcxConnectionUtility;
       
    33 class CBrowserLauncher;
       
    34 
       
    35 class CIptvLiveUIScheduledProgram;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40  * Class for "service selection list" in Settings UI.
       
    41  *
       
    42  *  @lib vcsettingsview.lib
       
    43  *  @since S60 3.2
       
    44  */
       
    45 NONSHARABLE_CLASS( CVcxNsSettingsViewServiceSelection ) : public CBase,
       
    46                                                           public MAknServerAppExitObserver
       
    47     {
       
    48 public: // Constructors and desctructor.
       
    49 
       
    50     /**
       
    51      * @param aParent      Pointer to parent container.
       
    52      * @param aServiceSettings Reference to Service Settings in UI Engine.
       
    53      */
       
    54     static CVcxNsSettingsViewServiceSelection* NewL(CVcxNsSettingsViewContainer* aParent,
       
    55             CVcxNsServiceSettings& aServiceSettings);
       
    56 
       
    57     virtual ~CVcxNsSettingsViewServiceSelection();
       
    58 
       
    59     /**
       
    60      * Checks if msk needs tp be updated and does so if it is needed
       
    61      */
       
    62     void CheckMsk( );
       
    63     
       
    64 protected: //From MAknServerAppExitObserver
       
    65 
       
    66     /**
       
    67      * Handle the exit of a connected server app.
       
    68      * This implementation provides Series 60 default behavior
       
    69      * for handling of the EAknCmdExit exit code. Derived classes
       
    70      * should base-call this implementation if they override this
       
    71      * function.
       
    72      * @param aReason The reason that the server application exited.
       
    73      * This will either be an error code, or the command id that caused
       
    74      * the server app to exit.
       
    75      * ( empty implementation here )
       
    76      */
       
    77      void HandleServerAppExit( TInt /*aReason*/) { ; }
       
    78 
       
    79 private:
       
    80     /**
       
    81      * Returns true if currently active list item is marked.
       
    82      *
       
    83      * @return ETrue if currently active list item is marked.
       
    84      */
       
    85     TBool IsCurrentListItemMarked();
       
    86 
       
    87 public:
       
    88 
       
    89     /**
       
    90      * Activates "service selection list".
       
    91      */
       
    92     void ActivateL();
       
    93 
       
    94     /**
       
    95      * Deactivates "service selection list".
       
    96      */
       
    97     void Deactivate();
       
    98 
       
    99     /**
       
   100      * Sets service type used in "service selection list".
       
   101      *
       
   102      * @param aServiceType Service type as CIptvService::TServiceType 
       
   103      *                     enumeration.
       
   104      */
       
   105     void SetServiceType(CIptvService::TServiceType aServiceType);
       
   106 
       
   107     /**
       
   108      * Returns service type in use.
       
   109      *
       
   110      * @return Service type as CIptvService::TServiceType enumeration.
       
   111      */
       
   112     CIptvService::TServiceType GetServiceType();
       
   113 
       
   114     /**
       
   115      * Returns true if currently active service is read-only.
       
   116      *
       
   117      * @return ETrue if currently active service is read-only.
       
   118      */
       
   119     TBool IsCurrentServiceReadOnlyL();
       
   120 
       
   121     /**
       
   122      * Returns currently active service. Ownership of object is given
       
   123      * to caller.
       
   124      *
       
   125      * @return Pointer to currently active service.
       
   126      */
       
   127     CIptvService* GetCurrentServiceL();
       
   128 
       
   129     /**
       
   130      * Deletes currently active service.
       
   131      */
       
   132     void DeleteCurrentServiceL();
       
   133 
       
   134     /**
       
   135      * Loads data to "service selection list".
       
   136      */
       
   137     void LoadL();
       
   138 
       
   139     /**
       
   140      * Saves data in "service selection list".
       
   141      */
       
   142     void SaveL();
       
   143 
       
   144     /**
       
   145      * Returns pointer to "service selection item" listbox. No ownership transfer.
       
   146      *
       
   147      * @return Pointer to listbox.
       
   148      */
       
   149     CAknSingleGraphicStyleListBox* ListBox();
       
   150 
       
   151     /**
       
   152      * Shows message query dialog for managing an account before removing service
       
   153      *
       
   154      * @return Dialog's result, what user has replied to query.
       
   155      */
       
   156     TInt ShowAccountMgmtDialogL();
       
   157 
       
   158     /**
       
   159      * Used as a callback function in message query.
       
   160      * @return System-wide error code.
       
   161      */
       
   162     static TInt ShowLinkL( TAny* ptr );
       
   163 
       
   164     /**
       
   165      * Opens account management Url with embedded browser.
       
   166      */ 
       
   167     void OpenEmbeddedBrowserL( const TDesC& aUri );
       
   168     
       
   169 private: // New methods.
       
   170 
       
   171     /**
       
   172      * Gets current service id.
       
   173      *
       
   174      * @param aServiceId service id
       
   175      */
       
   176     void GetServiceIdL( TUint32& aServiceId );
       
   177 
       
   178     /**
       
   179      * Removes commands from CBA
       
   180      * @param aCba Button group container
       
   181      */
       
   182     void RemoveCommandsFromCba( CEikButtonGroupContainer& aCba );
       
   183 
       
   184 private: // Construction.
       
   185 
       
   186     /**
       
   187      * @param aParent      Pointer to parent container.
       
   188      * @param aServiceSettings Reference to Service Settings in UI Engine.
       
   189      */
       
   190     CVcxNsSettingsViewServiceSelection(CVcxNsSettingsViewContainer* aParent,
       
   191             CVcxNsServiceSettings& aServiceSettings);
       
   192 
       
   193     void ConstructL();
       
   194 
       
   195 private: // Data
       
   196 
       
   197     /**
       
   198      * Parent control container
       
   199      */
       
   200     CVcxNsSettingsViewContainer* iParent;
       
   201     
       
   202     /**
       
   203      * UI engine's application settings provider
       
   204      */
       
   205     CVcxNsServiceSettings& iServiceSettings;
       
   206     
       
   207     /**
       
   208      * List box control
       
   209      */
       
   210     CAknSingleGraphicStyleListBox* iListbox;
       
   211 
       
   212     /**
       
   213      * Is own command set used
       
   214      */ 
       
   215     TBool iOwnButtons;
       
   216 
       
   217     /**
       
   218      * Service array
       
   219      */
       
   220     CDesC8ArraySeg* iServicesArray;
       
   221 
       
   222     /**
       
   223      * Service array for vod casts
       
   224      */
       
   225     CDesC8ArraySeg* iServicesArrayVodCast;
       
   226       
       
   227     /**
       
   228      * Service type
       
   229      */
       
   230     CIptvService::TServiceType iServiceType;
       
   231     
       
   232     /**
       
   233      * Current Msk resource id.
       
   234      */
       
   235     TInt iCurrentMskResource;
       
   236     
       
   237     /*
       
   238     * Launcher that handles opening of web link in embedded browser
       
   239     * Own.
       
   240     */
       
   241     CBrowserLauncher* iLauncher;
       
   242 
       
   243     /**
       
   244      * Connection utility.
       
   245      * Not own.
       
   246      */
       
   247     CVcxConnectionUtility* iConnUtil;
       
   248     
       
   249     };
       
   250 
       
   251 #endif // VCXNSSETTINGSVIEWSERVICESELECTION_H