org.kde.koala
Class KPanelExtension
public
class
KPanelExtension
extends QFrame
Panel extensions
Are small applications living in the Window Manager dock managed by the panel.
Are implemented as DSOs (Dynamic Shared Objects).
Note: For security and stability reasons the panel won't load
untrusted third party extensions directly into its namespace but via an
external wrapper process.
The panel locates available extensions by searching for extension desktop
files in (ALL_KDEDIRS)/share/apps/kicker/extensions. Every panel extension should
install a desktop file there to be recognized by the panel.
Besides standard keys like "Name", "Comment" and "Icon" there are
two panel extension specific keys:
X-KDE-Library
Used by the panel to locate the extension DSO (Dynamic Shared Object)
Example: X-KDE-Library=libexampleextension
X-KDE-UniqueExtension
Similar to KApplication and KUniqueApplication there are
two types of panel extensions. Use unique extensions when it makes no
sence to run more than one instance of an extension in the panel. A
good example for unique extensions is the taskbar extension. Use normal
extensions when you need instance specific configuration. An example
is a subpanel extension where you might want to run more than one instances.
X-KDE-UniqueExtension is a booleanean key which defaults
to "false". Example: X-KDE-UniqueExtension=true
Back to panel extension DSOs, the following conventions are used for KDE:
Name: lib
extension.la
LDFLAGS: -module -no-undefined
To implement a panel extension it is not enough to write a class
inheriting from KPanelExtension but you also have to provide a
factory function in your DSO. A sample factory function could look
like this:
extern "C"
{
KPanelExtension init(QWidget parent, String configFile)
{
KGlobal.locale().insertCatalogue("exampleextension");
return new ExampleExtension(configFile, KPanelExtension.Normal,
KPanelExtension.About | KPanelExtension.Help | KPanelExtension.Preferences,
parent, "exampleextension");
}
}
Note: Don't change the factory function signature or the panel will
fail to load your extension.
See KPanelExtensionSignals for signals emitted by KPanelExtensionAuthor: Matthias Elter
UNKNOWN: %KDE Panel Extension class.
Constructor Summary |
protected | KPanelExtension(Class dummy) |
| KPanelExtension(String configFile, int t, int actions, QWidget parent, String name)
Constructs a KPanelExtension just like any other widget. |
| KPanelExtension(String configFile, int t, int actions, QWidget parent) |
| KPanelExtension(String configFile, int t, int actions) |
| KPanelExtension(String configFile, int t) |
| KPanelExtension(String configFile) |
Method Summary |
protected void | about()
Is called when the user selects "About" from the extensions RMB menu.
|
void | action(int a)
Generic action dispatcher. |
int | actions() |
protected int | alignment() |
protected void | alignmentChange(int arg1)
This extension has changed its alignment.
|
String | className() |
KConfig | config()
Always use this KConfig object to save/load your extensions configuration.
|
QPopupMenu | customMenu() |
int | customSize() |
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
protected void | finalize() Deletes the wrapped C++ instance |
protected void | help()
Is called when the user selects "Help" from the extensions RMB menu.
|
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
QMetaObject | metaObject() |
protected int | orientation() |
protected int | position() |
protected void | positionChange(int arg1)
This extension has changed its position.
|
int | preferedPosition()
Reimplement this function to set a preferred dock position for your extension.
|
protected void | preferences()
Is called when the user selects "Preferences" from the extensions RMB menu.
|
protected void | reportBug()
Is called when the user selects "Report bug" from the applet's RMB menu.
|
boolean | reserveStrut() |
void | setAlignment(int a) |
protected void | setCustomMenu(QPopupMenu arg1)
Use this method to set the custom menu for this extensions so that it can be shown
at the appropriate places/times that the extension many not itself
be aware of. |
void | setPosition(int p) |
protected void | setReserveStrut(boolean shouldUseStrut)
Use this method to set the return value for reserveStrut |
void | setSize(int size, int customSize) |
QSize | sizeHint(int arg1, QSize maxsize)
Returns the preferred size for a given Position.
|
protected int | sizeInPixels() |
int | sizeSetting() |
int | type() |
public static final int About
public static final int Bottom
public static final int Center
public static final int Floating
public static final int Help
public static final int Left
public static final int LeftTop
public static final int Normal
public static final int Preferences
public static final int ReportBug
public static final int Right
public static final int RightBottom
public static final int SizeCustom
public static final int SizeLarge
public static final int SizeNormal
public static final int SizeSmall
public static final int SizeTiny
public static final int Stretch
public static final int Top
protected KPanelExtension(Class dummy)
public KPanelExtension(String configFile, int t, int actions, QWidget parent, String name)
Constructs a KPanelExtension just like any other widget.
Parameters: configFile The configFile handed over in the factory function. t The extension type(). actions Standard RMB menu actions supported by the extension (see action() ). parent The pointer to the parent widget handed over in the factory function. name A Qt object name for your extension.
UNKNOWN: Constructs a KPanelExtension just like any other widget.
public KPanelExtension(String configFile, int t, int actions, QWidget parent)
public KPanelExtension(String configFile, int t, int actions)
public KPanelExtension(String configFile, int t)
public KPanelExtension(String configFile)
protected void about()
Is called when the user selects "About" from the extensions RMB menu.
Reimplement this function to launch a about dialog.
Note that this is called only when your extension supports the About action.
See Action.
UNKNOWN: Is called when the user selects "About" from the extensions RMB menu.
public void action(int a)
Generic action dispatcher. Called when the user selects an item
from the extensions RMB menu.
Reimplement this function to handle actions.
For About, Help, Preferences and ReportBug use the convenience handlers
ref about(), help(), preferences(), reportBug()
UNKNOWN: Generic action dispatcher.
public int actions()
Returns: int indicating the supported RMB menu actions.
Action
UNKNOWN:
protected int alignment()
Returns: the extension's alignment. (left/top, center, or right/bottom)
UNKNOWN:
protected void alignmentChange(int arg1)
This extension has changed its alignment.
Reimplement this change handler in order to adjust the look of your
applet.
UNKNOWN: This extension has changed its alignment.
public String className()
Always use this KConfig object to save/load your extensions configuration.
For unique extensions this config object will write to a config file called
\
rc in the users local KDE directory.
For normal extensions this config object will write to a instance specific config file
called \\rc in the users local KDE directory.UNKNOWN: Always use this KConfig object to save/load your extensions configuration.
public QPopupMenu customMenu()
Returns: the extension's custom menu, usually the same as the context menu, or 0 if none
See Also: (QPopupMenu*)
UNKNOWN:
public int customSize()
Returns: the custom sizel setting in pixels
UNKNOWN:
public void dispose()
Delete the wrapped C++ instance ahead of finalize()
protected void finalize()
Deletes the wrapped C++ instance
protected void help()
Is called when the user selects "Help" from the extensions RMB menu.
Reimplement this function to launch a manual or help page.
Note that this is called only when your extension supports the Help action.
See Action.
UNKNOWN: Is called when the user selects "Help" from the extensions RMB menu.
public boolean isDisposed()
Has the wrapped C++ instance been deleted?
public QMetaObject metaObject()
protected int orientation()
Returns: the extensions orientation. (horizontal or vertical)
UNKNOWN:
protected int position()
Returns: the extension's position. (left, right, top, bottom)
UNKNOWN:
protected void positionChange(int arg1)
This extension has changed its position.
Reimplement this change handler in order to adjust the look of your
applet.
UNKNOWN: This extension has changed its position.
public int preferedPosition()
Reimplement this function to set a preferred dock position for your extension.
The extension manager will try to place new instances of this extension according
to this setting.
Returns: Position
UNKNOWN: Reimplement this function to set a preferred dock position for your extension.
protected void preferences()
Is called when the user selects "Preferences" from the extensions RMB menu.
Reimplement this function to launch a preferences dialog or kcontrol module.
Note that this is called only when your extension supports the preferences action.
See Action.
UNKNOWN: Is called when the user selects "Preferences" from the extensions RMB menu.
protected void reportBug()
Is called when the user selects "Report bug" from the applet's RMB menu.
Reimplement this function to launch a bug reporting dialog.
Note that this is called only when your applet supports the ReportBug
action.
See Action.
UNKNOWN: Is called when the user selects "Report bug" from the applet's RMB menu.
public boolean reserveStrut()
Returns: whether or not to set a desktop geometry claiming strut for this panel
defaults to true
See Also: KPanelExtension
UNKNOWN:
public void setAlignment(int a)
protected void setCustomMenu(QPopupMenu arg1)
Use this method to set the custom menu for this extensions so that it can be shown
at the appropriate places/times that the extension many not itself
be aware of. The extension itself is still responsible for deleting and managing the
the menu.
If the menu is deleted during the life of the extension, be sure to call this method again
with the new menu (or 0) to avoid crashes
UNKNOWN: Use this method to set the custom menu for this extensions so that it can be shown at the appropriate places/times that the extension many not itself be aware of.
public void setPosition(int p)
protected void setReserveStrut(boolean shouldUseStrut)
Use this method to set the return value for reserveStrut
See Also: KPanelExtension
UNKNOWN: Use this method to set the return value for reserveStrut
public void setSize(int size, int customSize)
public QSize sizeHint(int arg1, QSize maxsize)
Returns the preferred size for a given Position.
Every extension should reimplement this function.
Depending on the panel position the extensions can choose a preferred size for that
location in the Window Manager Dock. Please note that the size can not be larger than the
maxsize given by the handler.
UNKNOWN: Returns the preferred size for a given Position.
protected int sizeInPixels()
Returns: the appropriate size in pixels for the panel
UNKNOWN:
public int sizeSetting()
Returns: the extension's size
UNKNOWN:
public int type()
Returns: Type indicating the extensions type.
Type
UNKNOWN: