1 /***************************************************************************
2 * Copyright (C) 2004,5 Max Howell <max.howell@methylblue.com> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 ***************************************************************************/
11 #ifndef VIS_SOCKETSERVER_H
12 #define VIS_SOCKETSERVER_H
14 #include <q3listview.h> //baseclass
15 #include <q3serversocket.h> //baseclass
16 #include <QByteArray> //stack allocated
17 #include <QSocketNotifier> //baseclass
18 #include <QString> //stack allocated
29 class SocketServer
: public Q3ServerSocket
32 SocketServer( const QString
&socketName
, QObject
*parent
);
44 class SocketServer
: public Amarok::SocketServer
47 SocketServer( QObject
* );
49 void newConnection( int );
51 QByteArray
path() const { return m_path
; }
54 class SocketNotifier
: public QSocketNotifier
59 SocketNotifier( int sockfd
);
65 class Selector
: public Q3ListView
68 Selector( QWidget
*parent
=0 );
69 SocketServer
*m_server
;
71 virtual void viewportPaintEvent( QPaintEvent
* );
74 static Selector
* instance();
78 ///assigns pid/sockfd combo
79 void mapPID( int, int );
81 class Item
: public Q3CheckListItem
84 Item( Q3ListView
*parent
, const char *command
, const QString
&text
, const QString
&s2
)
85 : Q3CheckListItem( parent
, text
, Q3CheckListItem::CheckBox
)
88 , m_command( command
) { setText( 1, s2
); }
91 virtual void stateChange( bool state
);
95 const char *m_command
;
99 void rightButton( Q3ListViewItem
*, const QPoint
&, int );
102 void processExited( K3Process
* );
103 void receivedStdout( K3Process
*, char*, int );