50 |
50 |
51 QTM_USE_NAMESPACE |
51 QTM_USE_NAMESPACE |
52 |
52 |
53 Q_DECLARE_METATYPE(QServiceInterfaceDescriptor) |
53 Q_DECLARE_METATYPE(QServiceInterfaceDescriptor) |
54 |
54 |
55 class QServiceWrapper : public QObject { |
55 class QDeclarativeService : public QObject { |
56 Q_OBJECT |
56 Q_OBJECT |
57 Q_PROPERTY(QString interfaceName READ interfaceName WRITE setInterfaceName); |
57 Q_PROPERTY(QString interfaceName READ interfaceName WRITE setInterfaceName); |
58 Q_PROPERTY(QString serviceName READ serviceName); |
58 Q_PROPERTY(QString serviceName READ serviceName); |
59 Q_PROPERTY(QString versionNumber READ versionNumber); |
59 Q_PROPERTY(QString versionNumber READ versionNumber); |
60 Q_PROPERTY(bool valid READ isValid NOTIFY validChanged); |
60 Q_PROPERTY(bool valid READ isValid NOTIFY validChanged); |
61 Q_PROPERTY(QObject* serviceObject READ serviceObject NOTIFY serviceObjectChanged); |
61 Q_PROPERTY(QObject* serviceObject READ serviceObject NOTIFY serviceObjectChanged); |
62 |
62 |
63 public: |
63 public: |
64 QServiceWrapper(); |
64 QDeclarativeService(); |
65 ~QServiceWrapper(); |
65 ~QDeclarativeService(); |
66 |
66 |
67 void setInterfaceDesc(const QServiceInterfaceDescriptor& desc); |
67 void setInterfaceDesc(const QServiceInterfaceDescriptor& desc); |
68 QServiceInterfaceDescriptor interfaceDesc() const; |
68 QServiceInterfaceDescriptor interfaceDesc() const; |
69 |
69 |
70 void setInterfaceName(const QString& interface); |
70 void setInterfaceName(const QString& interface); |
84 |
84 |
85 QServiceInterfaceDescriptor m_descriptor; |
85 QServiceInterfaceDescriptor m_descriptor; |
86 QObject* serviceInstance; |
86 QObject* serviceInstance; |
87 }; |
87 }; |
88 |
88 |
89 QML_DECLARE_TYPE(QServiceWrapper) |
89 QML_DECLARE_TYPE(QDeclarativeService) |
90 |
90 |
91 class QServiceListWrapper : public QObject { |
91 class QDeclarativeServiceList : public QObject { |
92 Q_OBJECT |
92 Q_OBJECT |
93 Q_PROPERTY(QString interfaceName READ interfaceName WRITE setInterfaceName); |
93 Q_PROPERTY(QString interfaceName READ interfaceName WRITE setInterfaceName); |
94 Q_PROPERTY(QString minVersion READ minVersion WRITE setMinVersion); |
94 Q_PROPERTY(QString minVersion READ minVersion WRITE setMinVersion); |
95 Q_PROPERTY(QDeclarativeListProperty<QServiceWrapper> services READ services NOTIFY servicesChanged); |
95 Q_PROPERTY(QDeclarativeListProperty<QDeclarativeService> services READ services NOTIFY servicesChanged); |
96 |
96 |
97 public: |
97 public: |
98 QServiceListWrapper(); |
98 QDeclarativeServiceList(); |
99 ~QServiceListWrapper(); |
99 ~QDeclarativeServiceList(); |
100 |
100 |
101 QDeclarativeListProperty<QServiceWrapper> services(); |
101 QDeclarativeListProperty<QDeclarativeService> services(); |
102 |
102 |
103 void setInterfaceName(const QString& interface); |
103 void setInterfaceName(const QString& interface); |
104 QString interfaceName() const; |
104 QString interfaceName() const; |
105 |
105 |
106 void setMinVersion(const QString& interface); |
106 void setMinVersion(const QString& interface); |
107 QString minVersion() const; |
107 QString minVersion() const; |
108 |
108 |
109 private: |
109 private: |
110 QServiceManager* serviceManager; |
110 QServiceManager* serviceManager; |
111 QList<QServiceWrapper *> m_services; |
111 QList<QDeclarativeService *> m_services; |
112 QString m_interface; |
112 QString m_interface; |
113 QString m_version; |
113 QString m_version; |
114 |
114 |
115 Q_SIGNALS: |
115 Q_SIGNALS: |
116 void servicesChanged(const QDeclarativeListProperty<QServiceWrapper>&); |
116 void servicesChanged(const QDeclarativeListProperty<QDeclarativeService>&); |
117 }; |
117 }; |
118 |
118 |
119 QML_DECLARE_TYPE(QServiceListWrapper) |
119 QML_DECLARE_TYPE(QDeclarativeServiceList) |
120 |
120 |
121 #endif |
121 #endif |
122 |
122 |