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