Advertisement
Guest User

Untitled

a guest
May 27th, 2017
550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 10.77 KB | None | 0 0
  1. @file: offer-tcp-streamtube-job.h
  2.  
  3. /*
  4. * Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli@gmail.com>
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  19. */
  20.  
  21. #ifndef OFFER_TCP_STREAMTUBE_JOB_H
  22. #define OFFER_TCP_STREAMTUBE_JOB_H
  23.  
  24. #include "telepathy-base-job.h"
  25.  
  26. namespace Nepomuk {
  27.     class PersonContact;
  28.     class Person;
  29. }
  30.  
  31. namespace Tp {
  32.     class OutgoingStreamTubeChannel;
  33. }
  34.  
  35. class QTcpServer;
  36. class QTcpSocket;
  37. class QHostAddress;
  38. class QVariantMap;
  39.  
  40. class OfferTcpStreamTubeJobPrivate;
  41. class OfferTcpStreamTubeJob : public TelepathyBaseJob
  42. {
  43.     Q_OBJECT
  44.     Q_DISABLE_COPY(OfferTcpStreamTubeJob)
  45.     Q_DECLARE_PRIVATE(OfferTcpStreamTubeJob)
  46.  
  47.     enum ProcessingMode {
  48.         OfferTcpStreamTubeContactMode,
  49.         OfferTcpStreamTubeContactHostAddressMode,
  50.         OfferTcpStreamTubeContactTcpServerMode,
  51.         OfferTcpStreamTubeMetaContactMode,
  52.         OfferTcpStreamTubeMetaContactHostAddressMode,
  53.         OfferTcpStreamTubeMetaContactTcpServerMode
  54.     };
  55.  
  56.     // Our Q_PRIVATE_SLOTS who perform the real job
  57.     Q_PRIVATE_SLOT(d_func(), void __k__offerTcpStreamTubeContact())
  58.     Q_PRIVATE_SLOT(d_func(), void __k__offerTcpStreamTubeContactHostAddress())
  59.     Q_PRIVATE_SLOT(d_func(), void __k__offerTcpStreamTubeContactTcpServer())
  60.     Q_PRIVATE_SLOT(d_func(), void __k__offerTcpStreamTubeMetaContact())
  61.     Q_PRIVATE_SLOT(d_func(), void __k__offerTcpStreamTubeMetaContactHostAddress())
  62.     Q_PRIVATE_SLOT(d_func(), void __k__offerTcpStreamTubeMetaContactTcpServer())
  63.  
  64.     public:
  65.         OfferTcpStreamTubeJob(const Nepomuk::PersonContact &contact, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  66.         OfferTcpStreamTubeJob(const Nepomuk::PersonContact &contact, const QHostAddress &address, quint16 port, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  67.         OfferTcpStreamTubeJob(const Nepomuk::PersonContact &contact, QTcpServer *server, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  68.         OfferTcpStreamTubeJob(const Nepomuk::Person &contact, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  69.         OfferTcpStreamTubeJob(const Nepomuk::Person &contact, const QHostAddress &address, quint16 port, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  70.         OfferTcpStreamTubeJob(const Nepomuk::Person &contact, QTcpServer *server, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  71.  
  72.         virtual ~OfferTcpStreamTubeJob();
  73.  
  74.         virtual void start();
  75.  
  76.         QTcpServer* tcpServer() const;
  77.         Tp::OutgoingStreamTubeChannel* outgoingStreamTubeChannel() const;
  78. };
  79.  
  80. #endif // OFFER_TCP_STREAMTUBE_JOB_H
  81.  
  82. --------------------------------------------------------------------------------
  83. @file: accept-tcp-streamtube-job.h
  84.  
  85. /*
  86. * Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli@gmail.com>
  87. *
  88. * This library is free software; you can redistribute it and/or
  89. * modify it under the terms of the GNU Lesser General Public
  90. * License as published by the Free Software Foundation; either
  91. * version 2.1 of the License, or (at your option) any later version.
  92. *
  93. * This library is distributed in the hope that it will be useful,
  94. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  95. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  96. * Lesser General Public License for more details.
  97. *
  98. * You should have received a copy of the GNU Lesser General Public
  99. * License along with this library; if not, write to the Free Software
  100. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  101. */
  102.  
  103. #ifndef ACCEPT_TCP_STREAMTUBE_JOB_H
  104. #define ACCEPT_TCP_STREAMTUBE_JOB_H
  105.  
  106. #include "telepathy-base-job.h"
  107.  
  108. #include <QHostAddress>
  109.  
  110. namespace Tp {
  111.     class IncomingStreamTubeChannel;
  112. }
  113.  
  114. class QTcpSocket;
  115. class QVariantMap;
  116.  
  117. class AcceptTcpStreamTubeJobPrivate;
  118. class AcceptTcpStreamTubeJob : public TelepathyBaseJob
  119. {
  120.     Q_OBJECT
  121.     Q_DISABLE_COPY(AcceptStreamTubeJob)
  122.     Q_DECLARE_PRIVATE(AcceptStreamTubeJob)
  123.  
  124.     // Our Q_PRIVATE_SLOTS who perform the real job
  125.     Q_PRIVATE_SLOT(d_func(), void __k__acceptTcpStreamTube())
  126.  
  127.     public:
  128.         AcceptTcpStreamTubeJob(const QHostAddress &allowedAddress = QHostAddress::Any, quint16 allowedPort = 0, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  129.  
  130.         virtual ~AcceptTcpStreamTubeJob();
  131.  
  132.         virtual void start();
  133.  
  134.         QTcpSocket* tcpSocket() const;
  135.         Tp::IncomingStreamTubeChannel* incomingStreamTubeChannel() const;
  136. };
  137.  
  138. #endif // ACCEPT_TCP_STREAMTUBE_JOB_H
  139.  
  140. --------------------------------------------------------------------------------
  141. @file: offer-local-streamtube-job.h
  142.  
  143. /*
  144. * Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli@gmail.com>
  145. *
  146. * This library is free software; you can redistribute it and/or
  147. * modify it under the terms of the GNU Lesser General Public
  148. * License as published by the Free Software Foundation; either
  149. * version 2.1 of the License, or (at your option) any later version.
  150. *
  151. * This library is distributed in the hope that it will be useful,
  152. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  153. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  154. * Lesser General Public License for more details.
  155. *
  156. * You should have received a copy of the GNU Lesser General Public
  157. * License along with this library; if not, write to the Free Software
  158. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  159. */
  160.  
  161. #ifndef OFFER_LOCAL_STREAMTUBE_JOB_H
  162. #define OFFER_LOCAL_STREAMTUBE_JOB_H
  163.  
  164. #include "telepathy-base-job.h"
  165.  
  166. namespace Nepomuk {
  167.     class PersonContact;
  168.     class Person;
  169. }
  170.  
  171. namespace Tp {
  172.     class OutgoingStreamTubeChannel;
  173. }
  174.  
  175. class QLocalServer;
  176. class QLocalSocket;
  177. class QVariantMap;
  178.  
  179. class OfferLocalStreamTubeJobPrivate;
  180. class OfferLocalStreamTubeJob : public TelepathyBaseJob
  181. {
  182.     Q_OBJECT
  183.     Q_DISABLE_COPY(OfferLocalStreamTubeJob)
  184.     Q_DECLARE_PRIVATE(OfferLocalStreamTubeJob)
  185.  
  186.     enum ProcessingMode {
  187.         OfferLocalStreamTubeContactMode,
  188.         OfferLocalStreamTubeContactSocketAddressMode,
  189.         OfferLocalStreamTubeContactLocalServerMode,
  190.         OfferLocalStreamTubeMetaContactMode,
  191.         OfferLocalStreamTubeMetaContactSocketAddressMode,
  192.         OfferLocalStreamTubeMetaContactLocalServerMode
  193.     };
  194.  
  195.     // Our Q_PRIVATE_SLOTS who perform the real job
  196.     Q_PRIVATE_SLOT(d_func(), void __k__offerLocalStreamTubeContact())
  197.     Q_PRIVATE_SLOT(d_func(), void __k__offerLocalStreamTubeContactSocketAddress())
  198.     Q_PRIVATE_SLOT(d_func(), void __k__offerLocalStreamTubeContactLocalServer())
  199.     Q_PRIVATE_SLOT(d_func(), void __k__offerLocalStreamTubeMetaContact())
  200.     Q_PRIVATE_SLOT(d_func(), void __k__offerLocalStreamTubeMetaContactSocketAddress())
  201.     Q_PRIVATE_SLOT(d_func(), void __k__offerLocalStreamTubeMetaContactLocalServer())
  202.  
  203.     public:
  204.         OfferLocalStreamTubeJob(const Nepomuk::PersonContact &contact, bool requireCredentials = false, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  205.         OfferLocalStreamTubeJob(const Nepomuk::PersonContact &contact, const QByteArray &socketAddress, bool requireCredentials = false, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  206.         OfferLocalStreamTubeJob(const Nepomuk::PersonContact &contact, QLocalServer *server, bool requireCredentials = false, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  207.         OfferLocalStreamTubeJob(const Nepomuk::Person &contact, bool requireCredentials = false, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  208.         OfferLocalStreamTubeJob(const Nepomuk::Person &contact, const QByteArray &socketAddress, bool requireCredentials = false, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  209.         OfferLocalStreamTubeJob(const Nepomuk::Person &contact, QLocalServer *server, bool requireCredentials = false, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  210.  
  211.         virtual ~OfferLocalStreamTubeJob();
  212.  
  213.         virtual void start();
  214.  
  215.         QLocalServer* localServer() const;
  216.         Tp::OutgoingStreamTubeChannel* outgoingStreamTubeChannel() const {return m_channel;}
  217. };
  218.  
  219. #endif // OFFER_LOCAL_STREAMTUBE_JOB_H
  220.  
  221. --------------------------------------------------------------------------------
  222. @file: accept-local-streamtube-job.h
  223.  
  224. /*
  225. * Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli@gmail.com>
  226. *
  227. * This library is free software; you can redistribute it and/or
  228. * modify it under the terms of the GNU Lesser General Public
  229. * License as published by the Free Software Foundation; either
  230. * version 2.1 of the License, or (at your option) any later version.
  231. *
  232. * This library is distributed in the hope that it will be useful,
  233. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  234. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  235. * Lesser General Public License for more details.
  236. *
  237. * You should have received a copy of the GNU Lesser General Public
  238. * License along with this library; if not, write to the Free Software
  239. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  240. */
  241.  
  242. #ifndef ACCEPT_LOCAL_STREAMTUBE_JOB_H
  243. #define ACCEPT_LOCAL_STREAMTUBE_JOB_H
  244.  
  245. #include "telepathy-base-job.h"
  246.  
  247. namespace Tp {
  248.     class IncomingStreamTubeChannel;
  249. }
  250.  
  251. class QLocalSocket;
  252. class QVariantMap;
  253.  
  254. class AcceptLocalStreamTubeJobPrivate;
  255. class AcceptLocalStreamTubeJob : public TelepathyBaseJob
  256. {
  257.     Q_OBJECT
  258.     Q_DISABLE_COPY(AcceptStreamTubeJob)
  259.     Q_DECLARE_PRIVATE(AcceptStreamTubeJob)
  260.  
  261.     // Our Q_PRIVATE_SLOTS who perform the real job
  262.     Q_PRIVATE_SLOT(d_func(), void __k__acceptLocalStreamTube())
  263.  
  264.     public:
  265.         AcceptLocalStreamTubeJob(bool requireCredentials = false, const QVariantMap &parameters = QVariantMap(), QObject *parent = 0);
  266.  
  267.         virtual ~AcceptLocalStreamTubeJob();
  268.  
  269.         virtual void start();
  270.  
  271.         QLocalSocket* localSocket() const;
  272.  
  273.         Tp::IncomingStreamTubeChannel* incomingStreamTubeChannel() const;
  274. };
  275.  
  276. #endif // ACCEPT_LOCAL_STREAMTUBE_JOB_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement