• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

superkaramba

  • sources
  • kde-4.12
  • kdeutils
  • superkaramba
  • src
karamba.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2003-2004 Adam Geitgey <adam@rootnode.org>
3  * Copyright (C) 2003 Hans Karlsson <karlsson.h@home.se>
4  * Copyright (C) 2004,2005 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
5  * Copyright (c) 2005 Ryan Nickell <p0z3r@earthlink.net>
6  * Copyright (c) 2007 Alexander Wiedenbruch <mail@wiedenbruch.de>
7  *
8  * This file is part of SuperKaramba.
9  *
10  * SuperKaramba is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * SuperKaramba is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with SuperKaramba; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  ****************************************************************************/
24 
25 
26 #ifndef KARAMBA_H
27 #define KARAMBA_H
28 
29 #include <QGraphicsItemGroup>
30 #include <QTimeLine>
31 #include <QGraphicsItemAnimation>
32 
33 #include <KUrl>
34 #include <netwm.h>
35 
36 #include "themefile.h"
37 #include "taskmanager.h"
38 #include "superkaramba_export.h"
39 
40 class QGraphicsView;
41 class QGraphicsScene;
42 
43 class KMenu;
44 class KConfig;
45 class K3Process;
46 
47 class Meter;
48 class Sensor;
49 class Systemtray;
50 class TextField;
51 
52 class SUPERKARAMBA_EXPORT Karamba : public QObject, public QGraphicsItemGroup
53 {
54  Q_OBJECT
55 
56 public:
57  explicit Karamba(const KUrl &themeFile, QGraphicsView *view = 0,
58  int instance = -1, bool subTheme = false,
59  const QPoint &startPos = QPoint(), bool reload = false, bool startkaramba = true);
60 
61  virtual ~Karamba();
62 
63  QRectF boundingRect() const;
64 
65  void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
66  QWidget *widget);
67 
68  QGraphicsScene* getScene() const;
69  QGraphicsView* getView() const;
70 
71  void keyPressed(const QString& s, const Meter* meter);
72 
73  const ThemeFile& theme() const;
74 
75  bool hasMeter(const Meter* meter) const;
76  bool removeMeter(Meter *meter);
77  QString getSensor(const Meter* meter) const;
78  void setSensor(const LineParser& lineParser, Meter* meter);
79  void deleteMeterFromSensors(Meter* meter);
80  TextField* getDefaultTextProps();
81  void setFixedSize(u_int w, u_int h);
82  bool readMenuConfigOption(const QString &key) const;
83  KConfig* getConfig() const;
84  //void removePopupMenu(KMenu *menu);
85  bool popupMenuExisting(const KMenu *menu) const;
86  void setPrettyName(const QString &prettyThemeName);
87  QString prettyName() const;
88  int getNumberOfDesktops() const;
89  double getUpdateTime() const;
90  void setUpdateTime(double newTime);
91  void setWantRightButton(bool enable);
92  void changeInterval(u_int newInterval);
93  void addMenuConfigOption(const QString &key, const QString &name);
94  bool setMenuConfigOption(const QString &key, bool value);
95  KMenu* addPopupMenu();
96  QAction* addMenuItem(KMenu *menu, const QString &text,
97  const QString &icon);
98  void popupMenu(KMenu *menu, const QPoint &pos) const;
99  void deletePopupMenu(KMenu *menu);
100  void deleteMenuItem(QAction *action);
101  void scaleImageLabel(Meter *meter, int width,
102  int height) const;
103  void moveMeter(Meter *meter, int x, int y) const;
104  void writeConfigData();
105 
106  void setMenuExtension(KMenu*);
107  void removeMenuExtension();
108  bool hasMenuExtension() const;
109 
110  int instance();
111  void setInstance(int instance);
112 
113  void resizeTo(int width, int height);
114  QPoint getPosition() const;
115 
116  void setIncomingData(const QString &data);
117  void notifyTheme(const QString &sender, const QString &data);
118  bool sendDataToTheme(const QString &prettyThemeName, const QString &data);
119  QString retrieveReceivedData() const;
120  bool sendData(const QString &prettyThemeName, const QString &data);
121 
122  void setOnTop(bool stayOnTop);
123  bool isSubTheme() const;
124 
125  void redrawWidget();
126 
127  void makeActive();
128  void makePassive();
129 
130  void setProcess(K3Process *process);
131  K3Process* process() const;
132 
133  void setSystemTray(Systemtray*);
134  Systemtray* systemTray();
135 
136  QObject* getPlasmaSensor(const QString& engine, const QString& source = QString());
137 
138  void replaceNamedValues(QString* source);
139  QString getMeterValue(const QString& name);
140  Meter* getMeter(const QString& name);
141 
142 public Q_SLOTS:
143  void startKaramba();
144  void updateSensors();
145  void closeWidget();
146  void reloadConfig();
147  void processExited(K3Process *proc);
148  void receivedStdout(K3Process *proc, char *buffer, int buflen);
149  void startupAdded(Startup::StartupPtr);
150  void startupRemoved(Startup::StartupPtr);
151  void taskAdded(Task::TaskPtr);
152  void taskRemoved(Task::TaskPtr);
153  void activeTaskChanged(Task::TaskPtr);
154  void passMenuItemClicked(QAction* action);
155  void slotFileChanged(const QString &file);
156  void popupGlobalMenu() const;
157  void moveToPos(QPoint pos);
158  void emitError(const QString& errormessage);
159 
160 Q_SIGNALS:
161  void positionChanged();
162  void sizeChanged();
163  void error(const QString& errormessage);
164 
165 private Q_SLOTS:
166  void slotToggleLocked();
167  void currentDesktopChanged(int i);
168  void slotToggleConfigOption(QObject*);
169  void slotDesktopChanged(int desktop);
170  void currentWallpaperChanged(int desktop);
171 
172  void step();
173 
174 protected:
175  void mousePressEvent(QGraphicsSceneMouseEvent *event);
176  void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
177  void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
178  void wheelEvent(QGraphicsSceneWheelEvent *event);
179  void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
180  void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
181  void dropEvent(QGraphicsSceneDragDropEvent *event);
182  void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
183  void timerEvent(QTimerEvent *event);
184  void keyPressEvent(QKeyEvent *event);
185  QVariant itemChange(GraphicsItemChange change, const QVariant &value);
186 
187 private:
188  class Private;
189  Private* const d;
190 
191  bool parseConfig();
192  Sensor *findSensorFromList(const Meter *meter) const;
193  QString findSensorFromMap(const Sensor *sensor) const;
194 
195  void preparePopupMenu();
196  int passEvent(QEvent *event);
197 };
198 
199 #endif // KARAMBA_H
superkaramba_export.h
ThemeFile
Definition: themefile.h:41
popupMenu
long popupMenu(long widget, long menu, long x, long y)
Definition: menu.cpp:158
QWidget
redrawWidget
long redrawWidget(long widget)
Definition: widget.cpp:73
taskmanager.h
QObject
Sensor
Definition: sensor.h:17
readMenuConfigOption
long readMenuConfigOption(long widget, QString key)
Definition: config.cpp:97
Startup::StartupPtr
KSharedPtr< Startup > StartupPtr
Definition: taskmanager.h:555
Karamba
Definition: karamba.h:52
setMenuConfigOption
long setMenuConfigOption(long widget, QString key, bool value)
Definition: config.cpp:73
themefile.h
LineParser
Definition: lineparser.h:6
startKaramba
KDE_EXPORT QGraphicsItemGroup * startKaramba(const KUrl &theme, QGraphicsView *view)
Definition: karamba.cpp:89
getMeter
long getMeter(long widget, char *name)
Definition: python/meter.cpp:147
Systemtray
Definition: systemtray.h:35
changeInterval
static void changeInterval(long widget, long interval)
Definition: misc.cpp:799
addMenuConfigOption
long addMenuConfigOption(long widget, QString key, QString name)
Definition: config.cpp:46
Meter
Definition: meters/meter.h:23
SUPERKARAMBA_EXPORT
#define SUPERKARAMBA_EXPORT
Definition: superkaramba_export.h:32
addMenuItem
QAction * addMenuItem(long widget, long menu, QString text, QString icon)
Definition: menu.cpp:86
QGraphicsItemGroup
setIncomingData
static long setIncomingData(long widget, char *path, char *obj)
Definition: misc.cpp:422
QGraphicsView
getNumberOfDesktops
int getNumberOfDesktops(long widget)
Definition: misc.cpp:546
Task::TaskPtr
KSharedPtr< Task > TaskPtr
Definition: taskmanager.h:97
TextField
Ralph M.
Definition: textfield.h:22
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:07:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal