Advertisement
Guest User

Untitled

a guest
May 26th, 2017
524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.71 KB | None | 0 0
  1. /*
  2. * Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli@gmail.com>
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  17. */
  18.  
  19. #ifndef TELEPATHY_TUBE_JOB_H
  20. #define TELEPATHY_TUBE_JOB_H
  21.  
  22. #include "telepathy-base-job.h"
  23.  
  24. class TelepathyTubeJobPrivate;
  25. class TelepathyTubeJob : public TelepathyBaseJob
  26. {
  27.     Q_OBJECT
  28.     Q_DISABLE_COPY(TelepathyTubeJob)
  29.     Q_DECLARE_PRIVATE(TelepathyTubeJob)
  30.  
  31.     protected:
  32.         explicit TelepathyTubeJob(TelepathyTubeJobPrivate &dd, QObject *parent = 0);
  33.         virtual ~TelepathyTubeJob();
  34.  
  35.         TelepathyTubeJobPrivate * const d_ptr;
  36.  
  37.     Q_SIGNALS:
  38.         void telepathyTubeChannelCreated();
  39.         void telepathyTubeChannelInvalidated();
  40.         void telepathyTubeChannelReady();
  41.         void telepathyTubeChannelNewRemoteConnection();
  42. };
  43.  
  44. #endif // TELEPATHY_TUBE_JOB_H
  45.  
  46. ----------------------------------------------------------------------------
  47.  
  48. /*
  49. * Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli@gmail.com>
  50. *
  51. * This library is free software; you can redistribute it and/or
  52. * modify it under the terms of the GNU Lesser General Public
  53. * License as published by the Free Software Foundation; either
  54. * version 2.1 of the License, or (at your option) any later version.
  55. *
  56. * This library is distributed in the hope that it will be useful,
  57. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  58. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  59. * Lesser General Public License for more details.
  60. *
  61. * You should have received a copy of the GNU Lesser General Public
  62. * License along with this library; if not, write to the Free Software
  63. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  64. */
  65.  
  66. #ifndef STREAMTUBE_JOB_H
  67. #define STREAMTUBE_JOB_H
  68.  
  69. #include "telepathy-tube-job.h"
  70.  
  71. class QIODevice;
  72.  
  73. class StreamTubeJobPrivate;
  74. class StreamTubeJob : public TelepathyTubeJob
  75. {
  76.     Q_OBJECT
  77.     Q_DISABLE_COPY(StreamTubeJob)
  78.     Q_DECLARE_PRIVATE(StreamTubeJob)
  79.  
  80.     protected:
  81.         explicit StreamTubeJob(StreamTubeJobPrivate &dd, QObject *parent = 0);
  82.         virtual ~StreamTubeJob();
  83.  
  84.         StreamTubeJobPrivate * const d_ptr;
  85.  
  86.     public:
  87.         QIODevice* device();
  88. };
  89.  
  90. #endif // STREAMTUBE_JOB_H
  91.  
  92. -------------------------------------------------------
  93.  
  94. /*
  95. * Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli@gmail.com>
  96. *
  97. * This library is free software; you can redistribute it and/or
  98. * modify it under the terms of the GNU Lesser General Public
  99. * License as published by the Free Software Foundation; either
  100. * version 2.1 of the License, or (at your option) any later version.
  101. *
  102. * This library is distributed in the hope that it will be useful,
  103. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  104. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  105. * Lesser General Public License for more details.
  106. *
  107. * You should have received a copy of the GNU Lesser General Public
  108. * License along with this library; if not, write to the Free Software
  109. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  110. */
  111.  
  112. #ifndef TCP_STREAMTUBE_JOB_H
  113. #define TCP_STREAMTUBE_JOB_H
  114.  
  115. #include "streamtube-job.h"
  116.  
  117. class QTcpSocket;
  118.  
  119. namespace Nepomuk {
  120.     class PersonContact;
  121.     class Person;
  122. }
  123.  
  124. class TcpStreamTubeJobPrivate;
  125. class TcpStreamTubeJob : public StreamTubeJob
  126. {
  127.     Q_OBJECT
  128.     Q_DISABLE_COPY(TcpStreamTubeJob)
  129.     Q_DECLARE_PRIVATE(TcpStreamTubeJob)
  130.  
  131.     protected:
  132.         explicit TcpStreamTubeJob(StreamTubeJobPrivate &dd, QObject *parent = 0);
  133.         virtual ~TcpStreamTubeJob();
  134.  
  135.         TcpStreamTubeJobPrivate * const d_ptr;
  136.  
  137.     public:
  138.         QTcpSocket* socket();
  139. };
  140.  
  141. #endif // TCP_STREAMTUBE_JOB_H
  142.  
  143.  
  144. --------------------------------------------------------
  145.  
  146. /*
  147. * Copyright (C) 2010 Daniele E. Domenichelli <daniele.domenichelli@gmail.com>
  148. *
  149. * This library is free software; you can redistribute it and/or
  150. * modify it under the terms of the GNU Lesser General Public
  151. * License as published by the Free Software Foundation; either
  152. * version 2.1 of the License, or (at your option) any later version.
  153. *
  154. * This library is distributed in the hope that it will be useful,
  155. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  156. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  157. * Lesser General Public License for more details.
  158. *
  159. * You should have received a copy of the GNU Lesser General Public
  160. * License along with this library; if not, write to the Free Software
  161. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  162. */
  163.  
  164. #ifndef OFFER_TCP_STREAMTUBE_JOB_H
  165. #define OFFER_TCP_STREAMTUBE_JOB_H
  166.  
  167. #include "tcp-streamtube-job.h"
  168. #include "telepathy-bridge.h"
  169.  
  170. namespace Nepomuk {
  171.     class PersonContact;
  172.     class Person;
  173. }
  174.  
  175. class QTcpServer;
  176.  
  177. class OfferTcpStreamTubeJobPrivate;
  178. class OfferTcpStreamTubeJob : public TcpStreamTubeJob
  179. {
  180.     Q_OBJECT
  181.     Q_DISABLE_COPY(OfferTcpStreamTubeJob)
  182.     Q_DECLARE_PRIVATE(OfferTcpStreamTubeJob)
  183.  
  184.     enum ProcessingMode {
  185.         OfferTcpStreamTubeContactMode,
  186.         OfferTcpStreamTubeMetaContactMode,
  187.     };
  188.  
  189.  
  190.     // Our Q_PRIVATE_SLOTS who perform the real job
  191.     Q_PRIVATE_SLOT(d_func(), void __k__offerTcpStreamTubeContact())
  192.     Q_PRIVATE_SLOT(d_func(), void __k__offerTcpStreamTubeMetaContact())
  193.  
  194.     public:
  195.         OfferStreamTubeJob(const Nepomuk::PersonContact &contact, const StreamTubeSocketMode socketMode = TcpSocketMode, QObject *parent = 0);
  196.         OfferStreamTubeJob(const Nepomuk::Person &contact, const SocketMode socketMode = TcpSocketMode, QObject *parent = 0);
  197.  
  198.         // TODO Match those constructors
  199. //        PendingOperation *offerTubeAsTcpSocket(const QHostAddress &address, quint16 port, const QVariantMap &parameters);
  200. //        PendingOperation *offerTubeAsTcpSocket(QTcpServer *server, const QVariantMap &parameters);
  201.  
  202.         virtual ~OfferStreamTubeJob();
  203.  
  204.         virtual void start();
  205.  
  206.         QTcpServer* tcpServer();
  207. };
  208.  
  209. #endif // OFFER_TCP_STREAMTUBE_JOB_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement