1 /** |
|
2 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * Manasij Roy, Nalina Hariharan |
|
14 * |
|
15 * Description: |
|
16 * Interface for a base service provider |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef SMFPROVIDER_H |
|
21 #define SMFPROVIDER_H |
|
22 |
|
23 #include <QObject> |
|
24 #include <QImage> |
|
25 #include <QUrl> |
|
26 #include <QStringList> |
|
27 #include <QMetaType> |
|
28 |
|
29 #include "smfclientglobal.h" |
|
30 /** |
|
31 * @ingroup smf_client_group |
|
32 * Interface for a base service provider. Other service provider classes contains |
|
33 * implementation of this base class so that each has access to service provider |
|
34 * information. |
|
35 * All of the functionality described here should be implemented by a service |
|
36 * specific plug-in object. |
|
37 */ |
|
38 class SMFCLIENT_EXPORT SmfProvider |
|
39 { |
|
40 |
|
41 public: |
|
42 |
|
43 /** |
|
44 * Constructor |
|
45 */ |
|
46 SmfProvider(); |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 ~SmfProvider(); |
|
51 |
|
52 public: |
|
53 /** |
|
54 * Localizable name of the service |
|
55 * @return service name |
|
56 */ |
|
57 QString serviceName() const; |
|
58 |
|
59 /** |
|
60 * Logo of the service |
|
61 * @return logo image of the service |
|
62 */ |
|
63 QImage serviceIcon() const; |
|
64 |
|
65 /** |
|
66 * Readable service description |
|
67 * @return service description |
|
68 */ |
|
69 QString description() const; |
|
70 |
|
71 /* |
|
72 * Website of the service |
|
73 */ |
|
74 QUrl serviceUrl() const; |
|
75 |
|
76 /** |
|
77 * URL of the application providing this service |
|
78 */ |
|
79 QUrl applicationUrl() const; // |
|
80 |
|
81 /** |
|
82 * List of interfaces that this provider support |
|
83 */ |
|
84 QList<QString> supportedInterfaces() const; |
|
85 |
|
86 /** |
|
87 * List of languages supported by this service provider |
|
88 * @return a QStringList of languages supported by this service |
|
89 * provider in 2 letter ISO 639-1 format. |
|
90 */ |
|
91 QStringList supportedLanguages() const; |
|
92 |
|
93 /** |
|
94 * Sets Localizable name of the service |
|
95 * |
|
96 */ |
|
97 void setServiceName(QString& name); |
|
98 |
|
99 /** |
|
100 * Sets Logo of the service |
|
101 * |
|
102 */ |
|
103 void setServiceIcon(QImage& image) ; |
|
104 |
|
105 /** |
|
106 * Sets Readable service description |
|
107 * |
|
108 */ |
|
109 void setDescription(QString& desc) ; |
|
110 |
|
111 /* |
|
112 * Sets Website of the service |
|
113 */ |
|
114 void setServiceUrl(QUrl& url) ; |
|
115 |
|
116 /** |
|
117 * Sets URL of the application providing this service |
|
118 */ |
|
119 void setApplicationUrl(QUrl& url) ; |
|
120 |
|
121 /** |
|
122 * Sets list of interfaces that this provider supports |
|
123 */ |
|
124 void setSupportedInterfaces( QStringList& types); |
|
125 |
|
126 /** |
|
127 * Sets the list of languages supported by this service provider |
|
128 * @param lang A QStringList of languages supported by this service |
|
129 * provider in 2 letter ISO 639-1 format. |
|
130 */ |
|
131 void setSupportedLanguages( QStringList& lang ); |
|
132 |
|
133 private: |
|
134 QString m_serviceName; |
|
135 QImage m_serviceIcon; |
|
136 QString m_description; |
|
137 QUrl m_serviceUrl; |
|
138 QUrl m_appUrl; |
|
139 QStringList m_serviceTypes; |
|
140 QStringList m_supportedLanguages; |
|
141 friend QDataStream &operator<<(QDataStream &, const SmfProvider&); |
|
142 friend QDataStream &operator>>(QDataStream &, SmfProvider&); |
|
143 }; |
|
144 /** |
|
145 * Externalization |
|
146 */ |
|
147 SMFCLIENT_EXPORT QDataStream &operator<<(QDataStream &, const SmfProvider&); |
|
148 /** |
|
149 * Internalization |
|
150 */ |
|
151 SMFCLIENT_EXPORT QDataStream &operator>>(QDataStream &, SmfProvider&); |
|
152 |
|
153 typedef QList<SmfProvider> SmfProviderList; |
|
154 |
|
155 // Make the class SmfProvider known to QMetaType, so that as to register it. |
|
156 Q_DECLARE_METATYPE(SmfProvider) |
|
157 Q_DECLARE_METATYPE(QList<SmfProvider>) |
|
158 |
|
159 #endif // SMFPROVIDER_H |
|