1 #ifndef KTP_PROXY_SVC_CHANNEL_PROXY_HEADER 2 #define KTP_PROXY_SVC_CHANNEL_PROXY_HEADER 3 4 /* 5 * This file contains D-Bus adaptor classes generated by qt-svc-gen.py. 6 * 7 * This file can be distributed under the same terms as the specification from 8 * which it was generated. 9 */ 10 11 #include <TelepathyQt/AbstractAdaptor> 12 #include <TelepathyQt/Global> 13 #include <TelepathyQt/Types> 14 15 #include <QObject> 16 #include <QtDBus> 17 18 namespace Tp 19 { 20 namespace Service 21 { 22 23 /** 24 * \class ChannelProxyInterfaceOTRAdaptor 25 * \headerfile TelepathyQt/_gen/svc-channel-proxy.h <TelepathyQt/_gen/svc-channel-proxy.h> 26 * \ingroup servicechannelproxy 27 * 28 * Adaptor class providing a 1:1 mapping of the D-Bus interface "org.kde.TelepathyProxy.ChannelProxy.Interface.OTR". 29 */ 30 class TP_QT_EXPORT ChannelProxyInterfaceOTRAdaptor : public Tp::AbstractAdaptor 31 { 32 Q_OBJECT 33 Q_CLASSINFO("D-Bus Interface", "org.kde.TelepathyProxy.ChannelProxy.Interface.OTR") 34 Q_CLASSINFO("D-Bus Introspection", "" 35 " <interface name=\"org.kde.TelepathyProxy.ChannelProxy.Interface.OTR\">\n" 36 " <property access=\"read\" type=\"o\" name=\"WrappedChannel\"/>\n" 37 " <property access=\"read\" type=\"b\" name=\"Connected\"/>\n" 38 " <property access=\"read\" type=\"aaa{sv}\" name=\"PendingMessages\">\n" 39 " <annotation value=\"Tp::MessagePartListList\" name=\"com.trolltech.QtDBus.QtTypeName\"/>\n" 40 " </property>\n" 41 " <property access=\"read\" type=\"u\" name=\"TrustLevel\"/>\n" 42 " <property access=\"read\" type=\"s\" name=\"LocalFingerprint\"/>\n" 43 " <property access=\"read\" type=\"s\" name=\"RemoteFingerprint\"/>\n" 44 " <method name=\"ConnectProxy\"/>\n" 45 " <method name=\"DisconnectProxy\"/>\n" 46 " <method name=\"SendMessage\">\n" 47 " <arg direction=\"in\" type=\"aa{sv}\" name=\"message\">\n" 48 " <annotation value=\"Tp::MessagePartList\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n" 49 " </arg>\n" 50 " <arg direction=\"in\" type=\"u\" name=\"flags\"/>\n" 51 " <arg direction=\"out\" type=\"s\" name=\"token\"/>\n" 52 " </method>\n" 53 " <method name=\"AcknowledgePendingMessages\">\n" 54 " <arg direction=\"in\" type=\"au\" name=\"IDs\"/>\n" 55 " </method>\n" 56 " <method name=\"Initialize\"/>\n" 57 " <method name=\"Stop\"/>\n" 58 " <method name=\"TrustFingerprint\">\n" 59 " <arg direction=\"in\" type=\"s\" name=\"fingerprint\"/>\n" 60 " <arg direction=\"in\" type=\"b\" name=\"trust\"/>\n" 61 " </method>\n" 62 " <method name=\"StartPeerAuthentication\">\n" 63 " <arg direction=\"in\" type=\"s\" name=\"question\"/>\n" 64 " <arg direction=\"in\" type=\"s\" name=\"secret\"/>\n" 65 " </method>\n" 66 " <method name=\"RespondPeerAuthentication\">\n" 67 " <arg direction=\"in\" type=\"s\" name=\"secret\"/>\n" 68 " </method>\n" 69 " <method name=\"AbortPeerAuthentication\"/>\n" 70 " <signal name=\"MessageSent\">\n" 71 " <arg type=\"aa{sv}\" name=\"content\">\n" 72 " <annotation value=\"Tp::MessagePartList\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n" 73 " </arg>\n" 74 " <arg type=\"u\" name=\"flags\"/>\n" 75 " <arg type=\"s\" name=\"messageToken\"/>\n" 76 " </signal>\n" 77 " <signal name=\"MessageReceived\">\n" 78 " <arg type=\"aa{sv}\" name=\"message\">\n" 79 " <annotation value=\"Tp::MessagePartList\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n" 80 " </arg>\n" 81 " </signal>\n" 82 " <signal name=\"PendingMessagesRemoved\">\n" 83 " <arg type=\"au\" name=\"messageIDs\"/>\n" 84 " </signal>\n" 85 " <signal name=\"PeerAuthenticationRequested\">\n" 86 " <arg type=\"s\" name=\"question\"/>\n" 87 " </signal>\n" 88 " <signal name=\"PeerAuthenticationConcluded\">\n" 89 " <arg type=\"b\" name=\"authenticated\"/>\n" 90 " </signal>\n" 91 " <signal name=\"PeerAuthenticationInProgress\"/>\n" 92 " <signal name=\"PeerAuthenticationAborted\"/>\n" 93 " <signal name=\"PeerAuthenticationError\"/>\n" 94 " <signal name=\"PeerAuthenticationCheated\"/>\n" 95 " <signal name=\"SessionRefreshed\"/>\n" 96 " <signal name=\"TrustLevelChanged\">\n" 97 " <arg type=\"u\" name=\"trustLevel\"/>\n" 98 " </signal>\n" 99 " </interface>\n" 100 "") 101 Q_PROPERTY(QDBusObjectPath WrappedChannel READ WrappedChannel ) 102 Q_PROPERTY(bool Connected READ Connected ) 103 Q_PROPERTY(Tp::MessagePartListList PendingMessages READ PendingMessages ) 104 Q_PROPERTY(uint TrustLevel READ TrustLevel ) 105 Q_PROPERTY(QString LocalFingerprint READ LocalFingerprint ) 106 Q_PROPERTY(QString RemoteFingerprint READ RemoteFingerprint ) 107 108 public: 109 ChannelProxyInterfaceOTRAdaptor(const QDBusConnection& dbusConnection, QObject* adaptee, QObject* parent); 110 ~ChannelProxyInterfaceOTRAdaptor() override; 111 112 typedef Tp::MethodInvocationContextPtr< > ConnectProxyContextPtr; 113 typedef Tp::MethodInvocationContextPtr< > DisconnectProxyContextPtr; 114 typedef Tp::MethodInvocationContextPtr< QString > SendMessageContextPtr; 115 typedef Tp::MethodInvocationContextPtr< > AcknowledgePendingMessagesContextPtr; 116 typedef Tp::MethodInvocationContextPtr< > InitializeContextPtr; 117 typedef Tp::MethodInvocationContextPtr< > StopContextPtr; 118 typedef Tp::MethodInvocationContextPtr< > TrustFingerprintContextPtr; 119 typedef Tp::MethodInvocationContextPtr< > StartPeerAuthenticationContextPtr; 120 typedef Tp::MethodInvocationContextPtr< > RespondPeerAuthenticationContextPtr; 121 typedef Tp::MethodInvocationContextPtr< > AbortPeerAuthenticationContextPtr; 122 123 public: // PROPERTIES 124 /** 125 * Return the value of the exported D-Bus object property \c WrappedChannel of type \c QDBusObjectPath. 126 * 127 * Adaptees should export this property as a Qt property named 128 * 'wrappedChannel' with type QDBusObjectPath. 129 * 130 * 131 * \htmlonly 132 * <p>Object path of the channel this proxy is created for</p> 133 * \endhtmlonly 134 * 135 * \return The value of exported property \c WrappedChannel. 136 */ 137 QDBusObjectPath WrappedChannel() const; 138 /** 139 * Return the value of the exported D-Bus object property \c Connected of type \c bool. 140 * 141 * Adaptees should export this property as a Qt property named 142 * 'connected' with type bool. 143 * 144 * 145 * \htmlonly 146 * <p>%TRUE if the proxy is connected</p> 147 * \endhtmlonly 148 * 149 * \return The value of exported property \c Connected. 150 */ 151 bool Connected() const; 152 /** 153 * Return the value of the exported D-Bus object property \c PendingMessages of type \c Tp::MessagePartListList. 154 * 155 * Adaptees should export this property as a Qt property named 156 * 'pendingMessages' with type Tp::MessagePartListList. 157 * 158 * 159 * \htmlonly 160 * <p> 161 * The same as: 162 * \endhtmlonly ChannelInterfaceMessagesInterface \htmlonly 163 * </p> 164 * \endhtmlonly 165 * 166 * \return The value of exported property \c PendingMessages. 167 */ 168 Tp::MessagePartListList PendingMessages() const; 169 /** 170 * Return the value of the exported D-Bus object property \c TrustLevel of type \c uint. 171 * 172 * Adaptees should export this property as a Qt property named 173 * 'trustLevel' with type uint. 174 * 175 * 176 * \htmlonly 177 * <p>The current trust level of this channel: 178 * 0=Not_Private, 1=Unverified, 2=Private, 179 * 3=Finished</p> 180 * <p>Clients MUST listen to TrustLevelChanged to update UI when trust 181 * level changes.</p> 182 * \endhtmlonly 183 * 184 * \return The value of exported property \c TrustLevel. 185 */ 186 uint TrustLevel() const; 187 /** 188 * Return the value of the exported D-Bus object property \c LocalFingerprint of type \c QString. 189 * 190 * Adaptees should export this property as a Qt property named 191 * 'localFingerprint' with type QString. 192 * 193 * 194 * \htmlonly 195 * <p>User's current fingerprint - a human readable 196 * fingerprint that can be displayed to the user so he can communicate it 197 * to the other end by other means so he can trust it.</p> 198 * \endhtmlonly 199 * 200 * \return The value of exported property \c LocalFingerprint. 201 */ 202 QString LocalFingerprint() const; 203 /** 204 * Return the value of the exported D-Bus object property \c RemoteFingerprint of type \c QString. 205 * 206 * Adaptees should export this property as a Qt property named 207 * 'remoteFingerprint' with type QString. 208 * 209 * 210 * \htmlonly 211 * <p>The current fingerprint of the remote contact. Should be displayed 212 * to the user to update its trust level. It is shown in human readable format i.e. 213 * :e '12345678 12345678 12345678 12345678 12345678'.</p> 214 * \endhtmlonly 215 * 216 * \return The value of exported property \c RemoteFingerprint. 217 */ 218 QString RemoteFingerprint() const; 219 220 public Q_SLOTS: // METHODS 221 /** 222 * Begins a call to the exported D-Bus method \c ConnectProxy on this object. 223 * 224 * Adaptees should export this method as a Qt slot with the following signature: 225 * void connectProxy(const Tp::Service::ChannelProxyInterfaceOTRAdaptor::ConnectProxyContextPtr &context); 226 * 227 * Implementations should call MethodInvocationContext::setFinished (or setFinishedWithError 228 * accordingly) on the received \a context object once the method has finished processing. 229 * 230 * 231 * Connect to the OTR proxy. From now on all data, which is modified by it 232 * should be acquired from the proxy, not from the underlying channel. 233 * 234 */ 235 void ConnectProxy(const QDBusMessage& dbusMessage); 236 /** 237 * Begins a call to the exported D-Bus method \c DisconnectProxy on this object. 238 * 239 * Adaptees should export this method as a Qt slot with the following signature: 240 * void disconnectProxy(const Tp::Service::ChannelProxyInterfaceOTRAdaptor::DisconnectProxyContextPtr &context); 241 * 242 * Implementations should call MethodInvocationContext::setFinished (or setFinishedWithError 243 * accordingly) on the received \a context object once the method has finished processing. 244 * 245 * 246 * Turns off the proxy if currenlty connected 247 * 248 */ 249 void DisconnectProxy(const QDBusMessage& dbusMessage); 250 /** 251 * Begins a call to the exported D-Bus method \c SendMessage on this object. 252 * 253 * Adaptees should export this method as a Qt slot with the following signature: 254 * void sendMessage(const Tp::MessagePartList& message, uint flags, const Tp::Service::ChannelProxyInterfaceOTRAdaptor::SendMessageContextPtr &context); 255 * 256 * Implementations should call MethodInvocationContext::setFinished (or setFinishedWithError 257 * accordingly) on the received \a context object once the method has finished processing. 258 * 259 * 260 * \htmlonly 261 * <p> 262 * The same as: 263 * \endhtmlonly org.freedesktop.Telepathy.Channel.Interface.Messages.Sent \htmlonly 264 * </p> 265 * \endhtmlonly 266 * 267 * \return 268 */ 269 QString SendMessage(const Tp::MessagePartList& message, uint flags, const QDBusMessage& dbusMessage); 270 /** 271 * Begins a call to the exported D-Bus method \c AcknowledgePendingMessages on this object. 272 * 273 * Adaptees should export this method as a Qt slot with the following signature: 274 * void acknowledgePendingMessages(const Tp::UIntList& IDs, const Tp::Service::ChannelProxyInterfaceOTRAdaptor::AcknowledgePendingMessagesContextPtr &context); 275 * 276 * Implementations should call MethodInvocationContext::setFinished (or setFinishedWithError 277 * accordingly) on the received \a context object once the method has finished processing. 278 * 279 * 280 * \htmlonly 281 * <p> 282 * The same as: 283 * \endhtmlonly ChannelTypeTextInterface \htmlonly 284 * </p> 285 * \endhtmlonly 286 * 287 */ 288 void AcknowledgePendingMessages(const Tp::UIntList& IDs, const QDBusMessage& dbusMessage); 289 /** 290 * Begins a call to the exported D-Bus method \c Initialize on this object. 291 * 292 * Adaptees should export this method as a Qt slot with the following signature: 293 * void initialize(const Tp::Service::ChannelProxyInterfaceOTRAdaptor::InitializeContextPtr &context); 294 * 295 * Implementations should call MethodInvocationContext::setFinished (or setFinishedWithError 296 * accordingly) on the received \a context object once the method has finished processing. 297 * 298 * 299 * Start an OTR session for this channel if the remote end supports it as 300 * well. 301 * 302 */ 303 void Initialize(const QDBusMessage& dbusMessage); 304 /** 305 * Begins a call to the exported D-Bus method \c Stop on this object. 306 * 307 * Adaptees should export this method as a Qt slot with the following signature: 308 * void stop(const Tp::Service::ChannelProxyInterfaceOTRAdaptor::StopContextPtr &context); 309 * 310 * Implementations should call MethodInvocationContext::setFinished (or setFinishedWithError 311 * accordingly) on the received \a context object once the method has finished processing. 312 * 313 * 314 * Stops the OTR session. 315 * 316 */ 317 void Stop(const QDBusMessage& dbusMessage); 318 /** 319 * Begins a call to the exported D-Bus method \c TrustFingerprint on this object. 320 * 321 * Adaptees should export this method as a Qt slot with the following signature: 322 * void trustFingerprint(const QString& fingerprint, bool trust, const Tp::Service::ChannelProxyInterfaceOTRAdaptor::TrustFingerprintContextPtr &context); 323 * 324 * Implementations should call MethodInvocationContext::setFinished (or setFinishedWithError 325 * accordingly) on the received \a context object once the method has finished processing. 326 * 327 * 328 * Set whether or not the user trusts the given fingerprint. It has to be 329 * the fingerprint the remote contact is currently using. 330 * 331 * \param fingerprint 332 * 333 * The fingerprint in format: '12345678 12345678 12345678 334 * 12345678 12345678' 335 * \param trust 336 * 337 * %TRUE if trusted, %FALSE otherwise. 338 */ 339 void TrustFingerprint(const QString& fingerprint, bool trust, const QDBusMessage& dbusMessage); 340 /** 341 * Begins a call to the exported D-Bus method \c StartPeerAuthentication on this object. 342 * 343 * Adaptees should export this method as a Qt slot with the following signature: 344 * void startPeerAuthentication(const QString& question, const QString& secret, const Tp::Service::ChannelProxyInterfaceOTRAdaptor::StartPeerAuthenticationContextPtr &context); 345 * 346 * Implementations should call MethodInvocationContext::setFinished (or setFinishedWithError 347 * accordingly) on the received \a context object once the method has finished processing. 348 * 349 * 350 * \htmlonly 351 * <p>This method starts peer authentication using the Socialist 352 * Millionaire protocol.</p> 353 * \endhtmlonly 354 * 355 * \param question 356 * 357 * The question to be used for peer authentication. It is used by the 358 * remote peer as a hint for the shared secret. If an empty string is 359 * passed only the shared secret will be used on the peer 360 * authentication process. 361 * \param secret 362 * 363 * The shared secret to be used for peer authentication. If the 364 * Question parameter is not empty, this should be the answer to it. 365 */ 366 void StartPeerAuthentication(const QString& question, const QString& secret, const QDBusMessage& dbusMessage); 367 /** 368 * Begins a call to the exported D-Bus method \c RespondPeerAuthentication on this object. 369 * 370 * Adaptees should export this method as a Qt slot with the following signature: 371 * void respondPeerAuthentication(const QString& secret, const Tp::Service::ChannelProxyInterfaceOTRAdaptor::RespondPeerAuthenticationContextPtr &context); 372 * 373 * Implementations should call MethodInvocationContext::setFinished (or setFinishedWithError 374 * accordingly) on the received \a context object once the method has finished processing. 375 * 376 * 377 * \htmlonly 378 * <p>This method continues the peer authentication started by the remote 379 * peer.</p> 380 * \endhtmlonly 381 * 382 * \param secret 383 * 384 * The shared secret to be used for peer authentication. 385 */ 386 void RespondPeerAuthentication(const QString& secret, const QDBusMessage& dbusMessage); 387 /** 388 * Begins a call to the exported D-Bus method \c AbortPeerAuthentication on this object. 389 * 390 * Adaptees should export this method as a Qt slot with the following signature: 391 * void abortPeerAuthentication(const Tp::Service::ChannelProxyInterfaceOTRAdaptor::AbortPeerAuthenticationContextPtr &context); 392 * 393 * Implementations should call MethodInvocationContext::setFinished (or setFinishedWithError 394 * accordingly) on the received \a context object once the method has finished processing. 395 * 396 * 397 * \htmlonly 398 * <p>This method aborts the peer authentication process.</p> 399 * \endhtmlonly 400 * 401 */ 402 void AbortPeerAuthentication(const QDBusMessage& dbusMessage); 403 404 Q_SIGNALS: // SIGNALS 405 /** 406 * Represents the exported D-Bus signal \c MessageSent on this object. 407 * 408 * Adaptees should export this signal as a Qt signal with the following signature: 409 * void messageSent(const Tp::MessagePartList& content, uint flags, const QString& messageToken); 410 * 411 * The adaptee signal will be automatically relayed as a D-Bus signal once emitted. 412 * 413 */ 414 void MessageSent(const Tp::MessagePartList& content, uint flags, const QString& messageToken); 415 /** 416 * Represents the exported D-Bus signal \c MessageReceived on this object. 417 * 418 * Adaptees should export this signal as a Qt signal with the following signature: 419 * void messageReceived(const Tp::MessagePartList& message); 420 * 421 * The adaptee signal will be automatically relayed as a D-Bus signal once emitted. 422 * 423 */ 424 void MessageReceived(const Tp::MessagePartList& message); 425 /** 426 * Represents the exported D-Bus signal \c PendingMessagesRemoved on this object. 427 * 428 * Adaptees should export this signal as a Qt signal with the following signature: 429 * void pendingMessagesRemoved(const Tp::UIntList& messageIDs); 430 * 431 * The adaptee signal will be automatically relayed as a D-Bus signal once emitted. 432 * 433 */ 434 void PendingMessagesRemoved(const Tp::UIntList& messageIDs); 435 /** 436 * Represents the exported D-Bus signal \c PeerAuthenticationRequested on this object. 437 * 438 * Adaptees should export this signal as a Qt signal with the following signature: 439 * void peerAuthenticationRequested(const QString& question); 440 * 441 * The adaptee signal will be automatically relayed as a D-Bus signal once emitted. 442 * 443 * \param question 444 * 445 * The question the remote peer is using for peer authentication. If 446 * an empty string is passed only the shared secret will be used on 447 * the peer authentication process. 448 */ 449 void PeerAuthenticationRequested(const QString& question); 450 /** 451 * Represents the exported D-Bus signal \c PeerAuthenticationConcluded on this object. 452 * 453 * Adaptees should export this signal as a Qt signal with the following signature: 454 * void peerAuthenticationConcluded(bool authenticated); 455 * 456 * The adaptee signal will be automatically relayed as a D-Bus signal once emitted. 457 * 458 * \param authenticated 459 * 460 * True if peer identity could be authenticated, false otherwise. 461 */ 462 void PeerAuthenticationConcluded(bool authenticated); 463 /** 464 * Represents the exported D-Bus signal \c PeerAuthenticationInProgress on this object. 465 * 466 * Adaptees should export this signal as a Qt signal with the following signature: 467 * void peerAuthenticationAborted(); 468 * 469 * The adaptee signal will be automatically relayed as a D-Bus signal once emitted. 470 * 471 */ 472 void PeerAuthenticationInProgress(); 473 /** 474 * Represents the exported D-Bus signal \c PeerAuthenticationAborted on this object. 475 * 476 * Adaptees should export this signal as a Qt signal with the following signature: 477 * void peerAuthenticationAborted(); 478 * 479 * The adaptee signal will be automatically relayed as a D-Bus signal once emitted. 480 * 481 */ 482 void PeerAuthenticationAborted(); 483 /** 484 * Represents the exported D-Bus signal \c PeerAuthenticationError on this object. 485 * 486 * Adaptees should export this signal as a Qt signal with the following signature: 487 * void peerAuthenticationError(); 488 * 489 * The adaptee signal will be automatically relayed as a D-Bus signal once emitted. 490 * 491 */ 492 void PeerAuthenticationError(); 493 /** 494 * Represents the exported D-Bus signal \c PeerAuthenticationCheated on this object. 495 * 496 * Adaptees should export this signal as a Qt signal with the following signature: 497 * void peerAuthenticationCheated(); 498 * 499 * The adaptee signal will be automatically relayed as a D-Bus signal once emitted. 500 * 501 */ 502 void PeerAuthenticationCheated(); 503 /** 504 * Represents the exported D-Bus signal \c SessionRefreshed on this object. 505 * 506 * Adaptees should export this signal as a Qt signal with the following signature: 507 * void sessionRefreshed(); 508 * 509 * The adaptee signal will be automatically relayed as a D-Bus signal once emitted. 510 * 511 */ 512 void SessionRefreshed(); 513 /** 514 * Represents the exported D-Bus signal \c TrustLevelChanged on this object. 515 * 516 * Adaptees should export this signal as a Qt signal with the following signature: 517 * void trustLevelChanged(uint trustLevel); 518 * 519 * The adaptee signal will be automatically relayed as a D-Bus signal once emitted. 520 * 521 */ 522 void TrustLevelChanged(uint trustLevel); 523 }; 524 525 } 526 } 527 528 #endif 529