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

libplasma

Plasma::Applet

Plasma::Applet Class Reference

#include <applet.h>

Inheritance diagram for Plasma::Applet:

Inheritance graph
[legend]

List of all members.


Detailed Description

The base Applet class.

Applet provides several important roles for add-ons widgets in Plasma.

First, it is the base class for the plugin system and therefore is the interface to applets for host applications. It also handles the life time management of data engines (e.g. all data engines accessed via Applet::dataEngine(const QString&) are properly deref'd on Applet destruction), background painting (allowing for consistent and complex look and feel in just one line of code for applets), loading and starting of scripting support for each applet, providing access to the associated plasmoid package (if any) and access to configuration data.

See techbase.kde.org for tutorial on writing Applets using this class.

Definition at line 68 of file applet.h.


Public Types

enum  { Type = Plasma::AppletType }
enum  BackgroundHint {
  NoBackground = 0, StandardBackground = 1, TranslucentBackground = 2, ShadowedBackground = 4,
  DefaultBackground = StandardBackground | ShadowedBackground
}
typedef QHash< QString, Applet * > Dict
typedef QList< Applet * > List

Public Slots

virtual void destroy ()
void flushPendingConstraintsEvents ()
virtual void init ()
void lower ()
void raise ()
void setImmutability (const ImmutabilityType immutable)
virtual void showConfigurationInterface ()

Signals

void activate ()
void configNeedsSaving ()
void geometryChanged ()
void releaseVisualFocus ()

Public Member Functions

QAction * action (QString name) const
void addAction (QString name, QAction *action)
virtual void addAssociatedWidget (QWidget *widget)
 Applet (QGraphicsItem *parent=0, const QString &serviceId=QString(), uint appletId=0)
Plasma::AspectRatioMode aspectRatioMode () const
BackgroundHints backgroundHints () const
QString category () const
KConfigGroup config (const QString &group) const
KConfigGroup config () const
ConfigXml * configScheme () const
bool configurationRequired () const
Containment * containment () const
virtual QList< QAction * > contextualActions ()
Q_INVOKABLE DataEngine * dataEngine (const QString &name) const
QFont font () const
virtual FormFactor formFactor () const
KConfigGroup globalConfig () const
KShortcut globalShortcut () const
bool hasConfigurationInterface () const
bool hasFailedToLaunch () const
QString icon () const
uint id () const
ImmutabilityType immutability () const
bool isContainment () const
virtual Location location () const
QRectF mapFromView (const QGraphicsView *view, const QRect &rect) const
QRect mapToView (const QGraphicsView *view, const QRectF &rect) const
QString name () const
const Package * package () const
virtual void paintInterface (QPainter *painter, const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
void paintWindowFrame (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
QString pluginName () const
QPoint popupPosition (const QSize &s) const
virtual void removeAssociatedWidget (QWidget *widget)
virtual void restore (KConfigGroup &group)
virtual void save (KConfigGroup &group) const
QRect screenRect () const
void setAspectRatioMode (Plasma::AspectRatioMode)
void setBackgroundHints (const BackgroundHints hints)
void setGlobalShortcut (const KShortcut &shortcut)
bool shouldConserveResources () const
int type () const
void updateConstraints (Plasma::Constraints constraints=Plasma::AllConstraints)
QGraphicsView * view () const
 ~Applet ()

Static Public Member Functions

static QString category (const QString &appletName)
static QString category (const KPluginInfo &applet)
static KPluginInfo::List listAppletInfo (const QString &category=QString(), const QString &parentApp=QString())
static KPluginInfo::List listAppletInfoForMimetype (const QString &mimetype)
static QStringList listCategories (const QString &parentApp=QString(), bool visibleOnly=true)
static Applet * load (const KPluginInfo &info, uint appletId=0, const QVariantList &args=QVariantList())
static Applet * load (const QString &name, uint appletId=0, const QVariantList &args=QVariantList())
static PackageStructure::Ptr packageStructure ()

Protected Member Functions

 Applet (QObject *parent, const QVariantList &args)
virtual void constraintsEvent (Plasma::Constraints constraints)
virtual void createConfigurationInterface (KConfigDialog *parent)
bool eventFilter (QObject *o, QEvent *e)
void focusInEvent (QFocusEvent *event)
bool isRegisteredAsDragHandle (QGraphicsItem *item)
QVariant itemChange (GraphicsItemChange change, const QVariant &value)
void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
void mousePressEvent (QGraphicsSceneMouseEvent *event)
void registerAsDragHandle (QGraphicsItem *item)
void resizeEvent (QGraphicsSceneResizeEvent *event)
virtual void saveState (KConfigGroup &config) const
bool sceneEventFilter (QGraphicsItem *watched, QEvent *event)
void setConfigurationRequired (bool needsConfiguring, const QString &reason=QString())
void setFailedToLaunch (bool failed, const QString &reason=QString())
void setHasConfigurationInterface (bool hasInterface)
void setIsContainment (bool isContainment)
QPainterPath shape () const
QSizeF sizeHint (Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
void timerEvent (QTimerEvent *event)
void unregisterAsDragHandle (QGraphicsItem *item)

Properties

QString category
bool configurationRequired
QRectF geometry
bool hasConfigurationInterface
bool hasFailedToLaunch
ImmutabilityType immutability
QString name
bool shouldConserveResources

Member Typedef Documentation

typedef QHash<QString, Applet*> Plasma::Applet::Dict

Definition at line 82 of file applet.h.

typedef QList<Applet*> Plasma::Applet::List

Definition at line 81 of file applet.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
Type 

Definition at line 459 of file applet.h.

enum Plasma::Applet::BackgroundHint

Description on how draw a background for the applet.

Enumerator:
NoBackground 
StandardBackground 
TranslucentBackground 
ShadowedBackground 
DefaultBackground 

Definition at line 87 of file applet.h.


Constructor & Destructor Documentation

Plasma::Applet::~Applet (  ) 

Definition at line 121 of file applet.cpp.

Plasma::Applet::Applet ( QGraphicsItem *  parent = 0,
const QString &  serviceId = QString(),
uint  appletId = 0 
) [explicit]

Parameters:
parent the QGraphicsItem this applet is parented to

Parameters:
serviceId the name of the .desktop file containing the information about the widget
appletId a unique id used to differentiate between multiple instances of the same Applet type

Definition at line 84 of file applet.cpp.

Plasma::Applet::Applet ( QObject *  parent,
const QVariantList &  args 
) [protected]

This constructor is to be used with the plugin loading systems found in KPluginInfo and KService.

The argument list is expected to have two elements: the KService service ID for the desktop entry and an applet ID which must be a base 10 number.

Parameters:
parent a QObject parent; you probably want to pass in 0
args a list of strings containing two entries: the service id and the applet id

Definition at line 95 of file applet.cpp.


Member Function Documentation

QAction * Plasma::Applet::action ( QString  name  )  const

Returns the QAction with the given name from our collection.

Definition at line 868 of file applet.cpp.

void Plasma::Applet::activate (  )  [signal]

Emitted when activation is requested due to, for example, a global keyboard shortcut.

By default the wiget is given focus.

void Plasma::Applet::addAction ( QString  name,
QAction *  action 
)

Adds the action to our collection under the given name.

Definition at line 873 of file applet.cpp.

void Plasma::Applet::addAssociatedWidget ( QWidget *  widget  )  [virtual]

associate actions with this widget, including ones added after this call.

needed to make keyboard shortcuts work.

Reimplemented in Plasma::Containment.

Definition at line 1024 of file applet.cpp.

Plasma::AspectRatioMode Plasma::Applet::aspectRatioMode (  )  const

Returns:
the preferred aspect ratio mode for placement and resizing

Definition at line 1040 of file applet.cpp.

Applet::BackgroundHints Plasma::Applet::backgroundHints (  )  const

Returns:
BackgroundHints flags combination telling if the standard background is shown and if it has a drop shadow

Definition at line 601 of file applet.cpp.

QString Plasma::Applet::category (  )  const

Returns the category the applet is in, as specified in the .desktop file.

QString Plasma::Applet::category ( const QString &  appletName  )  [static]

Get the category of the given applet.

Parameters:
appletName the name of the applet

Definition at line 557 of file applet.cpp.

QString Plasma::Applet::category ( const KPluginInfo &  applet  )  [static]

Get the category of the given applet.

Parameters:
applet a KPluginInfo object for the applet

Definition at line 552 of file applet.cpp.

KConfigGroup Plasma::Applet::config ( const QString &  group  )  const

Returns a config group with the name provided.

This ensures that the group name is properly namespaced to avoid collision with other applets that may be sharing this config file

Parameters:
group the name of the group to access

Definition at line 276 of file applet.cpp.

KConfigGroup Plasma::Applet::config (  )  const

Returns the KConfigGroup to access the applets configuration.

This config object will write to an instance specific config file named <appletname><instanceid>rc in the Plasma appdata directory.

Definition at line 282 of file applet.cpp.

void Plasma::Applet::configNeedsSaving (  )  [signal]

Emitted when an applet has changed values in its configuration and wishes for them to be saved at the next save point.

As this implies disk activity, this signal should be used with care.

Note:
This does not need to be emitted from saveState by individual applets.

ConfigXml * Plasma::Applet::configScheme (  )  const

Returns the config skeleton object from this applet's package, if any.

Returns:
config skeleton object, or 0 if none

Definition at line 380 of file applet.cpp.

bool Plasma::Applet::configurationRequired (  )  const

Returns:
true if the applet currently needs to be configured, otherwise, false

void Plasma::Applet::constraintsEvent ( Plasma::Constraints  constraints  )  [protected, virtual]

Definition at line 493 of file applet.cpp.

Containment * Plasma::Applet::containment (  )  const

Returns:
the Containment, if any, this applet belongs to

Definition at line 972 of file applet.cpp.

QList< QAction * > Plasma::Applet::contextualActions (  )  [virtual]

Returns a list of context-related QAction instances.

This is used e.g. within the DesktopView to display a contextmenu.

Returns:
A list of actions. The default implementation returns an empty list.

Definition at line 862 of file applet.cpp.

void Plasma::Applet::createConfigurationInterface ( KConfigDialog *  parent  )  [protected, virtual]

Reimplement this method so provide a configuration interface, parented to the supplied widget.

Ownership of the widgets is passed to the parent widget.

Parameters:
parent the dialog which is the parent of the configuration widgets

Definition at line 1256 of file applet.cpp.

DataEngine * Plasma::Applet::dataEngine ( const QString &  name  )  const

Loads the given DataEngine.

Tries to load the data engine given by name. Each engine is only loaded once, and that instance is re-used on all subsequent requests.

If the data engine was not found, an invalid data engine is returned (see DataEngine::isValid()).

Note that you should not delete the returned engine.

Parameters:
name Name of the data engine to load
Returns:
pointer to the data engine if it was loaded, or an invalid data engine if the requested engine could not be loaded

Definition at line 385 of file applet.cpp.

void Plasma::Applet::destroy (  )  [virtual, slot]

Destroys the applet; it will be removed nicely and deleted.

Its configuration will also be deleted.

Reimplemented in Plasma::Containment.

Definition at line 307 of file applet.cpp.

bool Plasma::Applet::eventFilter ( QObject *  o,
QEvent *  e 
) [protected]

Definition at line 1117 of file applet.cpp.

void Plasma::Applet::flushPendingConstraintsEvents (  )  [slot]

Sends all pending contraints updates to the applet.

Will usually be called automatically, but can also be called manually if needed.

Definition at line 740 of file applet.cpp.

void Plasma::Applet::focusInEvent ( QFocusEvent *  event  )  [protected]

Reimplemented from QGraphicsItem.

Definition at line 1172 of file applet.cpp.

QFont Plasma::Applet::font (  )  const

Returns:
the font currently set for this widget

Definition at line 515 of file applet.cpp.

FormFactor Plasma::Applet::formFactor (  )  const [virtual]

Returns the current form factor the applet is being displayed in.

See also:
Plasma::FormFactor

Definition at line 966 of file applet.cpp.

void Plasma::Applet::geometryChanged (  )  [signal]

Emitted whenever the applet makes a geometry change, so that views can coordinate themselves with these changes if they desire.

KConfigGroup Plasma::Applet::globalConfig (  )  const

Returns a KConfigGroup object to be shared by all applets of this type.

This config object will write to an applet-specific config object named plasma_<appletname>rc in the local config directory.

Definition at line 291 of file applet.cpp.

KShortcut Plasma::Applet::globalShortcut (  )  const

Returns:
the global shortcut associated with this wiget, or an empty shortcut if no global shortcut is associated.

Definition at line 1015 of file applet.cpp.

bool Plasma::Applet::hasConfigurationInterface (  )  const

Returns:
true if this plasmoid provides a GUI configuration

bool Plasma::Applet::hasFailedToLaunch (  )  const

If for some reason, the applet fails to get up on its feet (the library couldn't be loaded, necessary hardware support wasn't found, etc.

.) this method returns true

QString Plasma::Applet::icon (  )  const

Returns the icon related to this applet.

Definition at line 520 of file applet.cpp.

uint Plasma::Applet::id (  )  const

Returns:
the id of this applet

Definition at line 146 of file applet.cpp.

ImmutabilityType Plasma::Applet::immutability (  )  const

Returns:
The type of immutability of this applet

void Plasma::Applet::init (  )  [virtual, slot]

This method is called once the applet is loaded and added to a Corona.

If the applet requires a QGraphicsScene or has an particularly intensive set of initialization routines to go through, consider implementing it in this method instead of the constructor.

Reimplemented in Plasma::Containment.

Definition at line 139 of file applet.cpp.

bool Plasma::Applet::isContainment (  )  const

Returns:
true if this Applet is currently being used as a Containment, false otherwise

Definition at line 1545 of file applet.cpp.

bool Plasma::Applet::isRegisteredAsDragHandle ( QGraphicsItem *  item  )  [protected]

Parameters:
item the item to look for if it is registered or not

Returns:
true if it is registered, false otherwise

Definition at line 1077 of file applet.cpp.

QVariant Plasma::Applet::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
) [protected]

Reimplemented from QGraphicsItem.

Reimplemented in Plasma::Containment.

Definition at line 1395 of file applet.cpp.

KPluginInfo::List Plasma::Applet::listAppletInfo ( const QString &  category = QString(),
const QString &  parentApp = QString() 
) [static]

Returns a list of all known applets.

Parameters:
category Only applets matchin this category will be returned. Useful in conjunction with knownCategories. If "Misc" is passed in, then applets without a Categories= entry are also returned. If an empty string is passed in, all applets are returned.
parentApp the application to filter applets on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list containing only applets not specifically registered to an application.
Returns:
list of applets

Definition at line 1263 of file applet.cpp.

KPluginInfo::List Plasma::Applet::listAppletInfoForMimetype ( const QString &  mimetype  )  [static]

Returns a list of all known applets associated with a certain mimetype.

Returns:
list of applets

Definition at line 1290 of file applet.cpp.

QStringList Plasma::Applet::listCategories ( const QString &  parentApp = QString(),
bool  visibleOnly = true 
) [static]

Returns a list of all the categories used by installed applets.

Parameters:
parentApp the application to filter applets on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list containing only applets not specifically registered to an application.
Returns:
list of categories
Parameters:
visibleOnly true if it should only return applets that are marked as visible

Definition at line 1298 of file applet.cpp.

Applet * Plasma::Applet::load ( const KPluginInfo &  info,
uint  appletId = 0,
const QVariantList &  args = QVariantList() 
) [static]

Attempts to load an applet.

Returns a pointer to the applet if successful. The caller takes responsibility for the applet, including deleting it when no longer needed.

Parameters:
info KPluginInfo object for the desired applet
appletId unique ID to assign the applet, or zero to have one assigned automatically.
args to send the applet extra arguments
Returns:
a pointer to the loaded applet, or 0 on load failure

Definition at line 1386 of file applet.cpp.

Applet * Plasma::Applet::load ( const QString &  name,
uint  appletId = 0,
const QVariantList &  args = QVariantList() 
) [static]

Attempts to load an applet.

Returns a pointer to the applet if successful. The caller takes responsibility for the applet, including deleting it when no longer needed.

Parameters:
name the plugin name, as returned by KPluginInfo::pluginName()
appletId unique ID to assign the applet, or zero to have one assigned automatically.
args to send the applet extra arguments
Returns:
a pointer to the loaded applet, or 0 on load failure

Definition at line 1331 of file applet.cpp.

Location Plasma::Applet::location (  )  const [virtual]

Returns the location of the scene which is displaying applet.

See also:
Plasma::Location

Definition at line 1034 of file applet.cpp.

void Plasma::Applet::lower (  )  [slot]

Causes this applet to lower below all the other applets.

Definition at line 1520 of file applet.cpp.

QRectF Plasma::Applet::mapFromView ( const QGraphicsView *  view,
const QRect &  rect 
) const

Maps a QRect from a view's coordinates to local coordinates.

Parameters:
view the view from which rect should be mapped
rect the rect to be mapped

Definition at line 423 of file applet.cpp.

QRect Plasma::Applet::mapToView ( const QGraphicsView *  view,
const QRectF &  rect 
) const

Maps a QRectF from local coordinates to a view's coordinates.

Parameters:
view the view to which rect should be mapped
rect the rect to be mapped

Definition at line 429 of file applet.cpp.

void Plasma::Applet::mouseMoveEvent ( QGraphicsSceneMouseEvent *  event  )  [protected]

Definition at line 1141 of file applet.cpp.

void Plasma::Applet::mousePressEvent ( QGraphicsSceneMouseEvent *  event  )  [protected]

Definition at line 1166 of file applet.cpp.

QString Plasma::Applet::name (  )  const

Returns the user-visible name for the applet, as specified in the .desktop file.

Returns:
the user-visible name for the applet.

const Package * Plasma::Applet::package (  )  const

Accessor for the associated Package object if any.

Generally, only Plasmoids come in a Package.

Returns:
the Package object, or 0 if none

Definition at line 400 of file applet.cpp.

PackageStructure::Ptr Plasma::Applet::packageStructure (  )  [static]

Returns:
a package structure representing a Theme

Definition at line 130 of file applet.cpp.

void Plasma::Applet::paintInterface ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
const QRect &  contentsRect 
) [virtual]

This method is called when the interface should be painted.

Parameters:
painter the QPainter to use to do the paintiner
option the style options object
contentsRect the rect to paint within; automatically adjusted for the background, if any

Definition at line 956 of file applet.cpp.

void Plasma::Applet::paintWindowFrame ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)

Definition at line 674 of file applet.cpp.

QString Plasma::Applet::pluginName (  )  const

Returns the plugin name for the applet.

Definition at line 529 of file applet.cpp.

QPoint Plasma::Applet::popupPosition ( const QSize &  s  )  const

Reccomended position for a popup window like a menu or a tooltip given its size.

Parameters:
s size of the popup
Returns:
reccomended position

Definition at line 435 of file applet.cpp.

void Plasma::Applet::raise (  )  [slot]

Causes this applet to raise above all other applets.

Definition at line 1515 of file applet.cpp.

void Plasma::Applet::registerAsDragHandle ( QGraphicsItem *  item  )  [protected]

Register the widgets that manage mouse clicks but you still want to be able to drag the applet around when holding the mouse pointer on that widget.

Calling this results in an eventFilter being places on the widget.

Parameters:
item the item to watch for mouse move

Definition at line 1050 of file applet.cpp.

void Plasma::Applet::releaseVisualFocus (  )  [signal]

This signal indicates that an application launch, window creation or window focus event was triggered.

This is used, for instance, to ensure that the Dashboard view in Plasma hides when such an event is triggered by an item it is displaying.

void Plasma::Applet::removeAssociatedWidget ( QWidget *  widget  )  [virtual]

un-associate actions from this widget, including ones added after this call.

needed to make keyboard shortcuts work.

Reimplemented in Plasma::Containment.

Definition at line 1029 of file applet.cpp.

void Plasma::Applet::resizeEvent ( QGraphicsSceneResizeEvent *  event  )  [protected]

Reimplemented from QGraphicsItem.

Definition at line 1182 of file applet.cpp.

void Plasma::Applet::restore ( KConfigGroup &  group  )  [virtual]

Restores state information about this applet saved previously in save(KConfigGroup&).

This method does not need to be reimplmented by Applet subclasses, but can be useful for Applet specializations (such as Containment) to do so.

Reimplemented in Plasma::Containment.

Definition at line 188 of file applet.cpp.

void Plasma::Applet::save ( KConfigGroup &  group  )  const [virtual]

Saves state information about this applet that will be accessed when next instantiated in the restore(KConfigGroup&) method.

This method does not need to be reimplmented by Applet subclasses, but can be useful for Applet specializations (such as Containment) to do so.

Applet subclasses may instead want to reimplement saveState().

Reimplemented in Plasma::Containment.

Definition at line 151 of file applet.cpp.

void Plasma::Applet::saveState ( KConfigGroup &  config  )  const [protected, virtual]

When called, the Applet should write any information needed as part of the Applet's running state to the configuration object in config() and/or globalConfig().

Applets that always sync their settings/state with the config objects when these settings/states change do not need to reimplement this method.

Definition at line 266 of file applet.cpp.

bool Plasma::Applet::sceneEventFilter ( QGraphicsItem *  watched,
QEvent *  event 
) [protected]

Reimplemented in Plasma::Containment.

Definition at line 1122 of file applet.cpp.

QRect Plasma::Applet::screenRect (  )  const

Returns:
a rect of the applet in screen coordinates.

Definition at line 1488 of file applet.cpp.

void Plasma::Applet::setAspectRatioMode ( Plasma::AspectRatioMode  mode  ) 

Sets the preferred aspect ratio mode for placement and resizing.

Definition at line 1045 of file applet.cpp.

void Plasma::Applet::setBackgroundHints ( const BackgroundHints  hints  ) 

Sets the BackgroundHints for this applet.

See also:
BackgroundHint
Parameters:
hints the BackgroundHint combination for this applet

Definition at line 606 of file applet.cpp.

void Plasma::Applet::setConfigurationRequired ( bool  needsConfiguring,
const QString &  reason = QString() 
) [protected]

When the applet needs to be configured before being usable, this method can be called to show a standard interface prompting the user to configure the applet.

Not that all children items will be deleted when this method is called. If you have pointers to these items, you will need to reset them after calling this method.

Parameters:
needsConfiguring true if the applet needs to be configured, or false if it doesn't

Definition at line 686 of file applet.cpp.

void Plasma::Applet::setFailedToLaunch ( bool  failed,
const QString &  reason = QString() 
) [protected]

Call this method when the applet fails to launch properly.

An optional reason can be provided.

Not that all children items will be deleted when this method is called. If you have pointers to these items, you will need to reset them after calling this method.

Parameters:
failed true when the applet failed, false when it succeeded
reason an optional reason to show the user why the applet failed to launch

Definition at line 235 of file applet.cpp.

void Plasma::Applet::setGlobalShortcut ( const KShortcut &  shortcut  ) 

Sets the global shorcut to associate with this widget.

Definition at line 996 of file applet.cpp.

void Plasma::Applet::setHasConfigurationInterface ( bool  hasInterface  )  [protected]

Sets whether or not this applet provides a user interface for configuring the applet.

It defaults to false, and if true is passed in you should also reimplement createConfigurationInterface()

Parameters:
hasInterface whether or not there is a user interface available

Definition at line 1087 of file applet.cpp.

void Plasma::Applet::setImmutability ( const ImmutabilityType  immutable  )  [slot]

Sets the immutability type for this applet (not immutable, user immutable or system immutable).

  • immutable the new immutability type of this applet

Definition at line 591 of file applet.cpp.

void Plasma::Applet::setIsContainment ( bool  isContainment  )  [protected]

Sets whether or not this Applet is acting as a Containment.

Definition at line 1525 of file applet.cpp.

QPainterPath Plasma::Applet::shape (  )  const [protected]

Reimplemented from QGraphicsItem.

Definition at line 1439 of file applet.cpp.

bool Plasma::Applet::shouldConserveResources (  )  const

Whether the applet should conserve resources.

If true, try to avoid doing stuff which is computationally heavy. Try to conserve power and resources.

Returns:
true if it should conserve resources, false if it does not.

void Plasma::Applet::showConfigurationInterface (  )  [virtual, slot]

Lets the user interact with the plasmoid options.

Called when the user selects the configure entry from the context menu.

Unless there is good reason for overriding this method, Applet subclasses should actually override createConfigurationInterface instead. A good example of when this isn't plausible is when using a dialog prepared by another library, such as KPropertiesDialog from libkfile.

Definition at line 1194 of file applet.cpp.

QSizeF Plasma::Applet::sizeHint ( Qt::SizeHint  which,
const QSizeF &  constraint = QSizeF() 
) const [protected]

Reimplemented from QGraphicsLayoutItem.

Definition at line 1448 of file applet.cpp.

void Plasma::Applet::timerEvent ( QTimerEvent *  event  )  [protected]

Reimplemented from QObject.

Definition at line 1479 of file applet.cpp.

int Plasma::Applet::type (  )  const

Reimplemented from QGraphicsItem.

Definition at line 857 of file applet.cpp.

void Plasma::Applet::unregisterAsDragHandle ( QGraphicsItem *  item  )  [protected]

Unregister a widget registered with registerAsDragHandle.

Parameters:
item the item to unregister

Definition at line 1064 of file applet.cpp.

void Plasma::Applet::updateConstraints ( Plasma::Constraints  constraints = Plasma::AllConstraints  ) 

Called when any of the geometry constraints have been updated.

This method calls constraintsEvent, which may be reimplemented, once the Applet has been prepared for updating the constraints.

Parameters:
constraints the type of constraints that were updated

Definition at line 488 of file applet.cpp.

QGraphicsView * Plasma::Applet::view (  )  const

Returns the view this widget is visible on.

Definition at line 405 of file applet.cpp.


Property Documentation

QString Plasma::Applet::category [read]

Definition at line 73 of file applet.h.

bool Plasma::Applet::configurationRequired [read, write]

Definition at line 76 of file applet.h.

QRectF Plasma::Applet::geometry [read, write]

Definition at line 77 of file applet.h.

bool Plasma::Applet::hasConfigurationInterface [read]

Definition at line 71 of file applet.h.

bool Plasma::Applet::hasFailedToLaunch [read, write]

Definition at line 75 of file applet.h.

ImmutabilityType Plasma::Applet::immutability [read, write]

Definition at line 74 of file applet.h.

QString Plasma::Applet::name [read]

Definition at line 72 of file applet.h.

bool Plasma::Applet::shouldConserveResources [read]

Definition at line 78 of file applet.h.


The documentation for this class was generated from the following files:
  • applet.h
  • applet.cpp

libplasma

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

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal