videocollection/tsrc/stubs/inc/videoservices.h
author hgs
Fri, 30 Apr 2010 09:52:11 +0300
changeset 37 4eb2df7f7cbe
parent 36 8aed59de29f9
child 44 518105d52e45
permissions -rw-r--r--
201017
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:   VideoServices class definition
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#ifndef __VIDEOSERVICES_H__
hgs
parents:
diff changeset
    19
#define __VIDEOSERVICES_H__
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
/**
hgs
parents:
diff changeset
    22
 *
hgs
parents:
diff changeset
    23
 * We need stub for this because it has static data and HW compilation of moc file fails because of that.
hgs
parents:
diff changeset
    24
 *
hgs
parents:
diff changeset
    25
 */
hgs
parents:
diff changeset
    26
hgs
parents:
diff changeset
    27
#include <QStringList>
hgs
parents:
diff changeset
    28
hgs
parents:
diff changeset
    29
//FORWARD CLASS DECLARATION
hgs
parents:
diff changeset
    30
class VideoServiceUriFetch;
hgs
parents:
diff changeset
    31
class VideoServicePlay;
hgs
parents:
diff changeset
    32
class VideoServiceView;
hgs
parents:
diff changeset
    33
class VideoServiceBrowse;
hgs
parents:
diff changeset
    34
class QVideoPlayerEngine;
hgs
parents:
diff changeset
    35
hgs
parents:
diff changeset
    36
class VideoServices : public QObject
hgs
parents:
diff changeset
    37
{
hgs
parents:
diff changeset
    38
    Q_OBJECT
hgs
parents:
diff changeset
    39
hgs
parents:
diff changeset
    40
public:
hgs
parents:
diff changeset
    41
hgs
parents:
diff changeset
    42
    /**
hgs
parents:
diff changeset
    43
     * Returns singleton instance for this class.
hgs
parents:
diff changeset
    44
     *
hgs
parents:
diff changeset
    45
     * WARNING! Not safe to call this from destructor of another function scope static object!
hgs
parents:
diff changeset
    46
     *
hgs
parents:
diff changeset
    47
     * @return The singleton instance.
hgs
parents:
diff changeset
    48
     */
hgs
parents:
diff changeset
    49
    static VideoServices *instance(QVideoPlayerEngine* engine = 0);
hgs
parents:
diff changeset
    50
hgs
parents:
diff changeset
    51
    /**
hgs
parents:
diff changeset
    52
     * Decreases the reference count, when count reaches zero cleanup is done.
hgs
parents:
diff changeset
    53
     *
hgs
parents:
diff changeset
    54
     */
hgs
parents:
diff changeset
    55
    void decreaseReferenceCount();
hgs
parents:
diff changeset
    56
hgs
parents:
diff changeset
    57
    /**
hgs
parents:
diff changeset
    58
     * Returns the context title set by service requestee
hgs
parents:
diff changeset
    59
     *
hgs
parents:
diff changeset
    60
     * @return QString the title
hgs
parents:
diff changeset
    61
     *
hgs
parents:
diff changeset
    62
     */
hgs
parents:
diff changeset
    63
    QString contextTitle() const;
hgs
parents:
diff changeset
    64
37
hgs
parents: 36
diff changeset
    65
    /**
hgs
parents: 36
diff changeset
    66
     * Returns sort type defined by the service client.
hgs
parents: 36
diff changeset
    67
     * 
hgs
parents: 36
diff changeset
    68
     * @param None.
hgs
parents: 36
diff changeset
    69
     * @return int.
hgs
parents: 36
diff changeset
    70
     */
hgs
parents: 36
diff changeset
    71
    int sortRole() const;
hgs
parents: 36
diff changeset
    72
36
hgs
parents:
diff changeset
    73
	/*
hgs
parents:
diff changeset
    74
	 * Enum reflecting the services provided 
hgs
parents:
diff changeset
    75
	 */
hgs
parents:
diff changeset
    76
    enum TVideoService
hgs
parents:
diff changeset
    77
    {
hgs
parents:
diff changeset
    78
        ENoService,
hgs
parents:
diff changeset
    79
        EUriFetcher,
hgs
parents:
diff changeset
    80
        EPlayback,
hgs
parents:
diff changeset
    81
		EView,
hgs
parents:
diff changeset
    82
        EBrowse
hgs
parents:
diff changeset
    83
    };
hgs
parents:
diff changeset
    84
hgs
parents:
diff changeset
    85
    /**
hgs
parents:
diff changeset
    86
     * Returns service active status
hgs
parents:
diff changeset
    87
     *
hgs
parents:
diff changeset
    88
     * @return bool true if active, false if not active
hgs
parents:
diff changeset
    89
     *
hgs
parents:
diff changeset
    90
     */
hgs
parents:
diff changeset
    91
    VideoServices::TVideoService currentService();
hgs
parents:
diff changeset
    92
hgs
parents:
diff changeset
    93
    /**
hgs
parents:
diff changeset
    94
     * Returns browsing category.
hgs
parents:
diff changeset
    95
     * 
hgs
parents:
diff changeset
    96
     * @return see vcxmyvideosdef.h for default categories.
hgs
parents:
diff changeset
    97
     */
hgs
parents:
diff changeset
    98
    int getBrowseCategory() const;
hgs
parents:
diff changeset
    99
hgs
parents:
diff changeset
   100
public slots:
hgs
parents:
diff changeset
   101
    void itemSelected(const QString& item);
hgs
parents:
diff changeset
   102
    void browsingEnded();
hgs
parents:
diff changeset
   103
hgs
parents:
diff changeset
   104
signals:
hgs
parents:
diff changeset
   105
	/*
hgs
parents:
diff changeset
   106
	 * Emitted when service user has set the title
hgs
parents:
diff changeset
   107
	 */    
hgs
parents:
diff changeset
   108
	void titleReady(const QString& title);
hgs
parents:
diff changeset
   109
hgs
parents:
diff changeset
   110
	/*
hgs
parents:
diff changeset
   111
	 * Emitted to acticate requested plugin
hgs
parents:
diff changeset
   112
	 */
hgs
parents:
diff changeset
   113
	void activated(int command);
hgs
parents:
diff changeset
   114
hgs
parents:
diff changeset
   115
private:
hgs
parents:
diff changeset
   116
hgs
parents:
diff changeset
   117
    /**
hgs
parents:
diff changeset
   118
     * Constructor
hgs
parents:
diff changeset
   119
     */
hgs
parents:
diff changeset
   120
    VideoServices();
hgs
parents:
diff changeset
   121
hgs
parents:
diff changeset
   122
    /**
hgs
parents:
diff changeset
   123
     * Constructor
hgs
parents:
diff changeset
   124
     */
hgs
parents:
diff changeset
   125
    VideoServices(QVideoPlayerEngine* engine);
hgs
parents:
diff changeset
   126
hgs
parents:
diff changeset
   127
    /**
hgs
parents:
diff changeset
   128
     * Destructor.
hgs
parents:
diff changeset
   129
     */
hgs
parents:
diff changeset
   130
    virtual ~VideoServices();
hgs
parents:
diff changeset
   131
hgs
parents:
diff changeset
   132
    void setEngine(QVideoPlayerEngine* engine);
hgs
parents:
diff changeset
   133
hgs
parents:
diff changeset
   134
    /**
hgs
parents:
diff changeset
   135
     * Sets the active service
hgs
parents:
diff changeset
   136
     *
hgs
parents:
diff changeset
   137
     * @param service
hgs
parents:
diff changeset
   138
     *
hgs
parents:
diff changeset
   139
     */
hgs
parents:
diff changeset
   140
    void setCurrentService(VideoServices::TVideoService service);
hgs
parents:
diff changeset
   141
hgs
parents:
diff changeset
   142
    /**
hgs
parents:
diff changeset
   143
     * Returns the current engine
hgs
parents:
diff changeset
   144
     *
hgs
parents:
diff changeset
   145
     * @return engine
hgs
parents:
diff changeset
   146
     *
hgs
parents:
diff changeset
   147
     */
hgs
parents:
diff changeset
   148
    QVideoPlayerEngine* engine();
hgs
parents:
diff changeset
   149
hgs
parents:
diff changeset
   150
    Q_DISABLE_COPY(VideoServices)
hgs
parents:
diff changeset
   151
hgs
parents:
diff changeset
   152
private:
hgs
parents:
diff changeset
   153
hgs
parents:
diff changeset
   154
    /**
hgs
parents:
diff changeset
   155
     * Reference count.
hgs
parents:
diff changeset
   156
     */
hgs
parents:
diff changeset
   157
    int mReferenceCount;
hgs
parents:
diff changeset
   158
hgs
parents:
diff changeset
   159
    /**
hgs
parents:
diff changeset
   160
     * VideoServiceUriFetch service instance.
hgs
parents:
diff changeset
   161
     */
hgs
parents:
diff changeset
   162
    VideoServiceUriFetch* mServiceUriFetch;
hgs
parents:
diff changeset
   163
hgs
parents:
diff changeset
   164
    /**
hgs
parents:
diff changeset
   165
     * VideoServicePlay service instance.
hgs
parents:
diff changeset
   166
     */
hgs
parents:
diff changeset
   167
    VideoServicePlay* mServicePlay;
hgs
parents:
diff changeset
   168
    
hgs
parents:
diff changeset
   169
    /**
hgs
parents:
diff changeset
   170
     * VideoServiceView service instance.
hgs
parents:
diff changeset
   171
     */    
hgs
parents:
diff changeset
   172
    VideoServiceView* mServiceView; 
hgs
parents:
diff changeset
   173
    
hgs
parents:
diff changeset
   174
    /**
hgs
parents:
diff changeset
   175
     * VideoServiceBrowse service instance.
hgs
parents:
diff changeset
   176
     */
hgs
parents:
diff changeset
   177
    VideoServiceBrowse *mServiceBrowse;
hgs
parents:
diff changeset
   178
hgs
parents:
diff changeset
   179
    /**
hgs
parents:
diff changeset
   180
     * Pointer of QVideoPlayerEngine.
hgs
parents:
diff changeset
   181
     */
hgs
parents:
diff changeset
   182
    QVideoPlayerEngine* mEngine;
hgs
parents:
diff changeset
   183
hgs
parents:
diff changeset
   184
	/*
hgs
parents:
diff changeset
   185
	 * Current service
hgs
parents:
diff changeset
   186
	 */
hgs
parents:
diff changeset
   187
    VideoServices::TVideoService mCurrentService;
37
hgs
parents: 36
diff changeset
   188
    
hgs
parents: 36
diff changeset
   189
    /**
hgs
parents: 36
diff changeset
   190
     * Sort role.
hgs
parents: 36
diff changeset
   191
     */
hgs
parents: 36
diff changeset
   192
    int mSortRole;
36
hgs
parents:
diff changeset
   193
hgs
parents:
diff changeset
   194
    friend class VideoServiceUriFetch;
hgs
parents:
diff changeset
   195
hgs
parents:
diff changeset
   196
    friend class VideoServicePlay;
hgs
parents:
diff changeset
   197
	
hgs
parents:
diff changeset
   198
	friend class VideoServiceView;
hgs
parents:
diff changeset
   199
    
hgs
parents:
diff changeset
   200
    friend class VideoServiceBrowse;
hgs
parents:
diff changeset
   201
    };
hgs
parents:
diff changeset
   202
hgs
parents:
diff changeset
   203
#endif //__VIDEOSERVICES_H__