2 connectionmanager.h - Provides the client side interface to the kde networkstatus daemon
4 Copyright (c) 2004 by Will Stephenson <lists@stevello.free-online.co.uk>
6 *************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2 of the License, or (at your option) any later version. *
13 *************************************************************************
16 #ifndef KDE_CONNECTION_MANAGER_H
17 #define KDE_CONNECTION_MANAGER_H
19 #include <dcopobject.h>
21 #include "networkstatuscommon.h"
23 class ConnectionManagerPrivate
;
25 class ConnectionManager
: public QObject
, virtual public DCOPObject
30 static ConnectionManager
* self();
31 enum State
{ Inactive
, Online
, Offline
, Pending
};
32 virtual ~ConnectionManager();
33 NetworkStatus::EnumStatus
status( const QString
& host
);
34 // check if a hostname is available. Ask user if offline. Request host
35 NetworkStatus::EnumRequestResult
requestConnection( QWidget
* mainWidget
, const QString
& host
, bool userInitiated
);
36 // method to relinquish a connection
37 void relinquishConnection( const QString
& host
);
39 // signal that the network for a hostname is up/down
40 void statusChanged( const QString
& host
, NetworkStatus::EnumStatus status
);
42 // sets up internal state
44 // reread the desktop status from the daemon and update internal state
46 // ask if the user would like to reconnect
47 bool askToConnect( QWidget
* mainWidget
);
49 void slotStatusChanged( QString host
, int status
);
51 ConnectionManager( QObject
*parent
, const char * name
);
52 ConnectionManagerPrivate
*d
;
53 static ConnectionManager
* s_self
;