Advertisement
Guest User

Untitled

a guest
May 27th, 2017
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 10.70 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.  
  116. class AcceptTcpStreamTubeJobPrivate;
  117. class AcceptTcpStreamTubeJob : public TelepathyBaseJob
  118. {
  119.     Q_OBJECT
  120.     Q_DISABLE_COPY(AcceptStreamTubeJob)
  121.     Q_DECLARE_PRIVATE(AcceptStreamTubeJob)
  122.  
  123.     // Our Q_PRIVATE_SLOTS who perform the real job
  124.     Q_PRIVATE_SLOT(d_func(), void __k__acceptTcpStreamTube())
  125.  
  126.     public:
  127.         AcceptTcpStreamTubeJob(const QHostAddress &allowedAddress = QHostAddress::Any, quint16 allowedPort = 0, QObject *parent = 0);
  128.  
  129.         virtual ~AcceptTcpStreamTubeJob();
  130.  
  131.         virtual void start();
  132.  
  133.         QTcpSocket* tcpSocket() const;
  134.         Tp::IncomingStreamTubeChannel* incomingStreamTubeChannel() const;
  135. };
  136.  
  137. #endif // ACCEPT_TCP_STREAMTUBE_JOB_H
  138.  
  139. --------------------------------------------------------------------------------
  140. @file: offer-local-streamtube-job.h
  141.  
  142. /*
  143. * Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli@gmail.com>
  144. *
  145. * This library is free software; you can redistribute it and/or
  146. * modify it under the terms of the GNU Lesser General Public
  147. * License as published by the Free Software Foundation; either
  148. * version 2.1 of the License, or (at your option) any later version.
  149. *
  150. * This library is distributed in the hope that it will be useful,
  151. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  152. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  153. * Lesser General Public License for more details.
  154. *
  155. * You should have received a copy of the GNU Lesser General Public
  156. * License along with this library; if not, write to the Free Software
  157. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  158. */
  159.  
  160. #ifndef OFFER_LOCAL_STREAMTUBE_JOB_H
  161. #define OFFER_LOCAL_STREAMTUBE_JOB_H
  162.  
  163. #include "telepathy-base-job.h"
  164.  
  165. namespace Nepomuk {
  166.     class PersonContact;
  167.     class Person;
  168. }
  169.  
  170. namespace Tp {
  171.     class OutgoingStreamTubeChannel;
  172. }
  173.  
  174. class QLocalServer;
  175. class QLocalSocket;
  176. class QVariantMap;
  177.  
  178. class OfferLocalStreamTubeJobPrivate;
  179. class OfferLocalStreamTubeJob : public TelepathyBaseJob
  180. {
  181.     Q_OBJECT
  182.     Q_DISABLE_COPY(OfferLocalStreamTubeJob)
  183.     Q_DECLARE_PRIVATE(OfferLocalStreamTubeJob)
  184.  
  185.     enum ProcessingMode {
  186.         OfferLocalStreamTubeContactMode,
  187.         OfferLocalStreamTubeContactSocketAddressMode,
  188.         OfferLocalStreamTubeContactLocalServerMode,
  189.         OfferLocalStreamTubeMetaContactMode,
  190.         OfferLocalStreamTubeMetaContactSocketAddressMode,
  191.         OfferLocalStreamTubeMetaContactLocalServerMode
  192.     };
  193.  
  194.     // Our Q_PRIVATE_SLOTS who perform the real job
  195.     Q_PRIVATE_SLOT(d_func(), void __k__offerLocalStreamTubeContact())
  196.     Q_PRIVATE_SLOT(d_func(), void __k__offerLocalStreamTubeContactSocketAddress())
  197.     Q_PRIVATE_SLOT(d_func(), void __k__offerLocalStreamTubeContactLocalServer())
  198.     Q_PRIVATE_SLOT(d_func(), void __k__offerLocalStreamTubeMetaContact())
  199.     Q_PRIVATE_SLOT(d_func(), void __k__offerLocalStreamTubeMetaContactSocketAddress())
  200.     Q_PRIVATE_SLOT(d_func(), void __k__offerLocalStreamTubeMetaContactLocalServer())
  201.  
  202.     public:
  203.         OfferLocalStreamTubeJob(const Nepomuk::PersonContact &contact, const QVariantMap &parameters = QVariantMap(), bool requireCredentials = false, QObject *parent = 0);
  204.         OfferLocalStreamTubeJob(const Nepomuk::PersonContact &contact, const QByteArray &socketAddress, const QVariantMap &parameters = QVariantMap(), bool requireCredentials = false, QObject *parent = 0);
  205.         OfferLocalStreamTubeJob(const Nepomuk::PersonContact &contact, QLocalServer *server, const QVariantMap &parameters = QVariantMap(), bool requireCredentials = false, QObject *parent = 0);
  206.         OfferLocalStreamTubeJob(const Nepomuk::Person &contact, const QVariantMap &parameters = QVariantMap(), bool requireCredentials = false, QObject *parent = 0);
  207.         OfferLocalStreamTubeJob(const Nepomuk::Person &contact, const QByteArray &socketAddress, const QVariantMap &parameters = QVariantMap(), bool requireCredentials = false, QObject *parent = 0);
  208.         OfferLocalStreamTubeJob(const Nepomuk::Person &contact, QLocalServer *server, const QVariantMap &parameters = QVariantMap(), bool requireCredentials = false, QObject *parent = 0);
  209.  
  210.         virtual ~OfferLocalStreamTubeJob();
  211.  
  212.         virtual void start();
  213.  
  214.         QLocalServer* localServer() const;
  215.         Tp::OutgoingStreamTubeChannel* outgoingStreamTubeChannel() const {return m_channel;}
  216. };
  217.  
  218. #endif // OFFER_LOCAL_STREAMTUBE_JOB_H
  219.  
  220. --------------------------------------------------------------------------------
  221. @file: accept-local-streamtube-job.h
  222.  
  223. /*
  224. * Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli@gmail.com>
  225. *
  226. * This library is free software; you can redistribute it and/or
  227. * modify it under the terms of the GNU Lesser General Public
  228. * License as published by the Free Software Foundation; either
  229. * version 2.1 of the License, or (at your option) any later version.
  230. *
  231. * This library is distributed in the hope that it will be useful,
  232. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  233. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  234. * Lesser General Public License for more details.
  235. *
  236. * You should have received a copy of the GNU Lesser General Public
  237. * License along with this library; if not, write to the Free Software
  238. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  239. */
  240.  
  241. #ifndef ACCEPT_LOCAL_STREAMTUBE_JOB_H
  242. #define ACCEPT_LOCAL_STREAMTUBE_JOB_H
  243.  
  244. #include "telepathy-base-job.h"
  245.  
  246. namespace Tp {
  247.     class IncomingStreamTubeChannel;
  248. }
  249.  
  250. class QLocalSocket;
  251. class QVariantMap;
  252.  
  253. class AcceptLocalStreamTubeJobPrivate;
  254. class AcceptLocalStreamTubeJob : public TelepathyBaseJob
  255. {
  256.     Q_OBJECT
  257.     Q_DISABLE_COPY(AcceptStreamTubeJob)
  258.     Q_DECLARE_PRIVATE(AcceptStreamTubeJob)
  259.  
  260.     // Our Q_PRIVATE_SLOTS who perform the real job
  261.     Q_PRIVATE_SLOT(d_func(), void __k__acceptLocalStreamTube())
  262.  
  263.     public:
  264.         AcceptLocalStreamTubeJob(const QVariantMap &parameters = QVariantMap(), bool requireCredentials = false, QObject *parent = 0);
  265.  
  266.         virtual ~AcceptLocalStreamTubeJob();
  267.  
  268.         virtual void start();
  269.  
  270.         QLocalSocket* localSocket() const;
  271.  
  272.         Tp::IncomingStreamTubeChannel* incomingStreamTubeChannel() const;
  273. };
  274.  
  275. #endif // ACCEPT_LOCAL_STREAMTUBE_JOB_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement