|
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 XQAIWINTERFACEDESCRIPTOR_H |
|
23 #define XQAIWINTERFACEDESCRIPTOR_H |
|
24 |
|
25 #include <QString> |
|
26 #include <QVariant> |
|
27 #include <QStringList> |
|
28 #include <xqserviceglobal.h> |
|
29 |
|
30 class XQAiwInterfaceDescriptorPrivate; |
|
31 |
|
32 // Custom keys |
|
33 namespace XQAiw |
|
34 { |
|
35 // NOTE !!! Names need to be fixed when service naming policy has been decided !!! |
|
36 // |
|
37 static const char *CustomKeyScheme = "schemes"; // CSV of schemes |
|
38 static const char *CustomKeyActionText = "txt_aiw_action_text"; |
|
39 static const char *InterfaceUri = "com.nokia.symbian.IUriView"; // Interface to handle URIs (http://, file://, etc.) |
|
40 static const char *InterfaceFile = "com.nokia.symbian.IFileView"; // Interface to handle local files in file system |
|
41 static const char *OperationView = "view(QString)"; // Default operation signature for viewing files |
|
42 static const char *OperationViewSharable = "view(XQSharableFile)"; // Default signature for viewing sharable files |
|
43 static const char *UriSchemeApp = "appto"; // Custom scheme: appto://uid3?query-part |
|
44 static const char *UriSchemeFile = "file"; // Standard file sceheme |
|
45 |
|
46 } |
|
47 |
|
48 class XQSERVICEUTIL_EXPORT XQAiwInterfaceDescriptor |
|
49 { |
|
50 public: |
|
51 enum PropertyKey { |
|
52 Capabilities = 0, |
|
53 Location, |
|
54 ServiceDescription, |
|
55 InterfaceDescription, |
|
56 ImplementationId = 100 // Extension: Settable property, contains impl. id |
|
57 |
|
58 }; |
|
59 |
|
60 public: |
|
61 XQAiwInterfaceDescriptor(); |
|
62 XQAiwInterfaceDescriptor(const XQAiwInterfaceDescriptor& other); |
|
63 ~XQAiwInterfaceDescriptor(); |
|
64 XQAiwInterfaceDescriptor& operator=(const XQAiwInterfaceDescriptor& other); |
|
65 bool operator==(const XQAiwInterfaceDescriptor& other) const; |
|
66 inline bool operator!=(const XQAiwInterfaceDescriptor& other) const { return !operator==(other); }; |
|
67 QString serviceName() const; |
|
68 QString interfaceName() const; |
|
69 int majorVersion() const; |
|
70 int minorVersion() const; |
|
71 bool isValid() const; |
|
72 bool inSystemScope() const; |
|
73 QVariant property(XQAiwInterfaceDescriptor::PropertyKey key) const; |
|
74 QString customProperty(const QString& key) const; |
|
75 QStringList customPropertyKeys() const; |
|
76 public: |
|
77 // Extensions: For service management |
|
78 bool setProperty(XQAiwInterfaceDescriptor::PropertyKey key, const QVariant value ); |
|
79 |
|
80 private: |
|
81 XQAiwInterfaceDescriptorPrivate* d; |
|
82 friend class XQAiwInterfaceDescriptorPrivate; |
|
83 friend class ServiceMetaData; |
|
84 |
|
85 #ifndef QT_NO_DATASTREAM |
|
86 friend XQSERVICEUTIL_EXPORT QDataStream &operator<<(QDataStream &, const XQAiwInterfaceDescriptor &); |
|
87 friend XQSERVICEUTIL_EXPORT QDataStream &operator>>(QDataStream &, XQAiwInterfaceDescriptor &); |
|
88 #endif |
|
89 }; |
|
90 |
|
91 |
|
92 #ifndef QT_NO_DATASTREAM |
|
93 XQSERVICEUTIL_EXPORT QDataStream &operator<<(QDataStream &, const XQAiwInterfaceDescriptor &); |
|
94 XQSERVICEUTIL_EXPORT QDataStream &operator>>(QDataStream &, XQAiwInterfaceDescriptor &); |
|
95 #endif |
|
96 #ifndef QT_NO_DEBUG_STREAM |
|
97 XQSERVICEUTIL_EXPORT QDebug operator<<(QDebug, const XQAiwInterfaceDescriptor &); |
|
98 #endif |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 #endif |