libemailfunctions

networkstatus.h
1 /*
2  This file is part of libtdepim.
3 
4  Copyright (c) 2005 Tobias Koenig <tokoe@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 NETWORKSTATUS_H
23 #define NETWORKSTATUS_H
24 
25 #include <tqobject.h>
26 #include <dcopobject.h>
27 
28 namespace KPIM {
29 
35 class NetworkStatus : public TQObject, public DCOPObject
36 {
37  TQ_OBJECT
38 
39  public:
43  enum Status {
44  Online, //< The machine now has internet connectivity
45  Offline //< The machine has no internet connectivity
46  };
47 
52 
56  static NetworkStatus *self();
57 
63  void setStatus( Status status );
64 
68  Status status() const;
69 
70  k_dcop:
74  void onlineStatusChanged();
75 
76  signals:
82  void statusChanged( Status status );
83 
84  protected:
89  NetworkStatus();
90 
91  private:
92  Status mStatus;
93  static NetworkStatus *mSelf;
94 };
95 
96 }
97 
98 #endif
~NetworkStatus()
Destructor.
This is a class for monitoring network status – basically, the machine KDE is running on going from ...
Definition: networkstatus.h:35
Status status() const
Returns the current status.
void statusChanged(Status status)
Emitted whenever the status has changed.
void onlineStatusChanged()
Called by the network interface watcher in KDED.
KPIM holds all kinds of functions specific to KDE PIM.
Definition: email.h:38
NetworkStatus()
Constructor.
Status
The possible states.
Definition: networkstatus.h:43
void setStatus(Status status)
Sets a new status.