1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
|
19 * |
|
20 */ |
|
21 |
|
22 #ifndef XQAPPLICATIONMANAGER_H |
|
23 #define XQAPPLICATIONMANAGER_H |
|
24 |
|
25 #include<QObject> |
|
26 #include<QString> |
|
27 #include<QList> |
|
28 #include<QUrl> |
|
29 #include<QFile> |
|
30 |
|
31 #include <xqaiwglobal.h> |
|
32 #include <xqaiwinterfacedescriptor.h> |
|
33 #include <xqaiwrequest.h> |
|
34 #include <xqsharablefile.h> |
|
35 |
|
36 class XQApplicationManagerPrivate; |
|
37 |
|
38 class XQAIW_EXPORT XQApplicationManager : public QObject |
|
39 { |
|
40 Q_OBJECT |
|
41 |
|
42 public: |
|
43 |
|
44 /*! |
|
45 For the getDrmAttributes() function |
|
46 */ |
|
47 enum DrmAttribute |
|
48 { |
|
49 DrmIntAttributeBase=0, // Base value for the DRM integer attributes |
|
50 IsProtected = DrmIntAttributeBase+0, /*!< */ |
|
51 IsForwardable = DrmIntAttributeBase+1, /*!< */ |
|
52 // For others DrmIntAttributeBase+N, see N from the caf/caftypes.h |
|
53 |
|
54 DrmStringAttributeBase = 100, // Base value for the DRM string attributes |
|
55 Description = DrmStringAttributeBase+0, /*!< */ |
|
56 MimeType = DrmStringAttributeBase+1 /*!< */ |
|
57 // For others, DrmIntAttributeBase+N, see N from the caf/caftypes.h |
|
58 }; |
|
59 |
|
60 /*! |
|
61 For the status() function |
|
62 */ |
|
63 enum ServiceStatus |
|
64 { |
|
65 Unknown=0, /*!< Not known */ |
|
66 Enabled, /*!< Service enabled */ |
|
67 Disabled /*!< Service disabled, e.g. required config not OK */ |
|
68 }; |
|
69 |
|
70 XQApplicationManager(); |
|
71 virtual ~XQApplicationManager(); |
|
72 |
|
73 public: |
|
74 |
|
75 XQAiwRequest* create( const QString& interface, const QString& operation, bool embedded = true); |
|
76 |
|
77 XQAiwRequest* create( const XQAiwInterfaceDescriptor& implementation, const QString& operation, bool embedded = true); |
|
78 |
|
79 XQAiwRequest* create( const QString& service, const QString& interface, const QString& operation, bool embedded = true); |
|
80 |
|
81 QList<XQAiwInterfaceDescriptor> list(const QString& interface, const QString& operation); |
|
82 QList<XQAiwInterfaceDescriptor> list(const QString& service, const QString& interface, const QString& operation); |
|
83 |
|
84 XQAiwRequest* create( const QUrl &url, bool embedded = true); |
|
85 XQAiwRequest* create( const QUrl &url, const XQAiwInterfaceDescriptor& implementation, bool embedded = true); |
|
86 XQAiwRequest* create( const QFile &file, bool embedded = true); |
|
87 XQAiwRequest* create( const QFile &file, const XQAiwInterfaceDescriptor& implementation, bool embedded = true); |
|
88 |
|
89 QList<XQAiwInterfaceDescriptor> list(const QUrl& uri); |
|
90 QList<XQAiwInterfaceDescriptor> list(const QFile& file); |
|
91 |
|
92 QList<XQAiwInterfaceDescriptor> list(const XQSharableFile& file); |
|
93 XQAiwRequest* create( const XQSharableFile &file, bool embedded = true); |
|
94 XQAiwRequest* create( const XQSharableFile &file, const XQAiwInterfaceDescriptor& implementation, bool embedded = true); |
|
95 |
|
96 int lastError() const; |
|
97 bool isRunning(const XQAiwInterfaceDescriptor& implementation) const; |
|
98 |
|
99 bool getDrmAttributes(const QFile &file, const QList<int> &attributeNames, QVariantList &attributeValues); |
|
100 bool getDrmAttributes(const XQSharableFile &file, const QList<int> &attributeNames, QVariantList &attributeValues); |
|
101 |
|
102 ServiceStatus status(const XQAiwInterfaceDescriptor& implementation); |
|
103 |
|
104 signals: |
|
105 |
|
106 private: |
|
107 // Disable copy contructor |
|
108 Q_DISABLE_COPY(XQApplicationManager) |
|
109 XQApplicationManagerPrivate *d; |
|
110 }; |
|
111 |
|
112 #endif |
|