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

superkaramba

KarambaInterface Class Reference

#include <karambainterface.h>

Inheritance diagram for KarambaInterface:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 42 of file karambainterface.h.


Public Slots

bool acceptDrops (Karamba *k) const
bool addImageTooltip (const Karamba *k, ImageLabel *image, const QString &text) const
bool addMenuConfigOption (Karamba *k, const QString &key, const QString &name) const
QObject * addMenuItem (Karamba *k, KMenu *menu, const QString &text, const QString &icon) const
QObject * addMenuSeparator (Karamba *k, KMenu *menu) const
bool attachClickArea (const Karamba *k, Meter *m, const QString &leftButton=QString(), const QString &middleButton=QString(), const QString &rightButton=QString()) const
bool callTheme (Karamba *k, const QString &theme, const QString &info) const
bool changeImageAlpha (const Karamba *k, ImageLabel *image, int a, int r=-1, int g=-1, int b=-1, int ms=0) const
bool changeImageAnimation (Karamba *k, ImageLabel *image, bool enable) const
bool changeImageChannelIntensity (const Karamba *k, ImageLabel *image, double ratio, const QString &channel, int ms=0) const
bool changeImageIntensity (const Karamba *k, ImageLabel *image, double ratio, int ms=0) const
bool changeImageToGray (const Karamba *k, ImageLabel *image, int ms=0) const
QObject * changeInputBox (const Karamba *k, Input *input, const QString &text) const
bool changeInputBoxBackgroundColor (const Karamba *k, Input *input, int red, int green, int blue, int alpha=255) const
bool changeInputBoxFont (const Karamba *k, Input *input, const QString &font) const
bool changeInputBoxFontColor (const Karamba *k, Input *input, int red, int green, int blue, int alpha=255) const
bool changeInputBoxFontSize (const Karamba *k, Input *input, int size) const
bool changeInputBoxFrameColor (const Karamba *k, Input *input, int red, int green, int blue, int alpha=255) const
bool changeInputBoxSelectedTextColor (const Karamba *k, Input *input, int red, int green, int blue, int alpha=255) const
bool changeInputBoxSelection (const Karamba *k, Input *input, int start, int length) const
bool changeInputBoxSelectionColor (const Karamba *k, Input *input, int red, int green, int blue, int alpha=255) const
bool changeInterval (Karamba *k, int interval) const
QObject * changeRichText (const Karamba *k, RichTextLabel *label, const QString &text) const
bool changeRichTextFont (const Karamba *k, RichTextLabel *label, const QString &font) const
bool changeRichTextSize (const Karamba *k, RichTextLabel *label, int size) const
QObject * changeText (const Karamba *k, TextLabel *label, const QString &text) const
bool changeTextColor (const Karamba *k, TextLabel *text, int red, int green, int blue, int alpha=255) const
bool changeTextFont (const Karamba *k, TextLabel *text, const QString &font) const
bool changeTextShadow (const Karamba *k, TextLabel *label, int shadow) const
bool changeTextSize (const Karamba *k, TextLabel *text, int size) const
bool clearInputBoxSelection (const Karamba *k, Input *input) const
bool clearInputFocus (const Karamba *k, Input *input) const
QObject * createBackgroundImage (Karamba *k, int x, int y, const QString &imagePath) const
QObject * createBar (Karamba *k, int x, int y, int w, int h, const QString &path="") const
QObject * createCanvasWidget (Karamba *k, QWidget *widget)
QObject * createClickArea (Karamba *k, int x, int y, int width, int height, const QString &onClick) const
QObject * createEmptyImage (Karamba *k, int x, int y, int w, int h) const
QObject * createGraph (Karamba *k, int x, int y, int w, int h, int points) const
QObject * createImage (Karamba *k, int x, int y, const QString &image) const
QObject * createInputBox (Karamba *k, int x, int y, int w, int h, const QString &text) const
QObject * createMenu (Karamba *k) const
QObject * createRichText (Karamba *k, const QString &text, bool underline=false) const
QObject * createServiceClickArea (Karamba *k, int x, int y, int width, int height, const QString &name, const QString &exec, const QString &icon) const
QObject * createSystray (const Karamba *k, int x, int y, int w, int h) const
QObject * createTaskIcon (Karamba *k, int x, int y, int ctask) const
QObject * createText (Karamba *k, int x, int y, int width, int height, const QString &text="") const
bool createWidgetMask (const Karamba *k, const QString &mask) const
bool deleteBar (Karamba *k, Bar *bar) const
bool deleteGraph (Karamba *k, Graph *graph) const
bool deleteImage (Karamba *k, ImageLabel *image) const
bool deleteInputBox (Karamba *k, Input *input) const
bool deleteMenu (Karamba *k, KMenu *menu) const
bool deleteRichText (Karamba *k, RichTextLabel *label) const
bool deleteText (Karamba *k, TextLabel *text) const
QVariantList desktopSize () const
int execute (const QString &command) const
int executeInteractive (Karamba *k, const QStringList &command)
QString getBarImage (const Karamba *k, const Bar *bar) const
QVariantList getBarMinMax (const Karamba *k, const Bar *bar) const
QVariantList getBarPos (const Karamba *k, const Bar *bar) const
QString getBarSensor (const Karamba *k, const Bar *bar) const
QVariantList getBarSize (const Karamba *k, const Bar *bar) const
int getBarValue (const Karamba *k, const Bar *bar) const
bool getBarVertical (const Karamba *k, const Bar *bar) const
int getCurrentWindowCount (const Karamba *k) const
QString getExecutingApplication () const
QVariantList getGraphColor (const Karamba *k, const Graph *graph) const
QVariantList getGraphFillColor (const Karamba *k, const Graph *graph) const
QVariantList getGraphMinMax (const Karamba *k, const Graph *graph) const
QString getGraphPlot (const Karamba *k, const Graph *graph) const
QVariantList getGraphPos (const Karamba *k, const Graph *graph) const
QString getGraphScroll (const Karamba *k, const Graph *graph) const
QString getGraphSensor (const Karamba *k, const Graph *graph) const
bool getGraphShouldFill (const Karamba *k, const Graph *graph) const
QVariantList getGraphSize (const Karamba *k, const Graph *graph) const
int getGraphValue (const Karamba *k, const Graph *graph) const
QString getIconByName (const QString &icon, int size) const
bool getImageAnimation (Karamba *k, ImageLabel *image) const
QString getImageElement (Karamba *k, ImageLabel *image) const
int getImageHeight (const Karamba *k, const ImageLabel *image) const
QString getImagePath (const Karamba *k, const ImageLabel *image) const
QVariantList getImagePos (const Karamba *k, const ImageLabel *image) const
QString getImageSensor (const Karamba *k, const ImageLabel *image) const
QVariantList getImageSize (const Karamba *k, const ImageLabel *image) const
int getImageWidth (const Karamba *k, const ImageLabel *image) const
QString getIncomingData (const Karamba *k) const
QVariantList getInputBoxBackgroundColor (const Karamba *k, const Input *input) const
QString getInputBoxFont (const Karamba *k, const Input *input) const
QVariantList getInputBoxFontColor (const Karamba *k, const Input *input) const
int getInputBoxFontSize (const Karamba *k, const Input *input) const
QVariantList getInputBoxFrameColor (const Karamba *k, const Input *input) const
QVariantList getInputBoxPos (const Karamba *k, const Input *input) const
QVariantList getInputBoxSelectedTextColor (const Karamba *k, const Input *input) const
QVariantList getInputBoxSelection (const Karamba *k, Input *input) const
QVariantList getInputBoxSelectionColor (const Karamba *k, const Input *input) const
QVariantList getInputBoxSize (const Karamba *k, const Input *input) const
int getInputBoxTextWidth (const Karamba *k, Input *input) const
QString getInputBoxValue (const Karamba *k, const Input *input) const
QObject * getInputFocus (const Karamba *k) const
QString getIp (const Karamba *k, const QString &interface) const
int getNumberOfDesktops (const Karamba *k) const
QObject * getPlasmaSensor (Karamba *k, const QString &engine, const QString &source=QString())
QString getPrettyThemeName (const Karamba *k) const
QString getRichTextFont (const Karamba *k, const RichTextLabel *label) const
int getRichTextFontSize (const Karamba *k, const RichTextLabel *label) const
QVariantList getRichTextPos (const Karamba *k, const RichTextLabel *label) const
QString getRichTextSensor (const Karamba *k, const RichTextLabel *label) const
QVariantList getRichTextSize (const Karamba *k, const RichTextLabel *label) const
QString getRichTextValue (const Karamba *k, const RichTextLabel *label) const
QVariantList getServiceGroups (const QString &path) const
QVariantList getStartupInfo (const Karamba *k, const Startup *startup) const
QVariantList getStartupList (const Karamba *k) const
bool getSystraySize (const Karamba *k) const
QVariantList getTaskInfo (const Karamba *k, Task *task) const
QVariantList getTaskList (const Karamba *k) const
QStringList getTaskNames (const Karamba *k) const
QString getTextAlign (const Karamba *k, const TextLabel *text) const
QVariantList getTextColor (const Karamba *k, const TextLabel *text) const
QString getTextFont (const Karamba *k, const TextLabel *text) const
int getTextFontSize (const Karamba *k, const TextLabel *text) const
QVariantList getTextPos (const Karamba *k, const TextLabel *text) const
QString getTextSensor (const Karamba *k, const TextLabel *text) const
int getTextShadow (const Karamba *k, const TextLabel *text) const
QVariantList getTextSize (const Karamba *k, const TextLabel *text) const
int getTextTextWidth (const Karamba *k, const TextLabel *text) const
QString getTextValue (const Karamba *k, const TextLabel *label) const
QObject * getThemeBar (const Karamba *k, const QString &meter) const
QObject * getThemeGraph (const Karamba *k, const QString &meter) const
QObject * getThemeImage (const Karamba *k, const QString &meter) const
QObject * getThemeInputBox (const Karamba *k, const QString &meter) const
QString getThemePath (const Karamba *k=0) const
QObject * getThemeRichText (const Karamba *k, const QString &meter) const
QObject * getThemeText (const Karamba *k, const QString &meter) const
double getUpdateTime (const Karamba *k) const
QVariantList getWidgetPosition (const Karamba *k) const
bool hide (Karamba *k) const
bool hideBar (const Karamba *k, Bar *bar) const
bool hideGraph (const Karamba *k, Graph *graph) const
bool hideImage (const Karamba *k, ImageLabel *image) const
bool hideInputBox (const Karamba *k, Input *input) const
bool hideRichText (const Karamba *k, RichTextLabel *label) const
bool hideSystray (const Karamba *k) const
bool hideText (const Karamba *k, TextLabel *text) const
QString language (const Karamba *k) const
bool managementPopup (const Karamba *k) const
bool moveBar (const Karamba *k, Bar *bar, int x, int y) const
bool moveCanvasWidget (Karamba *k, QObject *canvaswidget, int x, int y, int w, int h)
bool moveGraph (const Karamba *k, Graph *graph, int x, int y) const
bool moveImage (Karamba *k, ImageLabel *image, int x, int y) const
bool moveInputBox (Karamba *k, Input *input, int x, int y) const
bool moveRichText (Karamba *k, RichTextLabel *label, int x, int y) const
bool moveSystray (const Karamba *k, int x, int y, int w, int h) const
bool moveText (Karamba *k, TextLabel *text, int x, int y) const
bool moveWidget (Karamba *k, int x, int y) const
Karamba * openNamedTheme (const QString &themePath, const QString &themeName, bool startAsSubTheme) const
Karamba * openTheme (const QString &themePath) const
bool performTaskAction (const Karamba *k, Task *task, int action) const
bool popupMenu (const Karamba *k, KMenu *menu, int x, int y) const
QVariant readConfigEntry (const Karamba *k, const QString &key) const
bool readMenuConfigOption (const Karamba *k, const QString &key) const
QString readThemeFile (const Karamba *k, const QString &file) const
bool redrawWidget (Karamba *k) const
bool redrawWidgetBackground (const Karamba *k) const
bool reloadTheme (Karamba *k) const
bool removeClickArea (Karamba *k, ClickArea *area) const
bool removeImageEffects (const Karamba *k, ImageLabel *image) const
bool removeImageTransformations (const Karamba *k, ImageLabel *image) const
bool removeMenuItem (Karamba *k, KMenu *menu, QAction *action) const
bool resizeBar (const Karamba *k, Bar *bar, int width, int height) const
bool resizeGraph (const Karamba *k, Graph *graph, int width, int height) const
bool resizeImage (const Karamba *k, ImageLabel *image, int width, int height) const
bool resizeImageSmooth (Karamba *k, ImageLabel *image, int width, int height) const
bool resizeInputBox (const Karamba *k, Input *input, int width, int height) const
bool resizeRichText (const Karamba *k, RichTextLabel *label, int width, int height) const
bool resizeText (const Karamba *k, TextLabel *text, int width, int height) const
bool resizeWidget (Karamba *k, int width, int height) const
bool rotateImage (const Karamba *k, ImageLabel *image, int deg) const
bool run (const QString &appName, const QString &command, const QString &icon, const QStringList &arguments)
bool setBarImage (const Karamba *k, Bar *bar, const QString &image) const
bool setBarMinMax (const Karamba *k, Bar *bar, int min, int max) const
bool setBarSensor (Karamba *k, Bar *bar, const QString &sensor) const
QObject * setBarValue (const Karamba *k, Bar *bar, int value) const
bool setBarVertical (const Karamba *k, Bar *bar, bool vert) const
bool setGraphColor (const Karamba *k, Graph *graph, int red, int green, int blue, int alpha=255) const
bool setGraphFillColor (const Karamba *k, Graph *graph, int red, int green, int blue, int alpha=255) const
bool setGraphMinMax (const Karamba *k, Graph *bar, int min, int max) const
bool setGraphPlot (const Karamba *k, Graph *graph, const QString &plot) const
bool setGraphScroll (const Karamba *k, Graph *graph, const QString &scroll) const
bool setGraphSensor (Karamba *k, Graph *graph, const QString &sensor) const
bool setGraphShouldFill (const Karamba *k, Graph *graph, bool shouldFill) const
QObject * setGraphValue (const Karamba *k, Graph *graph, int value) const
bool setImageElement (Karamba *k, ImageLabel *image, const QString &element) const
bool setImageElementAll (Karamba *k, ImageLabel *image) const
QObject * setImagePath (const Karamba *k, ImageLabel *image, const QString &path) const
bool setImageSensor (Karamba *k, ImageLabel *image, const QString &sensor) const
bool setIncomingData (Karamba *k, const QString &prettyThemeName, const QString &data) const
bool setInputFocus (const Karamba *k, Input *input) const
bool setMenuConfigOption (Karamba *k, const QString &key, bool value) const
bool setPixel (Karamba *k, ImageLabel *image, int x, int y, int r, int g, int b, int a=255)
bool setRichTextSensor (Karamba *k, RichTextLabel *label, const QString &sensor) const
bool setRichTextWidth (const Karamba *k, RichTextLabel *label, int width) const
bool setTextAlign (const Karamba *k, TextLabel *text, const QString &alignment) const
bool setTextScroll (const Karamba *k, TextLabel *text, const QString &type, int x=0, int y=0, int gap=0, int pause=0) const
bool setTextSensor (Karamba *k, TextLabel *text, const QString &sensor) const
bool setUpdateTime (Karamba *k, double updateTime) const
bool setWantRightButton (Karamba *k, bool enable) const
bool show (Karamba *k) const
bool showBar (const Karamba *k, Bar *bar) const
bool showGraph (const Karamba *k, Graph *graph) const
bool showImage (const Karamba *k, ImageLabel *image) const
bool showInputBox (const Karamba *k, Input *input) const
bool showRichText (const Karamba *k, RichTextLabel *label) const
bool showSystray (const Karamba *k) const
bool showText (const Karamba *k, TextLabel *text) const
bool toggleShowDesktop (const Karamba *k) const
bool toggleWidgetRedraw (const Karamba *k, bool enable) const
bool translateAll (const Karamba *k, int x, int y) const
bool updateSystrayLayout (const Karamba *k) const
QString userLanguage (const Karamba *k) const
QStringList userLanguages (const Karamba *k) const
QStringList version () const
bool writeConfigEntry (const Karamba *k, const QString &key, const QVariant &value) const

Signals

void activeTaskChanged (QObject *, QObject *)
void commandFinished (QObject *, int)
void commandOutput (QObject *, int, QString)
void desktopChanged (QObject *, int)
void initWidget (QObject *)
void itemDropped (QObject *, QString, int, int)
void keyPressed (QObject *, QObject *, QString)
void menuItemClicked (QObject *, QObject *, QObject *)
void menuOptionChanged (QObject *, QString, bool)
void meterClicked (QObject *, QString, int)
void meterClicked (QObject *, QObject *, int)
void startupAdded (QObject *, QObject *)
void startupRemoved (QObject *, QObject *)
void taskAdded (QObject *, QObject *)
void taskRemoved (QObject *, QObject *)
void themeNotify (QObject *, QString, QString)
void wallpaperChanged (QObject *, int)
void widgetClicked (QObject *, int, int, int)
void widgetClosed (QObject *)
void widgetMouseMoved (QObject *, int, int, int)
void widgetUpdated (QObject *)

Public Member Functions

void callActiveTaskChanged (Karamba *k, Task *t)
void callCommandFinished (Karamba *k, int pid)
void callCommandOutput (Karamba *k, int pid, char *buffer)
void callDesktopChanged (Karamba *k, int desktop)
void callInitWidget (Karamba *k)
void callItemDropped (Karamba *k, const QString &text, int x, int y)
void callKeyPressed (Karamba *k, Meter *meter, const QString &key)
void callMenuItemClicked (Karamba *k, KMenu *menu, QAction *id)
void callMenuOptionChanged (Karamba *k, const QString &key, bool value)
void callMeterClicked (Karamba *k, const QString &str, int button)
void callMeterClicked (Karamba *k, Meter *m, int button)
void callStartupAdded (Karamba *k, Startup *t)
void callStartupRemoved (Karamba *k, Startup *t)
void callTaskAdded (Karamba *k, Task *t)
void callTaskRemoved (Karamba *k, Task *t)
void callThemeNotify (Karamba *k, const QString &sender, const QString &data)
void callWallpaperChanged (Karamba *k, int desktop)
void callWidgetClicked (Karamba *k, int x, int y, int button)
void callWidgetClosed (Karamba *k)
void callWidgetMouseMoved (Karamba *k, int x, int y, int button)
void callWidgetUpdated (Karamba *k)
bool initInterpreter ()
 KarambaInterface (Karamba *k)
void startInterpreter ()
virtual ~KarambaInterface ()

Constructor & Destructor Documentation

KarambaInterface::KarambaInterface ( Karamba *  k  ) 

Definition at line 71 of file karambainterface.cpp.

KarambaInterface::~KarambaInterface (  )  [virtual]

Definition at line 78 of file karambainterface.cpp.


Member Function Documentation

bool KarambaInterface::acceptDrops ( Karamba *  k  )  const [slot]

Misc/acceptDrops.

SYNOPSIS boolean acceptDrops(widget) DESCRIPTION Calling this enables your widget to receive Drop events. In other words, the user will be able to drag icons from his/her desktop and drop them on your widget. The "itemDropped" callback is called as a result with the data about the icon that was dropped on your widget. This allows, for example, icon bars where items are added to the icon bar by Drag and Drop. ARGUMENTS * reference to widget -- karamba RETURN VALUE true if successful

Definition at line 3411 of file karambainterface.cpp.

void KarambaInterface::activeTaskChanged ( QObject *  ,
QObject *   
) [signal]

bool KarambaInterface::addImageTooltip ( const Karamba *  k,
ImageLabel *  image,
const QString &  text 
) const [slot]

Image/addImageTooltip.

SYNOPSIS boolean addImageTooltip(widget, image, text) DESCRIPTION This creats a tooltip for image with text.

