Port KProgressBar's to QProgressBar's.
[kdenetwork.git] / kopete / libkopete / connectionmanager.h
blobab14015752f4f76a13fdf4c7a6fdf12957a77ddd
1 /*
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 *************************************************************************
7 * *
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. *
12 * *
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
27 Q_OBJECT
28 K_DCOP
29 public:
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 );
38 signals:
39 // signal that the network for a hostname is up/down
40 void statusChanged( const QString & host, NetworkStatus::EnumStatus status );
41 protected:
42 // sets up internal state
43 void initialise();
44 // reread the desktop status from the daemon and update internal state
45 void updateStatus();
46 // ask if the user would like to reconnect
47 bool askToConnect( QWidget * mainWidget );
48 k_dcop:
49 void slotStatusChanged( QString host, int status );
50 private:
51 ConnectionManager( QObject *parent, const char * name );
52 ConnectionManagerPrivate *d;
53 static ConnectionManager * s_self;
56 #endif