\section{KPanel\-Extension Class Reference}
\label{classKPanelExtension}\index{KPanelExtension@{KPanelExtension}}
Implements a panel extension. {\bf KDE} Panel Extension class.  


{\tt \#include $<$kpanelextension.h$>$}

Inheritance diagram for KPanel\-Extension:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=65pt]{classKPanelExtension__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KPanel\-Extension:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=278pt]{classKPanelExtension__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Type} \{ {\bf Normal} =  0, 
{\bf Stretch}
 \}
\begin{CompactList}\small\item\em The type of the extention (TODO). \item\end{CompactList}\item 
enum {\bf Action} \{ {\bf About} =  1, 
{\bf Help} =  2, 
{\bf Preferences} =  4, 
{\bf Report\-Bug} =  8
 \}
\item 
enum {\bf Position} \{ {\bf Left} =  0, 
{\bf Right}, 
{\bf Top}, 
{\bf Bottom}
 \}
\item 
enum {\bf Alignment} \{ {\bf Left\-Top} =  0, 
{\bf Center}, 
{\bf Right\-Bottom}
 \}
\item 
enum {\bf Size} \{ \par
{\bf Size\-Tiny} =  0, 
{\bf Size\-Small}, 
{\bf Size\-Normal}, 
{\bf Size\-Large}, 
\par
{\bf Size\-Custom}
 \}
\begin{CompactList}\small\item\em \begin{Desc}
\item[Since:]3.1 \end{Desc}
\item\end{CompactList}\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf update\-Layout} ()
\begin{CompactList}\small\item\em Emit this signal to make the panel relayout all extensions in the dock, when you want to change the extensions size. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KPanel\-Extension} (const  {\bf QString} \&config\-File, {\bf Type} t=Normal, int actions=0, {\bf QWidget} $\ast$parent=0, const  char $\ast$name=0)
\begin{CompactList}\small\item\em Constructs a KPanel\-Extension just like any other widget. \item\end{CompactList}\item 
{\bf $\sim$KPanel\-Extension} ()
\begin{CompactList}\small\item\em Destructor. \item\end{CompactList}\item 
virtual {\bf QSize} {\bf size\-Hint} (Position, {\bf QSize} maxsize) const 
\begin{CompactList}\small\item\em Returns the prefered size for a given Position. \item\end{CompactList}\item 
{\bf KConfig} $\ast$ {\bf config} () const 
\begin{CompactList}\small\item\em Always use this {\bf KConfig} object to save/load your extensions configuration. \item\end{CompactList}\item 
{\bf Type} {\bf type} () const 
\item 
int {\bf actions} () const 
\item 
virtual void {\bf action} (Action a)
\begin{CompactList}\small\item\em Generic action dispatcher. \item\end{CompactList}\item 
virtual Position {\bf prefered\-Position} () const 
\begin{CompactList}\small\item\em Reimplement this function to set a prefered dock position for your extension. \item\end{CompactList}\item 
void {\bf set\-Position} (Position p)\label{classKPanelExtension_a8}

\item 
void {\bf set\-Alignment} (Alignment a)\label{classKPanelExtension_a9}

\item 
void {\bf set\-Size} ({\bf Size} size, int custom\-Size)\label{classKPanelExtension_a10}

\item 
{\bf Size} {\bf size\-Setting} () const 
\item 
int {\bf custom\-Size} () const 
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf about} ()
\begin{CompactList}\small\item\em Is called when the user selects \char`\"{}About\char`\"{} from the extensions RMB menu. \item\end{CompactList}\item 
virtual void {\bf help} ()
\begin{CompactList}\small\item\em Is called when the user selects \char`\"{}Help\char`\"{} from the extensions RMB menu. \item\end{CompactList}\item 
virtual void {\bf preferences} ()
\begin{CompactList}\small\item\em Is called when the user selects \char`\"{}Preferences\char`\"{} from the extensions RMB menu. \item\end{CompactList}\item 
virtual void {\bf report\-Bug} ()
\begin{CompactList}\small\item\em Is called when the user selects \char`\"{}Report bug\char`\"{} from the applet's RMB menu. \item\end{CompactList}\item 
Position {\bf position} () const 
\item 
Alignment {\bf alignment} () const 
\item 
Orientation {\bf orientation} ()
\item 
int {\bf size\-In\-Pixels} () const 
\item 
virtual void {\bf position\-Change} (Position)
\begin{CompactList}\small\item\em This extension has changed its position. \item\end{CompactList}\item 
virtual void {\bf alignment\-Change} (Alignment)
\begin{CompactList}\small\item\em This extension has changed its alignment. \item\end{CompactList}\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKPanelExtension_b10}

\end{CompactItemize}


\subsection{Detailed Description}
Implements a panel extension. {\bf KDE} Panel Extension class. 

Panel extensions \begin{itemize}
\item Are small applications living in the Window Manager dock managed by the panel. \item Are implemented as DSOs (Dynamic Shared Objects).\end{itemize}
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 recognised by the panel.

Besides standard keys like \char`\"{}Name\char`\"{}, \char`\"{}Comment\char`\"{} and \char`\"{}Icon\char`\"{} there are two panel extension specific keys:

{\bf  X-KDE-Library}

{\bf  Used by the panel to locate the extension DSO (Dynamic Shared Object) Example: X-KDE-Library=libexampleextension}

{\bf  }

{\bf {\bf  X-KDE-Unique\-Extension}}

{\bf {\bf  Similar to {\bf KApplication} and {\bf KUnique\-Application} 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-Unique\-Extension is a boolean key which defaults to \char`\"{}false\char`\"{}. Example: X-KDE-Unique\-Extension=true}}

{\bf {\bf  Back to panel extension DSOs, the following conventions are used for {\bf KDE}: Name: lib$<$extensionname$>$extension.la LDFLAGS: -module -no-undefined}}

{\bf {\bf  To implement a panel extension it is not enough to write a class inheriting from KPanel\-Extension but you also have to provide a factory function in your DSO. A sample factory function could look like this:}}

{\bf {\bf  \small\begin{alltt}\end{alltt}\normalsize 
}}

{\bf {\bf \small\begin{alltt} extern "C"
 \{
     KPanelExtension* init(QWidget *parent, const QString& configFile)
     \{
         {\bf KGlobal::locale()}-$>$insertCatalogue("exampleextension");
         return new ExampleExtension(configFile, KPanelExtension::Normal,
                       KPanelExtension::About | KPanelExtension::Help | KPanelExtension::Preferences,
                       parent, "exampleextension");
     \}
 \}\end{alltt}\normalsize 
}}

{\bf {\bf \small\begin{alltt} \end{alltt}\normalsize 
}}

{\bf {\bf  Note: Don't change the factory function signature or the panel will fail to load your extension.}}

{\bf {\bf  \begin{Desc}
\item[Author:]Matthias Elter $<${\tt elter@kde.org}$>$ \end{Desc}
}}



Definition at line 96 of file kpanelextension.h.

\subsection{Member Enumeration Documentation}
\index{KPanelExtension@{KPanel\-Extension}!Type@{Type}}
\index{Type@{Type}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf enum} {\bf KPanel\-Extension::Type}}\label{classKPanelExtension_w18}


The type of the extention (TODO). 



Definition at line 103 of file kpanelextension.h.

Referenced by type().\index{KPanelExtension@{KPanel\-Extension}!Size@{Size}}
\index{Size@{Size}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf enum} {\bf KPanel\-Extension::Size}}\label{classKPanelExtension_w22}


\begin{Desc}
\item[Since:]3.1 \end{Desc}




Definition at line 108 of file kpanelextension.h.

Referenced by size\-Setting().

\subsection{Constructor \& Destructor Documentation}
\index{KPanelExtension@{KPanel\-Extension}!KPanelExtension@{KPanelExtension}}
\index{KPanelExtension@{KPanelExtension}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPanel\-Extension::KPanel\-Extension (const {\bf QString} \& {\em config\-File}, {\bf Type} {\em t} = Normal, int {\em actions} = 0, {\bf QWidget} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 0)}\label{classKPanelExtension_a0}


Constructs a KPanel\-Extension just like any other widget. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em config\-File}]The config\-File handed over in the factory function. \item[{\em Type}]The extension {\bf type}{\rm (p.\,\pageref{classKPanelExtension_a4})}(). \item[{\em actions}]Standard RMB menu actions supported by the extension (see {\bf action}{\rm (p.\,\pageref{classKPanelExtension_a6})}() ). \item[{\em parent}]The pointer to the parent widget handed over in the factory function. \item[{\em name}]A {\bf Qt} object name for your extension. \end{description}
\end{Desc}


Definition at line 41 of file kpanelextension.cpp.