Note: * If you move the image, the tooltip does not move! It stays! Do not create a tooltip if the image is off-screen because you will not be able to ever see it. ARGUMENTS * reference to widget -- karamba * reference to image -- image * string text -- tooltip text RETURN VALUE true if successful

Definition at line 1749 of file karambainterface.cpp.

bool KarambaInterface::addMenuConfigOption ( Karamba *  k,
const QString &  key,
const QString &  name 
) const [slot]

Config/addMenuConfigOption.

SYNOPSIS boolean addMenuConfigOption(widget, key, name) DESCRIPTION SuperKaramba supports a simplistic configuration pop-up menu. This menu appears when you right-click on a widget and choose Configure Theme. Basically, it allows you to have check-able entries in the menu to allow the user to enable or disable features in your theme.

Before you use any configuration menu stuff, you NEED to add a new callback to your script:

def menuOptionChanged(widget, key, value):

This will get called whenever a config menu option is changed. Now you can add items to the config menu:

addMenuConfigOption(widget, String key, String name)

Key is the name of a key value where the value will be saved automatically into the widget's config file. Name is the actual text that will show up in the config menu.

For example, I could allow the user to enable or disable a clock showing up in my theme:

karamba.addMenuConfigOption(widget, "showclock", "Display a clock") ARGUMENTS * reference to widget -- karamba * string key -- key for menu item * string name -- name of the graph to get RETURN VALUE true if successful

