36
|
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 |
|
37
|
65 |
/**
|
|
66 |
* Returns sort type defined by the service client.
|
|
67 |
*
|
|
68 |
* @param None.
|
|
69 |
* @return int.
|
|
70 |
*/
|
|
71 |
int sortRole() const;
|
|
72 |
|
36
|
73 |
/*
|
|
74 |
* Enum reflecting the services provided
|
|
75 |
*/
|
|
76 |
enum TVideoService
|
|
77 |
{
|
|
78 |
ENoService,
|
|
79 |
EUriFetcher,
|
|
80 |
EPlayback,
|
|
81 |
EView,
|
|
82 |
EBrowse
|
|
83 |
};
|
|
84 |
|
|
85 |
/**
|
|
86 |
* Returns service active status
|
|
87 |
*
|
|
88 |
* @return bool true if active, false if not active
|
|
89 |
*
|
|
90 |
*/
|
|
91 |
VideoServices::TVideoService currentService();
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Returns browsing category.
|
|
95 |
*
|
|
96 |
* @return see vcxmyvideosdef.h for default categories.
|
|
97 |
*/
|
|
98 |
int getBrowseCategory() const;
|
|
99 |
|
|
100 |
public slots:
|
|
101 |
void itemSelected(const QString& item);
|
|
102 |
void browsingEnded();
|
|
103 |
|
|
104 |
signals:
|
|
105 |
/*
|
|
106 |
* Emitted when service user has set the title
|
|
107 |
*/
|
|
108 |
void titleReady(const QString& title);
|
|
109 |
|
|
110 |
/*
|
|
111 |
* Emitted to acticate requested plugin
|
|
112 |
*/
|
|
113 |
void activated(int command);
|
|
114 |
|
|
115 |
private:
|
|
116 |
|
|
117 |
/**
|
|
118 |
* Constructor
|
|
119 |
*/
|
|
120 |
VideoServices();
|
|
121 |
|
|
122 |
/**
|
|
123 |
* Constructor
|
|
124 |
*/
|
|
125 |
VideoServices(QVideoPlayerEngine* engine);
|
|
126 |
|
|
127 |
/**
|
|
128 |
* Destructor.
|
|
129 |
*/
|
|
130 |
virtual ~VideoServices();
|
|
131 |
|
|
132 |
void setEngine(QVideoPlayerEngine* engine);
|
|
133 |
|
|
134 |
/**
|
|
135 |
* Sets the active service
|
|
136 |
*
|
|
137 |
* @param service
|
|
138 |
*
|
|
139 |
*/
|
|
140 |
void setCurrentService(VideoServices::TVideoService service);
|
|
141 |
|
|
142 |
/**
|
|
143 |
* Returns the current engine
|
|
144 |
*
|
|
145 |
* @return engine
|
|
146 |
*
|
|
147 |
*/
|
|
148 |
QVideoPlayerEngine* engine();
|
|
149 |
|
|
150 |
Q_DISABLE_COPY(VideoServices)
|
|
151 |
|
|
152 |
private:
|
|
153 |
|
|
154 |
/**
|
|
155 |
* Reference count.
|
|
156 |
*/
|
|
157 |
int mReferenceCount;
|
|
158 |
|
|
159 |
/**
|
|
160 |
* VideoServiceUriFetch service instance.
|
|
161 |
*/
|
|
162 |
VideoServiceUriFetch* mServiceUriFetch;
|
|
163 |
|
|
164 |
/**
|
|
165 |
* VideoServicePlay service instance.
|
|
166 |
*/
|
|
167 |
VideoServicePlay* mServicePlay;
|
|
168 |
|
|
169 |
/**
|
|
170 |
* VideoServiceView service instance.
|
|
171 |
*/
|
|
172 |
VideoServiceView* mServiceView;
|
|
173 |
|
|
174 |
/**
|
|
175 |
* VideoServiceBrowse service instance.
|
|
176 |
*/
|
|
177 |
VideoServiceBrowse *mServiceBrowse;
|
|
178 |
|
|
179 |
/**
|
|
180 |
* Pointer of QVideoPlayerEngine.
|
|
181 |
*/
|
|
182 |
QVideoPlayerEngine* mEngine;
|
|
183 |
|
|
184 |
/*
|
|
185 |
* Current service
|
|
186 |
*/
|
|
187 |
VideoServices::TVideoService mCurrentService;
|
37
|
188 |
|
|
189 |
/**
|
|
190 |
* Sort role.
|
|
191 |
*/
|
|
192 |
int mSortRole;
|
36
|
193 |
|
|
194 |
friend class VideoServiceUriFetch;
|
|
195 |
|
|
196 |
friend class VideoServicePlay;
|
|
197 |
|
|
198 |
friend class VideoServiceView;
|
|
199 |
|
|
200 |
friend class VideoServiceBrowse;
|
|
201 |
};
|
|
202 |
|
|
203 |
#endif //__VIDEOSERVICES_H__
|