videocollection/tsrc/stubs/inc/videoservices.h
changeset 36 8aed59de29f9
child 20 b9e04db066d4
equal deleted inserted replaced
35:3738fe97f027 36:8aed59de29f9
       
     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 #ifndef __VIDEOSERVICES_H__
       
    19 #define __VIDEOSERVICES_H__
       
    20 
       
    21 /**
       
    22  *
       
    23  * We need stub for this because it has static data and HW compilation of moc file fails because of that.
       
    24  *
       
    25  */
       
    26 
       
    27 #include <QStringList>
       
    28 
       
    29 //FORWARD CLASS DECLARATION
       
    30 class VideoServiceUriFetch;
       
    31 class VideoServicePlay;
       
    32 class VideoServiceView;
       
    33 class VideoServiceBrowse;
       
    34 class QVideoPlayerEngine;
       
    35 
       
    36 class VideoServices : public QObject
       
    37 {
       
    38     Q_OBJECT
       
    39 
       
    40 public:
       
    41 
       
    42     /**
       
    43      * Returns singleton instance for this class.
       
    44      *
       
    45      * WARNING! Not safe to call this from destructor of another function scope static object!
       
    46      *
       
    47      * @return The singleton instance.
       
    48      */
       
    49     static VideoServices *instance(QVideoPlayerEngine* engine = 0);
       
    50 
       
    51     /**
       
    52      * Decreases the reference count, when count reaches zero cleanup is done.
       
    53      *
       
    54      */
       
    55     void decreaseReferenceCount();
       
    56 
       
    57     /**
       
    58      * Returns the context title set by service requestee
       
    59      *
       
    60      * @return QString the title
       
    61      *
       
    62      */
       
    63     QString contextTitle() const;
       
    64 
       
    65 	/*
       
    66 	 * Enum reflecting the services provided 
       
    67 	 */
       
    68     enum TVideoService
       
    69     {
       
    70         ENoService,
       
    71         EUriFetcher,
       
    72         EPlayback,
       
    73 		EView,
       
    74         EBrowse
       
    75     };
       
    76 
       
    77     /**
       
    78      * Returns service active status
       
    79      *
       
    80      * @return bool true if active, false if not active
       
    81      *
       
    82      */
       
    83     VideoServices::TVideoService currentService();
       
    84 
       
    85     /**
       
    86      * Returns browsing category.
       
    87      * 
       
    88      * @return see vcxmyvideosdef.h for default categories.
       
    89      */
       
    90     int getBrowseCategory() const;
       
    91 
       
    92 public slots:
       
    93     void itemSelected(const QString& item);
       
    94     void browsingEnded();
       
    95 
       
    96 signals:
       
    97 	/*
       
    98 	 * Emitted when service user has set the title
       
    99 	 */    
       
   100 	void titleReady(const QString& title);
       
   101 
       
   102 	/*
       
   103 	 * Emitted to acticate requested plugin
       
   104 	 */
       
   105 	void activated(int command);
       
   106 
       
   107 private:
       
   108 
       
   109     /**
       
   110      * Constructor
       
   111      */
       
   112     VideoServices();
       
   113 
       
   114     /**
       
   115      * Constructor
       
   116      */
       
   117     VideoServices(QVideoPlayerEngine* engine);
       
   118 
       
   119     /**
       
   120      * Destructor.
       
   121      */
       
   122     virtual ~VideoServices();
       
   123 
       
   124     void setEngine(QVideoPlayerEngine* engine);
       
   125 
       
   126     /**
       
   127      * Sets the active service
       
   128      *
       
   129      * @param service
       
   130      *
       
   131      */
       
   132     void setCurrentService(VideoServices::TVideoService service);
       
   133 
       
   134     /**
       
   135      * Returns the current engine
       
   136      *
       
   137      * @return engine
       
   138      *
       
   139      */
       
   140     QVideoPlayerEngine* engine();
       
   141 
       
   142     Q_DISABLE_COPY(VideoServices)
       
   143 
       
   144 private:
       
   145 
       
   146     /**
       
   147      * Reference count.
       
   148      */
       
   149     int mReferenceCount;
       
   150 
       
   151     /**
       
   152      * VideoServiceUriFetch service instance.
       
   153      */
       
   154     VideoServiceUriFetch* mServiceUriFetch;
       
   155 
       
   156     /**
       
   157      * VideoServicePlay service instance.
       
   158      */
       
   159     VideoServicePlay* mServicePlay;
       
   160     
       
   161     /**
       
   162      * VideoServiceView service instance.
       
   163      */    
       
   164     VideoServiceView* mServiceView; 
       
   165     
       
   166     /**
       
   167      * VideoServiceBrowse service instance.
       
   168      */
       
   169     VideoServiceBrowse *mServiceBrowse;
       
   170 
       
   171     /**
       
   172      * Pointer of QVideoPlayerEngine.
       
   173      */
       
   174     QVideoPlayerEngine* mEngine;
       
   175 
       
   176 	/*
       
   177 	 * Current service
       
   178 	 */
       
   179     VideoServices::TVideoService mCurrentService;
       
   180 
       
   181     friend class VideoServiceUriFetch;
       
   182 
       
   183     friend class VideoServicePlay;
       
   184 	
       
   185 	friend class VideoServiceView;
       
   186     
       
   187     friend class VideoServiceBrowse;
       
   188     };
       
   189 
       
   190 #endif //__VIDEOSERVICES_H__