Definition at line 2306 of file karambainterface.cpp.

QObject * KarambaInterface::addMenuItem ( Karamba *  k,
KMenu *  menu,
const QString &  text,
const QString &  icon 
) const [slot]

Menu/addMenuItem.

SYNOPSIS reference addMenuItem(widget, menu, text, icon) DESCRIPTION This adds an entry to the given menu with label text and with given icon. Icon can be just an application name in which case the user's current icon set is used, or can be a path to a 16x16 png file.

The function returns the reference to the menu item, which identifies that popup menu item uniquely among popupmenu items application-wide or returns 0 if the given menu doesn't exist. ARGUMENTS * reference to widget -- karamba * reference to menu -- menu * string text -- text for menu item * string icon -- icon name or path RETURN VALUE reference to the menu item

Definition at line 3245 of file karambainterface.cpp.

QObject * KarambaInterface::addMenuSeparator ( Karamba *  k,
KMenu *  menu 
) const [slot]

Menu/addMenuSeparator.

SYNOPSIS reference addMenuSeparator(widget, menu) DESCRIPTION This adds an menu separator to the given menu. ARGUMENTS * reference to widget -- karamba * reference to menu -- menu RETURN VALUE reference to the separator

Definition at line 3272 of file karambainterface.cpp.

bool KarambaInterface::attachClickArea ( const Karamba *  k,
Meter *  m,
const