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: libextension.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 KPanelExtension

    Author: Matthias Elter

    UNKNOWN: %KDE Panel Extension class.

    Field Summary
    static intAbout
    static intBottom
    static intCenter
    static intFloating
    static intHelp
    static intLeft
    static intLeftTop
    static intNormal
    static intPreferences
    static intReportBug
    static intRight
    static intRightBottom
    static intSizeCustom
    static intSizeLarge
    static intSizeNormal
    static intSizeSmall
    static intSizeTiny
    static intStretch
    static intTop
    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 voidabout()
    Is called when the user selects "About" from the extensions RMB menu.
    voidaction(int a)
    Generic action dispatcher.
    intactions()
    protected intalignment()
    protected voidalignmentChange(int arg1)
    This extension has changed its alignment.
    StringclassName()
    KConfigconfig()
    Always use this KConfig object to save/load your extensions configuration.
    QPopupMenucustomMenu()
    intcustomSize()
    voiddispose()
    Delete the wrapped C++ instance ahead of finalize()
    protected voidfinalize()
    Deletes the wrapped C++ instance
    protected voidhelp()
    Is called when the user selects "Help" from the extensions RMB menu.
    booleanisDisposed()
    Has the wrapped C++ instance been deleted?
    QMetaObjectmetaObject()
    protected intorientation()
    protected intposition()
    protected voidpositionChange(int arg1)
    This extension has changed its position.
    intpreferedPosition()
    Reimplement this function to set a preferred dock position for your extension.
    protected voidpreferences()
    Is called when the user selects "Preferences" from the extensions RMB menu.
    protected voidreportBug()
    Is called when the user selects "Report bug" from the applet's RMB menu.
    booleanreserveStrut()
    voidsetAlignment(int a)
    protected voidsetCustomMenu(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.
    voidsetPosition(int p)
    protected voidsetReserveStrut(boolean shouldUseStrut)
    Use this method to set the return value for reserveStrut
    voidsetSize(int size, int customSize)
    QSizesizeHint(int arg1, QSize maxsize)
    Returns the preferred size for a given Position.
    protected intsizeInPixels()
    intsizeSetting()
    inttype()

    Field Detail

    About

    public static final int About

    Bottom

    public static final int Bottom

    Center

    public static final int Center

    Floating

    public static final int Floating

    Help

    public static final int Help

    Left

    public static final int Left

    LeftTop

    public static final int LeftTop

    Normal

    public static final int Normal

    Preferences

    public static final int Preferences

    ReportBug

    public static final int ReportBug

    Right

    public static final int Right

    RightBottom

    public static final int RightBottom

    SizeCustom

    public static final int SizeCustom

    SizeLarge

    public static final int SizeLarge

    SizeNormal

    public static final int SizeNormal

    SizeSmall

    public static final int SizeSmall

    SizeTiny

    public static final int SizeTiny

    Stretch

    public static final int Stretch

    Top

    public static final int Top

    Constructor Detail

    KPanelExtension

    protected KPanelExtension(Class dummy)

    KPanelExtension

    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.

    KPanelExtension

    public KPanelExtension(String configFile, int t, int actions, QWidget parent)

    KPanelExtension

    public KPanelExtension(String configFile, int t, int actions)

    KPanelExtension

    public KPanelExtension(String configFile, int t)

    KPanelExtension

    public KPanelExtension(String configFile)

    Method Detail

    about

    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.

    action

    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.

    actions

    public int actions()

    Returns: int indicating the supported RMB menu actions. Action

    UNKNOWN:

    alignment

    protected int alignment()

    Returns: the extension's alignment. (left/top, center, or right/bottom)

    UNKNOWN:

    alignmentChange

    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.

    className

    public String className()

    config

    public KConfig config()
    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.

    customMenu

    public QPopupMenu customMenu()

    Returns: the extension's custom menu, usually the same as the context menu, or 0 if none

    See Also: (QPopupMenu*)

    UNKNOWN:

    customSize

    public int customSize()

    Returns: the custom sizel setting in pixels

    UNKNOWN:

    dispose

    public void dispose()
    Delete the wrapped C++ instance ahead of finalize()

    finalize

    protected void finalize()
    Deletes the wrapped C++ instance

    help

    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.

    isDisposed

    public boolean isDisposed()
    Has the wrapped C++ instance been deleted?

    metaObject

    public QMetaObject metaObject()

    orientation

    protected int orientation()

    Returns: the extensions orientation. (horizontal or vertical)

    UNKNOWN:

    position

    protected int position()

    Returns: the extension's position. (left, right, top, bottom)

    UNKNOWN:

    positionChange

    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.

    preferedPosition

    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.

    preferences

    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.

    reportBug

    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.

    reserveStrut

    public boolean reserveStrut()

    Returns: whether or not to set a desktop geometry claiming strut for this panel defaults to true

    See Also: KPanelExtension

    UNKNOWN:

    setAlignment

    public void setAlignment(int a)

    UNKNOWN:

    setCustomMenu

    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.

    setPosition

    public void setPosition(int p)

    UNKNOWN:

    setReserveStrut

    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

    setSize

    public void setSize(int size, int customSize)

    UNKNOWN:

    sizeHint

    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.

    sizeInPixels

    protected int sizeInPixels()

    Returns: the appropriate size in pixels for the panel

    UNKNOWN:

    sizeSetting

    public int sizeSetting()

    Returns: the extension's size

    UNKNOWN:

    type

    public int type()

    Returns: Type indicating the extensions type. Type

    UNKNOWN: