~ubuntu-branches/ubuntu/hardy/knemo/hardy

« back to all changes in this revision

Viewing changes to src/knemod/backends/sysbackend.h

  • Committer: Bazaar Package Importer
  • Author(s): Debian KDE Extras Team, Achim Bohnet
  • Date: 2006-08-22 17:11:42 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060822171142-wmuezmfcu74crfla
Tags: 0.4.4-2
[ Achim Bohnet ]
control: remove Depends: kdelibs-bin.  kdelibs-bin was merged into
kdelibs4c2a (4:3.5.3-1). kdelibs4c2a is added via ${shlibs:Depends}.
Thx Hobbsee for reminding me (again and again :).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of KNemo
 
2
   Copyright (C) 2006 Percy Leonhardt <percy@eris23.de>
 
3
 
 
4
   KNemo is free software; you can redistribute it and/or modify
 
5
   it under the terms of the GNU Library General Public License as
 
6
   published by the Free Software Foundation; either version 2 of
 
7
   the License, or (at your option) any later version.
 
8
 
 
9
   KNemo is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
   GNU Library General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU Library General Public License
 
15
   along with this library; see the file COPYING.LIB.  If not, write to
 
16
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
17
   Boston, MA 02110-1301, USA.
 
18
*/
 
19
 
 
20
#ifndef SYSBACKEND_H
 
21
#define SYSBACKEND_H
 
22
 
 
23
#include "backendbase.h"
 
24
 
 
25
/**
 
26
 * The sys backend uses the sys filesystem available in 2.6
 
27
 * kernels. It reads all necessary information from the files
 
28
 * and folders located at /sys and parses their output.
 
29
 * It then triggers the interface monitor to look for changes
 
30
 * in the state of the interface.
 
31
 *
 
32
 * @short Update the information of the interfaces via sys filesystem
 
33
 * @author Percy Leonhardt <percy@eris23.de>
 
34
 */
 
35
 
 
36
class SysBackend : public BackendBase
 
37
{
 
38
public:
 
39
    SysBackend(QDict<Interface>& interfaces );
 
40
    virtual ~SysBackend();
 
41
 
 
42
    static BackendBase* createInstance( QDict<Interface>& interfaces );
 
43
 
 
44
    void update();
 
45
 
 
46
private:
 
47
    bool readNumberFromFile( const QString& fileName, unsigned int& value );
 
48
    bool readStringFromFile( const QString& fileName, QString& string );
 
49
    void updateWirelessData( const QString& ifName, WirelessData& data );
 
50
    void updateInterfaceData( const QString& ifName, InterfaceData& data, int type );
 
51
 
 
52
};
 
53
 
 
54
#endif // SYSBACKEND_H