File indexing completed on 2023-12-03 08:28:37
0001 /* 0002 * This file contains D-Bus client proxy classes generated by qt-client-gen.py. 0003 * 0004 * This file can be distributed under the same terms as the specification from 0005 * which it was generated. 0006 */ 0007 0008 #ifndef OTR_PROXY_SERVICE_INTERFACE_HEADER 0009 #define OTR_PROXY_SERVICE_INTERFACE_HEADER 0010 0011 #include "types.h" 0012 0013 #include "ktpotr_export.h" 0014 0015 #include <TelepathyQt/Types> 0016 0017 #include <QtGlobal> 0018 0019 #include <QString> 0020 #include <QObject> 0021 #include <QVariant> 0022 0023 #include <QDBusPendingReply> 0024 0025 #include <TelepathyQt/AbstractInterface> 0026 #include <TelepathyQt/DBusProxy> 0027 #include <TelepathyQt/Global> 0028 0029 0030 namespace Tp 0031 { 0032 class PendingVariant; 0033 class PendingOperation; 0034 } 0035 0036 namespace KTp 0037 { 0038 namespace Client 0039 { 0040 0041 /** 0042 * \class ProxyServiceInterface 0043 * \headerfile TelepathyQt/proxy-service.h <TelepathyQt/ProxyService> 0044 * \ingroup clientproxyservice 0045 * 0046 * Proxy class providing a 1:1 mapping of the D-Bus interface "org.kde.TelepathyProxy.ProxyService". 0047 */ 0048 class KTPOTR_EXPORT ProxyServiceInterface : public Tp::AbstractInterface 0049 { 0050 Q_OBJECT 0051 0052 public: 0053 /** 0054 * Returns the name of the interface "org.kde.TelepathyProxy.ProxyService", which this class 0055 * represents. 0056 * 0057 * \return The D-Bus interface name. 0058 */ 0059 static inline QLatin1String staticInterfaceName() 0060 { 0061 return QLatin1String("org.kde.TelepathyProxy.ProxyService"); 0062 } 0063 0064 /** 0065 * Creates a ProxyServiceInterface associated with the given object on the session bus. 0066 * 0067 * \param busName Name of the service the object is on. 0068 * \param objectPath Path to the object on the service. 0069 * \param parent Passed to the parent class constructor. 0070 */ 0071 ProxyServiceInterface( 0072 const QString& busName, 0073 const QString& objectPath, 0074 QObject* parent = nullptr 0075 ); 0076 0077 /** 0078 * Creates a ProxyServiceInterface associated with the given object on the given bus. 0079 * 0080 * \param connection The bus via which the object can be reached. 0081 * \param busName Name of the service the object is on. 0082 * \param objectPath Path to the object on the service. 0083 * \param parent Passed to the parent class constructor. 0084 */ 0085 ProxyServiceInterface( 0086 const QDBusConnection& connection, 0087 const QString& busName, 0088 const QString& objectPath, 0089 QObject* parent = nullptr 0090 ); 0091 0092 /** 0093 * Creates a ProxyServiceInterface associated with the same object as the given proxy. 0094 * 0095 * \param proxy The proxy to use. It will also be the QObject::parent() 0096 * for this object. 0097 */ 0098 ProxyServiceInterface(Tp::DBusProxy *proxy); 0099 0100 /** 0101 * Creates a ProxyServiceInterface associated with the same object as the given proxy. 0102 * Additionally, the created proxy will have the same parent as the given 0103 * proxy. 0104 * 0105 * \param mainInterface The proxy to use. 0106 */ 0107 explicit ProxyServiceInterface(const Tp::AbstractInterface& mainInterface); 0108 0109 /** 0110 * Creates a ProxyServiceInterface associated with the same object as the given proxy. 0111 * However, a different parent object can be specified. 0112 * 0113 * \param mainInterface The proxy to use. 0114 * \param parent Passed to the parent class constructor. 0115 */ 0116 ProxyServiceInterface(const Tp::AbstractInterface& mainInterface, QObject* parent); 0117 0118 /** 0119 * Asynchronous getter for the remote object property \c PolicySettings of type \c uint. 0120 * 0121 * 0122 * \htmlonly 0123 * <p>Set the OTR policy how you like it</p> 0124 * \endhtmlonly 0125 * 0126 * \return A pending variant which will emit finished when the property has been 0127 * retrieved. 0128 */ 0129 inline Tp::PendingVariant *requestPropertyPolicySettings() const 0130 { 0131 return internalRequestProperty(QLatin1String("PolicySettings")); 0132 } 0133 0134 /** 0135 * Asynchronous setter for the remote object property \c PolicySettings of type \c uint. 0136 * 0137 * 0138 * \htmlonly 0139 * <p>Set the OTR policy how you like it</p> 0140 * \endhtmlonly 0141 * 0142 * \return A pending operation which will emit finished when the property has been 0143 * set. 0144 */ 0145 inline Tp::PendingOperation *setPropertyPolicySettings(uint newValue) 0146 { 0147 return internalSetProperty(QLatin1String("PolicySettings"), QVariant::fromValue(newValue)); 0148 } 0149 0150 /** 0151 * Request all of the DBus properties on the interface. 0152 * 0153 * \return A pending variant map which will emit finished when the properties have 0154 * been retrieved. 0155 */ 0156 Tp::PendingVariantMap *requestAllProperties() const 0157 { 0158 return internalRequestAllProperties(); 0159 } 0160 0161 public Q_SLOTS: 0162 /** 0163 * Begins a call to the D-Bus method \c GeneratePrivateKey on the remote object. 0164 * 0165 * \htmlonly 0166 * <p> Generate new private key for given account. </p> 0167 * \endhtmlonly 0168 * 0169 * Note that \a timeout is ignored as of now. It will be used once 0170 * http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed. 0171 * 0172 * \param timeout The timeout in milliseconds. 0173 */ 0174 inline QDBusPendingReply<> GeneratePrivateKey(const QDBusObjectPath& account, int timeout = -1) 0175 { 0176 if (!invalidationReason().isEmpty()) { 0177 return QDBusPendingReply<>(QDBusMessage::createError( 0178 invalidationReason(), 0179 invalidationMessage() 0180 )); 0181 } 0182 0183 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(), 0184 this->staticInterfaceName(), QLatin1String("GeneratePrivateKey")); 0185 callMessage << QVariant::fromValue(account); 0186 return this->connection().asyncCall(callMessage, timeout); 0187 } 0188 0189 /** 0190 * Begins a call to the D-Bus method \c GetFingerprintForAccount on the remote object. 0191 * 0192 * Get private key fingerprint associated with given account 0193 * 0194 * Note that \a timeout is ignored as of now. It will be used once 0195 * http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed. 0196 * 0197 * 0198 * \param account 0199 * 0200 * The account the new key is generated for 0201 * \param timeout The timeout in milliseconds. 0202 * 0203 * \return 0204 * 0205 * Fingerprint of given account's private key or an empty string 0206 * if none exists 0207 */ 0208 inline QDBusPendingReply<QString> GetFingerprintForAccount(const QDBusObjectPath& account, int timeout = -1) 0209 { 0210 if (!invalidationReason().isEmpty()) { 0211 return QDBusPendingReply<QString>(QDBusMessage::createError( 0212 invalidationReason(), 0213 invalidationMessage() 0214 )); 0215 } 0216 0217 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(), 0218 this->staticInterfaceName(), QLatin1String("GetFingerprintForAccount")); 0219 callMessage << QVariant::fromValue(account); 0220 return this->connection().asyncCall(callMessage, timeout); 0221 } 0222 0223 /** 0224 * Begins a call to the D-Bus method \c GetKnownFingerprints on the remote object. 0225 * 0226 * Get private key fingerprint associated with given account 0227 * 0228 * Note that \a timeout is ignored as of now. It will be used once 0229 * http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed. 0230 * 0231 * \param timeout The timeout in milliseconds. 0232 */ 0233 inline QDBusPendingReply<KTp::FingerprintInfoList> GetKnownFingerprints(const QDBusObjectPath& account, int timeout = -1) 0234 { 0235 if (!invalidationReason().isEmpty()) { 0236 return QDBusPendingReply<KTp::FingerprintInfoList>(QDBusMessage::createError( 0237 invalidationReason(), 0238 invalidationMessage() 0239 )); 0240 } 0241 0242 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(), 0243 this->staticInterfaceName(), QLatin1String("GetKnownFingerprints")); 0244 callMessage << QVariant::fromValue(account); 0245 return this->connection().asyncCall(callMessage, timeout); 0246 } 0247 0248 /** 0249 * Begins a call to the D-Bus method \c TrustFingerprint on the remote object. 0250 * 0251 * Trust or distrust given fingerprint for account by settings 0252 * Is_Verfified to %TRUE or %FALSE 0253 * 0254 * Note that \a timeout is ignored as of now. It will be used once 0255 * http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed. 0256 * 0257 * \param timeout The timeout in milliseconds. 0258 */ 0259 inline QDBusPendingReply<> TrustFingerprint(const QDBusObjectPath& account, const QString& contactName, const QString& fingerprint, bool trust, int timeout = -1) 0260 { 0261 if (!invalidationReason().isEmpty()) { 0262 return QDBusPendingReply<>(QDBusMessage::createError( 0263 invalidationReason(), 0264 invalidationMessage() 0265 )); 0266 } 0267 0268 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(), 0269 this->staticInterfaceName(), QLatin1String("TrustFingerprint")); 0270 callMessage << QVariant::fromValue(account) << QVariant::fromValue(contactName) << QVariant::fromValue(fingerprint) << QVariant::fromValue(trust); 0271 return this->connection().asyncCall(callMessage, timeout); 0272 } 0273 0274 /** 0275 * Begins a call to the D-Bus method \c ForgetFingerprint on the remote object. 0276 * 0277 * Forget fingerprint romoving it from the list of known fingerprints 0278 * 0279 * Note that \a timeout is ignored as of now. It will be used once 0280 * http://bugreports.qt.nokia.com/browse/QTBUG-11775 is fixed. 0281 * 0282 * \param timeout The timeout in milliseconds. 0283 */ 0284 inline QDBusPendingReply<> ForgetFingerprint(const QDBusObjectPath& account, const QString& contactName, const QString& fingerprint, int timeout = -1) 0285 { 0286 if (!invalidationReason().isEmpty()) { 0287 return QDBusPendingReply<>(QDBusMessage::createError( 0288 invalidationReason(), 0289 invalidationMessage() 0290 )); 0291 } 0292 0293 QDBusMessage callMessage = QDBusMessage::createMethodCall(this->service(), this->path(), 0294 this->staticInterfaceName(), QLatin1String("ForgetFingerprint")); 0295 callMessage << QVariant::fromValue(account) << QVariant::fromValue(contactName) << QVariant::fromValue(fingerprint); 0296 return this->connection().asyncCall(callMessage, timeout); 0297 } 0298 0299 Q_SIGNALS: 0300 /** 0301 * Represents the signal \c ProxyConnected on the remote object. 0302 * 0303 * Signals that a proxy has been connected 0304 * 0305 * \param proxy 0306 * 0307 * The object path of the connected proxy 0308 */ 0309 void ProxyConnected(const QDBusObjectPath& proxy); 0310 0311 /** 0312 * Represents the signal \c ProxyDisconnected on the remote object. 0313 * 0314 * Signals that a proxy has been disconnected 0315 * 0316 * \param proxy 0317 * 0318 * The object path of the disconnectd proxy type 0319 */ 0320 void ProxyDisconnected(const QDBusObjectPath& proxy); 0321 0322 /** 0323 * Represents the signal \c KeyGenerationStarted on the remote object. 0324 * 0325 * Signals that a new private key is being generated for account 0326 * 0327 * \param account 0328 * 0329 * The account the new key is generated for 0330 */ 0331 void KeyGenerationStarted(const QDBusObjectPath& account); 0332 0333 /** 0334 * Represents the signal \c KeyGenerationFinished on the remote object. 0335 * 0336 * Signals that a new private key has just been generated for account 0337 * 0338 * \param account 0339 * 0340 * The account the new key has been generated for 0341 * 0342 * \param error 0343 * 0344 * %TRUE if error occured during generation 0345 */ 0346 void KeyGenerationFinished(const QDBusObjectPath& account, bool error); 0347 0348 protected: 0349 void invalidate(Tp::DBusProxy *, const QString &, const QString &) override; 0350 }; 0351 } 0352 } 0353 Q_DECLARE_METATYPE(KTp::Client::ProxyServiceInterface*) 0354 #endif