• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

  • tdeio
  • tdeio
connection.h
1 // -*- c++ -*-
2 /* This file is part of the KDE libraries
3  Copyright (C) 2000 Stephan Kulow <coolo@kde.org>
4  David Faure <faure@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 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  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef __connection_h__
23 #define __connection_h__
24 
25 #include <tdelibs_export.h>
26 
27 #include <sys/types.h>
28 
29 #include <stdio.h>
30 #include <tqptrlist.h>
31 #include <tqobject.h>
32 
33 class TDESocket;
34 class TQSocketNotifier;
35 
36 namespace TDEIO {
37 
38  struct TDEIO_EXPORT Task {
39  int cmd;
40  TQByteArray data;
41  };
42 
49  class TDEIO_EXPORT Connection : public TQObject
50  {
51  Q_OBJECT
52  public:
57  Connection();
58  virtual ~Connection();
59 
65  void init(TDESocket *sock);
73  void init(int fd_in, int fd_out); // Used by KDENOX
74  void connect(TQObject *receiver = 0, const char *member = 0);
76  void close();
77 
82  int fd_from() const { return fd_in; }
87  int fd_to() const { return fileno( f_out ); }
88 
94  bool inited() const { return (fd_in != -1) && (f_out != 0); }
95 
101  void send(int cmd, const TQByteArray &arr = TQByteArray());
102 
109  bool sendnow( int _cmd, const TQByteArray &data );
110 
119  int read( int* _cmd, TQByteArray &data );
120 
124  void suspend();
125 
129  void resume();
130 
135  bool suspended() const { return m_suspended; }
136 
137  protected slots:
138  void dequeue();
139 
140  protected:
141 
142 
143  private:
144  int fd_in;
145  FILE *f_out;
146  TDESocket *socket;
147  TQSocketNotifier *notifier;
148  TQObject *receiver;
149  const char *member;
150  TQPtrList<Task> tasks;
151  bool m_suspended;
152  private:
153  class ConnectionPrivate* d;
154  };
155 
156 }
157 
158 #endif
TDEIO::Connection::suspended
bool suspended() const
Returns status of connection.
Definition: connection.h:135
TDEIO
A namespace for TDEIO globals.
Definition: authinfo.h:29
TDEIO::Connection::fd_to
int fd_to() const
Returns the output file descriptor.
Definition: connection.h:87
TDEIO::Connection
This class provides a simple means for IPC between two applications via a pipe.
Definition: connection.h:49
TDEIO::Connection::inited
bool inited() const
Checks whether the connection has been initialized.
Definition: connection.h:94
TDEIO::Connection::fd_from
int fd_from() const
Returns the input file descriptor.
Definition: connection.h:82

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.8.13
This website is maintained by Timothy Pearson.