~ubuntu-branches/ubuntu/wily/knemo/wily

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-11-05 21:57:32 UTC
  • mfrom: (1.2.2) (23 sid)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20121105215732-81tfpooc7ynxy0r9
Tags: 0.7.4-2
Add Build-Depends: kde-workspace-dev - fixes FTBFS

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