inc/videoservices.h
branchRCL_3
changeset 22 839377eedc2b
equal deleted inserted replaced
21:315810614048 22:839377eedc2b
       
     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:   VideoServices class definition
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version: 7 %
       
    19 
       
    20 #ifndef __VIDEOSERVICES_H__
       
    21 #define __VIDEOSERVICES_H__
       
    22 
       
    23 #include <QStringList>
       
    24 #include "videoplayerappexport.h"
       
    25 
       
    26 //FORWARD CLASS DECLARATION
       
    27 class VideoServiceUriFetch;
       
    28 class VideoServicePlay;
       
    29 class VideoServiceView;
       
    30 class VideoServiceBrowse;
       
    31 class VideoPlayerEngine;
       
    32 class VideoServiceUri;
       
    33 
       
    34 class VIDEOPLAYERAPP_DLL_EXPORT VideoServices : public QObject
       
    35 {
       
    36     Q_OBJECT
       
    37 
       
    38     public:
       
    39     
       
    40         /**
       
    41          * Returns singleton instance for this class.
       
    42          * WARNING! Not safe to call this from destructor of another function scope static object!
       
    43          * @return The singleton instance.
       
    44          */
       
    45         static VideoServices *instance( VideoPlayerEngine* engine = 0 );
       
    46     
       
    47         /**
       
    48          * Decreases the reference count, when count reaches zero cleanup is done.
       
    49          */
       
    50         void decreaseReferenceCount();
       
    51     
       
    52         /**
       
    53          * Returns the context title set by service requestee
       
    54          * @return QString the title
       
    55          */
       
    56         QString contextTitle() const;
       
    57         
       
    58         /**
       
    59          * Returns sort type defined by the service client.
       
    60          * @param None.
       
    61          * @return int.
       
    62          */
       
    63         int sortRole() const;
       
    64     
       
    65         /*
       
    66          * Enum reflecting the services provided 
       
    67          */
       
    68         enum TVideoService
       
    69         {
       
    70             ENoService,
       
    71             EUriFetcher,
       
    72             EPlayback,
       
    73             EView,
       
    74             EUriView,
       
    75             EBrowse
       
    76         };
       
    77     
       
    78         /**
       
    79          * Returns service active status
       
    80          * @return bool true if active, false if not active
       
    81          */
       
    82         VideoServices::TVideoService currentService();
       
    83     
       
    84         /**
       
    85          * Returns browsing category.
       
    86          * @return see vcxmyvideosdef.h for default categories.
       
    87          */
       
    88         int getBrowseCategory() const;
       
    89     
       
    90     public slots:
       
    91         void itemSelected(const QString& item);
       
    92         void browsingEnded();
       
    93     
       
    94     signals:
       
    95     
       
    96         /*
       
    97          * Emitted when service user has set the title
       
    98          */    
       
    99         void titleReady(const QString& title);
       
   100     
       
   101         /*
       
   102          * Emitted to acticate requested plugin
       
   103          */
       
   104         void activated(int command);
       
   105     
       
   106     private:
       
   107     
       
   108         /**
       
   109          * Constructor
       
   110          */
       
   111         VideoServices();
       
   112     
       
   113         /**
       
   114          * Constructor
       
   115          */
       
   116         VideoServices( VideoPlayerEngine* engine );
       
   117     
       
   118         /**
       
   119          * Destructor.
       
   120          */
       
   121         virtual ~VideoServices();
       
   122     
       
   123         void setEngine( VideoPlayerEngine* engine );
       
   124     
       
   125         /**
       
   126          * Sets the active service
       
   127          *
       
   128          * @param service
       
   129          *
       
   130          */
       
   131         void setCurrentService(VideoServices::TVideoService service);
       
   132     
       
   133         /**
       
   134          * Returns the current engine
       
   135          *
       
   136          * @return engine
       
   137          *
       
   138          */
       
   139         VideoPlayerEngine* engine();
       
   140     
       
   141         Q_DISABLE_COPY( VideoServices )
       
   142     
       
   143     private:
       
   144     
       
   145         /**
       
   146          * Reference count.
       
   147          */
       
   148         int mReferenceCount;
       
   149     
       
   150         /**
       
   151          * Singleton instance.
       
   152          */
       
   153         static VideoServices* mInstance;
       
   154     
       
   155         /**
       
   156          * VideoServiceUriFetch service instance.
       
   157          */
       
   158         VideoServiceUriFetch* mServiceUriFetch;
       
   159     
       
   160         /**
       
   161          * Deprecated VideoServiceUriFetch service instance.
       
   162          */
       
   163         VideoServiceUriFetch* mServiceUriFetchDeprecatedNewService;
       
   164         
       
   165         /**
       
   166          * Deprecated VideoServiceUriFetch service instance.
       
   167          */
       
   168         VideoServiceUriFetch* mServiceUriFetchDeprecatedOldService;
       
   169     
       
   170         /**
       
   171          * VideoServicePlay service instance.
       
   172          */
       
   173         VideoServicePlay* mServicePlay;
       
   174         
       
   175         /**
       
   176          * VideoServicePlay service instance.
       
   177          */
       
   178         VideoServicePlay* mServicePlayDeprecatedNewService;
       
   179         
       
   180         /**
       
   181          * VideoServicePlay service instance.
       
   182          */
       
   183         VideoServicePlay* mServicePlayDeprecatedOldService;    
       
   184         
       
   185         /**
       
   186          * VideoServiceView service instance.
       
   187          */    
       
   188         VideoServiceView* mServiceView; 
       
   189         
       
   190         /**
       
   191          * VideoServiceView service instance.
       
   192          */    
       
   193         VideoServiceView* mServiceViewDeprecatedNewService; 
       
   194         
       
   195         /**
       
   196          * VideoServiceView service instance.
       
   197          */    
       
   198         VideoServiceView* mServiceViewDeprecatedOldService;     
       
   199         
       
   200         /**
       
   201          * VideoServiceBrowse service instance.
       
   202          */
       
   203         VideoServiceBrowse *mServiceBrowse;
       
   204     
       
   205         /**
       
   206          * Deprecated VideoServiceBrowse service instance.
       
   207          */
       
   208         VideoServiceBrowse *mServiceBrowseDeprecatedNewService;
       
   209         
       
   210         /**
       
   211          * Deprecated VideoServiceBrowse service instance.
       
   212          */
       
   213         VideoServiceBrowse *mServiceBrowseDeprecatedOldService;
       
   214                 
       
   215         /**
       
   216          * VideoServiceUri service instance.
       
   217          */
       
   218         VideoServiceUri *mServiceUriView;        
       
   219     
       
   220         /**
       
   221          * Pointer of VideoPlayerEngine.
       
   222          */
       
   223         VideoPlayerEngine* mEngine;
       
   224     
       
   225         /*
       
   226          * Current service
       
   227          */
       
   228         VideoServices::TVideoService mCurrentService;
       
   229     
       
   230         friend class VideoServiceUriFetch;    
       
   231         friend class VideoServicePlay;        
       
   232         friend class VideoServiceView;        
       
   233         friend class VideoServiceBrowse;        
       
   234 	    friend class VideoServiceUri;
       
   235 	    
       
   236     public:
       
   237         
       
   238         /*
       
   239          * indicate fetch service and attach operation has been selected
       
   240          */
       
   241         bool mFetchSelected;
       
   242         
       
   243 };
       
   244 
       
   245 #endif //__VIDEOSERVICES_H__