References KStd\-Accel::name(), and QFrame::set\-Frame\-Style().\index{KPanelExtension@{KPanel\-Extension}!~KPanelExtension@{$\sim$KPanelExtension}}
\index{~KPanelExtension@{$\sim$KPanelExtension}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPanel\-Extension::$\sim${\bf KPanel\-Extension} ()}\label{classKPanelExtension_a1}


Destructor. 



Definition at line 55 of file kpanelextension.cpp.

\subsection{Member Function Documentation}
\index{KPanelExtension@{KPanel\-Extension}!sizeHint@{sizeHint}}
\index{sizeHint@{sizeHint}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QSize} KPanel\-Extension::size\-Hint (Position, {\bf QSize} {\em maxsize}) const\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKPanelExtension_a2}


Returns the prefered size for a given Position. 

Every extension should reimplement this function.

Depending on the panel position the extensions can choose a prefered 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. 

Definition at line 136 of file kpanelextension.h.\index{KPanelExtension@{KPanel\-Extension}!config@{config}}
\index{config@{config}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KConfig}$\ast$ KPanel\-Extension::config () const\hspace{0.3cm}{\tt  [inline]}}\label{classKPanelExtension_a3}


Always use this {\bf 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 {\bf KDE} directory.

For normal extensions this config object will write to a instance specific config file called rc in the users local {\bf KDE} directory. 

Definition at line 147 of file kpanelextension.h.\index{KPanelExtension@{KPanel\-Extension}!type@{type}}
\index{type@{type}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Type} KPanel\-Extension::type () const\hspace{0.3cm}{\tt  [inline]}}\label{classKPanelExtension_a4}


\begin{Desc}
\item[Returns:]Type indicating the extensions type. {\bf Type}{\rm (p.\,\pageref{classKPanelExtension_w18})} \end{Desc}


Definition at line 153 of file kpanelextension.h.

References Type.\index{KPanelExtension@{KPanel\-Extension}!actions@{actions}}
\index{actions@{actions}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KPanel\-Extension::actions () const\hspace{0.3cm}{\tt  [inline]}}\label{classKPanelExtension_a5}


\begin{Desc}
\item[Returns:]int indicating the supported RMB menu actions. \#Action \end{Desc}


Definition at line 159 of file kpanelextension.h.\index{KPanelExtension@{KPanel\-Extension}!action@{action}}
\index{action@{action}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPanel\-Extension::action (Action {\em a})\hspace{0.3cm}{\tt  [virtual]}}\label{classKPanelExtension_a6}


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 Report\-Bug use the convenience handlers ref {\bf about()}{\rm (p.\,\pageref{classKPanelExtension_b0})}, {\bf help()}{\rm (p.\,\pageref{classKPanelExtension_b1})}, {\bf preferences()}{\rm (p.\,\pageref{classKPanelExtension_b2})}, {\bf report\-Bug()}{\rm (p.\,\pageref{classKPanelExtension_b3})} 

Definition at line 83 of file kpanelextension.cpp.

References about(), help(), preferences(), and report\-Bug().\index{KPanelExtension@{KPanel\-Extension}!preferedPosition@{preferedPosition}}
\index{preferedPosition@{preferedPosition}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual Position KPanel\-Extension::prefered\-Position () const\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKPanelExtension_a7}


Reimplement this function to set a prefered dock position for your extension. 

The extension manager will try to place new instances of this extension according to this setting. \begin{Desc}
\item[Returns:]Position \end{Desc}


Definition at line 180 of file kpanelextension.h.\index{KPanelExtension@{KPanel\-Extension}!sizeSetting@{sizeSetting}}
\index{sizeSetting@{sizeSetting}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPanel\-Extension::Size} KPanel\-Extension::size\-Setting () const}\label{classKPanelExtension_a11}


\begin{Desc}
\item[Returns:]the extension's size \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 103 of file kpanelextension.cpp.

References Size.\index{KPanelExtension@{KPanel\-Extension}!customSize@{customSize}}
\index{customSize@{customSize}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KPanel\-Extension::custom\-Size () const}\label{classKPanelExtension_a12}


\begin{Desc}
\item[Returns:]the custom sizel setting in pixels \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 108 of file kpanelextension.cpp.\index{KPanelExtension@{KPanel\-Extension}!updateLayout@{updateLayout}}
\index{updateLayout@{updateLayout}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPanel\-Extension::update\-Layout ()\hspace{0.3cm}{\tt  [signal]}}\label{classKPanelExtension_l0}


Emit this signal to make the panel relayout all extensions in the dock, when you want to change the extensions size. 

The panel is going to relayout all extensions based on their prefered size. \index{KPanelExtension@{KPanel\-Extension}!about@{about}}
\index{about@{about}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KPanel\-Extension::about ()\hspace{0.3cm}{\tt  [inline, protected, virtual]}}\label{classKPanelExtension_b0}


Is called when the user selects \char`\"{}About\char`\"{} 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. 

Definition at line 226 of file kpanelextension.h.

Referenced by action().\index{KPanelExtension@{KPanel\-Extension}!help@{help}}
\index{help@{help}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KPanel\-Extension::help ()\hspace{0.3cm}{\tt  [inline, protected, virtual]}}\label{classKPanelExtension_b1}


Is called when the user selects \char`\"{}Help\char`\"{} 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. 

Definition at line 235 of file kpanelextension.h.

Referenced by action().\index{KPanelExtension@{KPanel\-Extension}!preferences@{preferences}}
\index{preferences@{preferences}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KPanel\-Extension::preferences ()\hspace{0.3cm}{\tt  [inline, protected, virtual]}}\label{classKPanelExtension_b2}


Is called when the user selects \char`\"{}Preferences\char`\"{} 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. 

Definition at line 244 of file kpanelextension.h.

Referenced by action().\index{KPanelExtension@{KPanel\-Extension}!reportBug@{reportBug}}
\index{reportBug@{reportBug}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KPanel\-Extension::report\-Bug ()\hspace{0.3cm}{\tt  [inline, protected, virtual]}}\label{classKPanelExtension_b3}


Is called when the user selects \char`\"{}Report bug\char`\"{} 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 Report\-Bug action. See \#Action. 

Definition at line 254 of file kpanelextension.h.

Referenced by action().\index{KPanelExtension@{KPanel\-Extension}!position@{position}}
\index{position@{position}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Position KPanel\-Extension::position () const\hspace{0.3cm}{\tt  [inline, protected]}}\label{classKPanelExtension_b4}


\begin{Desc}
\item[Returns:]the extension's position. (left, right, top, bottom) \end{Desc}


Definition at line 259 of file kpanelextension.h.\index{KPanelExtension@{KPanel\-Extension}!alignment@{alignment}}
\index{alignment@{alignment}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Alignment KPanel\-Extension::alignment () const\hspace{0.3cm}{\tt  [inline, protected]}}\label{classKPanelExtension_b5}


\begin{Desc}
\item[Returns:]the extension's alignment. (left/top, center, or right/bottom) \end{Desc}


Definition at line 264 of file kpanelextension.h.\index{KPanelExtension@{KPanel\-Extension}!orientation@{orientation}}
\index{orientation@{orientation}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Qt::Orientation KPanel\-Extension::orientation ()\hspace{0.3cm}{\tt  [protected]}}\label{classKPanelExtension_b6}


\begin{Desc}
\item[Returns:]the extensions orientation. (horizontal or vertical) \end{Desc}


Definition at line 95 of file kpanelextension.cpp.\index{KPanelExtension@{KPanel\-Extension}!sizeInPixels@{sizeInPixels}}
\index{sizeInPixels@{sizeInPixels}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KPanel\-Extension::size\-In\-Pixels () const\hspace{0.3cm}{\tt  [protected]}}\label{classKPanelExtension_b7}


\begin{Desc}
\item[Returns:]the appropriate size in pixels for the panel \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 113 of file kpanelextension.cpp.\index{KPanelExtension@{KPanel\-Extension}!positionChange@{positionChange}}
\index{positionChange@{positionChange}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KPanel\-Extension::position\-Change (Position)\hspace{0.3cm}{\tt  [inline, protected, virtual]}}\label{classKPanelExtension_b8}


This extension has changed its position. 

Reimplement this change handler in order to adjust the look of your applet. 

Definition at line 282 of file kpanelextension.h.\index{KPanelExtension@{KPanel\-Extension}!alignmentChange@{alignmentChange}}
\index{alignmentChange@{alignmentChange}!KPanelExtension@{KPanel\-Extension}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KPanel\-Extension::alignment\-Change (Alignment)\hspace{0.3cm}{\tt  [inline, protected, virtual]}}\label{classKPanelExtension_b9}


This extension has changed its alignment. 

Reimplement this change handler in order to adjust the look of your applet. 

Definition at line 289 of file kpanelextension.h.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kpanelextension.h\item 
kpanelextension.cpp\end{CompactItemize}
