~ubuntu-branches/ubuntu/karmic/knemo/karmic

« back to all changes in this revision

Viewing changes to src/knemod/knemodaemon.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Mercatante
  • Date: 2009-02-24 13:22:11 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20090224132211-6j5kcok463v3rye3
Tags: 0.5.0-0ubuntu1
* New upstream release
* Packaging ported to KDE4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* This file is part of KNemo
2
2
   Copyright (C) 2004, 2006 Percy Leonhardt <percy@eris23.de>
 
3
   Copyright (C) 2009 John Stamp <jstamp@users.sourceforge.net>
3
4
 
4
5
   KNemo is free software; you can redistribute it and/or modify
5
6
   it under the terms of the GNU Library General Public License as
20
21
#ifndef KNEMODAEMON_H
21
22
#define KNEMODAEMON_H
22
23
 
23
 
#include <qdict.h>
24
 
#include <qcolor.h>
25
 
#include <qcstring.h>
26
 
#include <qdatetime.h>
 
24
#include <QHash>
 
25
#include <QColor>
27
26
 
28
 
#include <kdedmodule.h>
29
 
#include <knotifyclient.h>
 
27
#include <KApplication>
30
28
 
31
29
#include "data.h"
32
30
#include "global.h"
33
31
 
34
32
class QTimer;
35
 
class KInstance;
 
33
class KAboutData;
36
34
class Interface;
37
35
class BackendBase;
38
 
class KNotifyClient::Instance;
39
36
 
40
37
/**
41
38
 * This class is the main entry point of KNemo. It reads the configuration,
45
42
 * @short KNemos main entry point
46
43
 * @author Percy Leonhardt <percy@eris23.de>
47
44
 */
48
 
class KNemoDaemon : public KDEDModule
 
45
//class KNemoDaemon : public KDEDModule
 
46
class KNemoDaemon : public QObject
49
47
{
50
 
    K_DCOP
51
48
    Q_OBJECT
 
49
    Q_CLASSINFO( "D-Bus Interface", "org.kde.knemo" )
52
50
public:
53
51
    /**
54
52
     * Default Constructor
55
53
     */
56
 
    KNemoDaemon( const QCString& name );
 
54
    KNemoDaemon();
57
55
 
58
56
    /**
59
57
     * Default Destructor
63
61
    // tell the control center module which interface the user selected
64
62
    static QString sSelectedInterface;
65
63
 
66
 
k_dcop:
 
64
    static void createAboutData();
 
65
    static void destroyAboutData();
 
66
    static KAboutData* aboutData();
 
67
 
 
68
 
 
69
public Q_SLOTS:
67
70
    /*
68
71
     * Called from the control center module when the user changed
69
72
     * the settings. It updates the internal list of interfaces
70
73
     * that should be monitored.
71
74
     */
72
 
    virtual void reparseConfiguration();
 
75
    Q_SCRIPTABLE void reparseConfiguration();
73
76
 
74
77
    /* When the user selects 'Configure KNemo...' from the context
75
78
     * menus this functions gets called from the control center
77
80
     * user opened the dialog and can preselect the appropriate
78
81
     * interface in the list.
79
82
     */
80
 
    virtual QString getSelectedInterface();
 
83
    Q_SCRIPTABLE QString getSelectedInterface();
81
84
 
82
85
private:
83
86
    /*
92
95
    void updateInterfaces();
93
96
 
94
97
private:
 
98
    KSharedConfigPtr mConfig;
 
99
 
95
100
    QColor mColorVLines;
96
101
    QColor mColorHLines;
97
102
    QColor mColorIncoming;
101
106
    // every time this timer expires we will
102
107
    // gather new informations from the backend
103
108
    QTimer* mPollTimer;
104
 
    // our own instance
105
 
    KInstance* mInstance;
106
 
    // needed so that KNotifyClient::event will work
107
 
    KNotifyClient::Instance* mNotifyInstance;
108
109
    // application wide settings are stored here
109
110
    GeneralData mGeneralData;
110
111
    // settings for the traffic plotter are stored here
114
115
    // the backend used to update the interface informations
115
116
    BackendBase* mBackend;
116
117
    // a list of all interfaces the user wants to monitor
117
 
    QDict<Interface> mInterfaceDict;
 
118
    QHash<QString, Interface *> mInterfaceDict;
 
119
 
 
120
    static KAboutData* mAboutData;    
118
121
};
119
122
 
120
123
#endif // KNEMODAEMON_H