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

kio/kio

  • kio
  • kio
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 <kdelibs_export.h>
26 
27 #include <sys/types.h>
28 
29 #include <stdio.h>
30 #include <tqptrlist.h>
31 #include <tqobject.h>
32 
33 class KSocket;
34 class TQSocketNotifier;
35 
36 namespace KIO {
37 
38  struct KIO_EXPORT Task {
39  int cmd;
40  TQByteArray data;
41  };
42 
49  class KIO_EXPORT Connection : public TQObject
50  {
51  Q_OBJECT
52  public:
57  Connection();
58  virtual ~Connection();
59 
65  void init(KSocket *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  KSocket *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
KIO::Connection
This class provides a simple means for IPC between two applications via a pipe.
Definition: connection.h:50
KIO::Connection::fd_to
int fd_to() const
Returns the output file descriptor.
Definition: connection.h:87
KIO::Connection::inited
bool inited() const
Checks whether the connection has been initialized.
Definition: connection.h:94
KIO::Connection::suspended
bool suspended() const
Definition: connection.h:135
KIO::Connection::fd_from
int fd_from() const
Returns the input file descriptor.
Definition: connection.h:82
KIO
A namespace for KIO globals.
Definition: authinfo.h:29

kio/kio

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

kio/kio

Skip menu "kio/kio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/kio by doxygen 1.9.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |