~ubuntu-branches/ubuntu/jaunty/plasma-widget-network-manager/jaunty-updates

« back to all changes in this revision

Viewing changes to applet/wirelessenvironment.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Mercatante
  • Date: 2009-02-10 16:33:42 UTC
  • Revision ID: james.westby@ubuntu.com-20090210163342-y22tcldf0fuyqqm9
Tags: upstream-0.0+svn924363
ImportĀ upstreamĀ versionĀ 0.0+svn924363

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright 2008 Will Stephenson <wstephenson@kde.org>
 
3
 
 
4
This program is free software; you can redistribute it and/or
 
5
modify it under the terms of the GNU General Public License as
 
6
published by the Free Software Foundation; either version 2 of
 
7
the License or (at your option) version 3 or any later version
 
8
accepted by the membership of KDE e.V. (or its successor approved
 
9
by the membership of KDE e.V.), which shall act as a proxy
 
10
defined in Section 14 of version 3 of the license.
 
11
 
 
12
This program is distributed in the hope that it will be useful,
 
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
GNU General Public License for more details.
 
16
 
 
17
You should have received a copy of the GNU General Public License
 
18
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
*/
 
20
 
 
21
#ifndef WIRELESSENVIRONMENT_H
 
22
#define WIRELESSENVIRONMENT_H
 
23
 
 
24
#include <QObject>
 
25
 
 
26
#include "wirelessnetwork.h"
 
27
 
 
28
class WirelessEnvironmentPrivate;
 
29
 
 
30
class AbstractWirelessEnvironment : public QObject
 
31
{
 
32
Q_OBJECT
 
33
public:
 
34
    AbstractWirelessEnvironment(QObject *parent);
 
35
    virtual ~AbstractWirelessEnvironment();
 
36
    virtual QStringList networks() const = 0;
 
37
    virtual AbstractWirelessNetwork * findNetwork(const QString&) const = 0;
 
38
Q_SIGNALS:
 
39
    virtual void networkAppeared(const QString &ssid);
 
40
    virtual void networkDisappeared(const QString &ssid);
 
41
};
 
42
 
 
43
/**
 
44
 * Models a the wireless environment as seen by a particular network interface.
 
45
 * This may be merged into Solid::Control::WirelessNetworkInterface
 
46
 */
 
47
class WirelessEnvironment : public AbstractWirelessEnvironment
 
48
{
 
49
Q_OBJECT
 
50
Q_DECLARE_PRIVATE(WirelessEnvironment)
 
51
public:
 
52
    WirelessEnvironment(Solid::Control::WirelessNetworkInterface * iface, QObject * parent = 0);
 
53
    virtual ~WirelessEnvironment();
 
54
    //virtual QList<Solid::Control::WirelessNetworkInterface*> interfaces() const;
 
55
    virtual QStringList networks() const;
 
56
    virtual AbstractWirelessNetwork * findNetwork(const QString&) const;
 
57
    void dump();
 
58
protected Q_SLOTS:
 
59
    void accessPointAppeared(const QString&);
 
60
    void removeNetwork(const QString&);
 
61
    void wirelessEnabledChanged(bool);
 
62
private:
 
63
    void accessPointAppearedInternal(const QString&);
 
64
protected:
 
65
    WirelessEnvironmentPrivate * const d_ptr;
 
66
};
 
67
 
 
68
#endif // WIRELESSENVIRONMENT_H