\section{KGlobal\-Accel Class Reference}
\label{classKGlobalAccel}\index{KGlobalAccel@{KGlobalAccel}}
KGlobal\-Accel allows you to have global accelerators that are independent of the focused window. Configurable global shortcut support.  


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

Inheritance diagram for KGlobal\-Accel:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=56pt]{classKGlobalAccel__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KGlobal\-Accel:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=56pt]{classKGlobalAccel__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KGlobal\-Accel} ({\bf QObject} $\ast$p\-Parent, const char $\ast$ps\-Name=0)
\item 
bool {\bf is\-Enabled} ()
\item 
void {\bf set\-Enabled} (bool b\-Enabled)
\item 
KAccel\-Action $\ast$ {\bf insert} (const {\bf QString} \&s\-Action, const {\bf QString} \&s\-Label, const {\bf QString} \&s\-Whats\-This, const {\bf KShortcut} \&cut\-Def3, const {\bf KShortcut} \&cut\-Def4, const {\bf QObject} $\ast$p\-Obj\-Slot, const char $\ast$ps\-Method\-Slot, bool b\-Configurable=true, bool b\-Enabled=true)
\item 
bool {\bf remove} (const {\bf QString} \&s\-Action)
\item 
KAccel\-Action $\ast$ {\bf insert} (const {\bf QString} \&s\-Name, const {\bf QString} \&s\-Label)
\item 
bool {\bf update\-Connections} ()
\item 
const {\bf KShortcut} \& {\bf shortcut} (const {\bf QString} \&s\-Action) const 
\item 
bool {\bf set\-Shortcut} (const {\bf QString} \&s\-Action, const {\bf KShortcut} \&shortcut)
\item 
bool {\bf set\-Slot} (const {\bf QString} \&s\-Action, const {\bf QObject} $\ast$p\-Obj\-Slot, const char $\ast$ps\-Method\-Slot)
\item 
bool {\bf set\-Action\-Enabled} (const {\bf QString} \&s\-Action, bool b\-Enable)
\item 
{\bf QString} {\bf label} (const {\bf QString} \&s\-Action) const 
\item 
const {\bf QString} \& {\bf config\-Group} () const 
\item 
void {\bf set\-Config\-Group} (const {\bf QString} \&cg)
\item 
bool {\bf read\-Settings} ({\bf KConfig\-Base} $\ast$p\-Config=0)
\item 
bool {\bf write\-Settings} ({\bf KConfig\-Base} $\ast$p\-Config=0) const 
\item 
bool {\bf write\-Settings} ({\bf KConfig\-Base} $\ast$p\-Config, bool b\-Global) const 
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static bool {\bf use\-Four\-Modifier\-Keys} ()\label{classKGlobalAccel_e0}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKGlobalAccel_b0}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KGlobal\-Accel\-Private}\label{classKGlobalAccel_n0}

\item 
class {\bf KAccel\-Shortcut\-List}\label{classKGlobalAccel_n1}

\end{CompactItemize}


\subsection{Detailed Description}
KGlobal\-Accel allows you to have global accelerators that are independent of the focused window. Configurable global shortcut support. 

Unlike {\bf KAccel}{\rm (p.\,\pageref{classKAccel})} it does not matter which window is currently active.

\begin{Desc}
\item[See also:]{\bf KAccel}{\rm (p.\,\pageref{classKAccel})} 

{\bf KAccel\-Shortcut\-List}{\rm (p.\,\pageref{classKAccelShortcutList})} 

{\bf KKey\-Chooser} 

{\bf KKey\-Dialog} \end{Desc}




Definition at line 45 of file kglobalaccel.h.

\subsection{Constructor \& Destructor Documentation}
\index{KGlobalAccel@{KGlobal\-Accel}!KGlobalAccel@{KGlobalAccel}}
\index{KGlobalAccel@{KGlobalAccel}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KGlobal\-Accel::KGlobal\-Accel ({\bf QObject} $\ast$ {\em p\-Parent}, const char $\ast$ {\em ps\-Name} = {\tt 0})}\label{classKGlobalAccel_a0}


Creates a new KGlobal\-Accel object with the given p\-Parent and ps\-Name. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em p\-Parent}]the parent of the {\bf QObject} \item[{\em ps\-Name}]the name of the {\bf QObject}\end{description}
\end{Desc}


Definition at line 39 of file kglobalaccel.cpp.

References endl().

\subsection{Member Function Documentation}
\index{KGlobalAccel@{KGlobal\-Accel}!isEnabled@{isEnabled}}
\index{isEnabled@{isEnabled}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KGlobal\-Accel::is\-Enabled ()}\label{classKGlobalAccel_a2}


Checks whether the accelerators are enabled. 

\begin{Desc}
\item[Returns:]true if the KGlobal\-Accel is enabled\end{Desc}


Definition at line 62 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!setEnabled@{setEnabled}}
\index{setEnabled@{setEnabled}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KGlobal\-Accel::set\-Enabled (bool {\em b\-Enabled})}\label{classKGlobalAccel_a3}


Enables or disables the KGlobal\-Accel. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em b\-Enabled}]true if the KGlobal\-Accel should be enabled, false if it should be disabled.\end{description}
\end{Desc}


Definition at line 65 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!insert@{insert}}
\index{insert@{insert}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAccel\-Action $\ast$ KGlobal\-Accel::insert (const {\bf QString} \& {\em s\-Action}, const {\bf QString} \& {\em s\-Label}, const {\bf QString} \& {\em s\-Whats\-This}, const {\bf KShortcut} \& {\em cut\-Def3}, const {\bf KShortcut} \& {\em cut\-Def4}, const {\bf QObject} $\ast$ {\em p\-Obj\-Slot}, const char $\ast$ {\em ps\-Method\-Slot}, bool {\em b\-Configurable} = {\tt true}, bool {\em b\-Enabled} = {\tt true})}\label{classKGlobalAccel_a4}


Create an accelerator action. 

Usage: 

\footnotesize\begin{verbatim} insert( "Do Something", i18n("Do Something"),
   i18n("This action allows you to do something really great with this program to "
        "the currently open document."),
   ALT+CTRL+Key_Q, KKey::QtWIN+CTRL+Key_Q, this, SLOT(slotDoSomething()) );
     *
\end{verbatim}
\normalsize


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Action}]The internal name of the action. \item[{\em s\-Label}]An i18n'ized short description of the action displayed when using {\bf KKey\-Chooser} to reconfigure the shortcuts. \item[{\em s\-Whats\-This}]An extended description of the action. \item[{\em cut\-Def3}]The default 3 modifier scheme shortcut. \item[{\em cut\-Def4}]The default 4 modifier scheme shortcut. \item[{\em p\-Obj\-Slot}]Pointer to the slot object. \item[{\em ps\-Method\-Slot}]Pointer to the slot method. \item[{\em b\-Configurable}]Allow the user to change this shortcut if set to 'true'. \item[{\em b\-Enabled}]The action will be activated by the shortcut if set to 'true'.\end{description}
\end{Desc}


Definition at line 68 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!remove@{remove}}
\index{remove@{remove}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KGlobal\-Accel::remove (const {\bf QString} \& {\em s\-Action})}\label{classKGlobalAccel_a5}


Removes the accelerator action identified by the name. 

Remember to also call {\bf update\-Connections()}{\rm (p.\,\pageref{classKGlobalAccel_a7})}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Action}]the name of the action to remove \end{description}
\end{Desc}
\begin{Desc}
\item[Since:]3.1\end{Desc}


Definition at line 84 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!insert@{insert}}
\index{insert@{insert}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAccel\-Action $\ast$ KGlobal\-Accel::insert (const {\bf QString} \& {\em s\-Name}, const {\bf QString} \& {\em s\-Label})}\label{classKGlobalAccel_a6}


Use this to insert a label into the action list. 

This will be displayed when the user configures shortcuts. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Name}]of the of the action to insert \item[{\em s\-Label}]a user-readable (i18n!) name for the action \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the KAccel\-Action of the action\end{Desc}


Definition at line 79 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!updateConnections@{updateConnections}}
\index{updateConnections@{updateConnections}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KGlobal\-Accel::update\-Connections ()}\label{classKGlobalAccel_a7}


Updates the connections of the accelerations after changing them. 

\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 81 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!shortcut@{shortcut}}
\index{shortcut@{shortcut}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf KShortcut} \& KGlobal\-Accel::shortcut (const {\bf QString} \& {\em s\-Action}) const}\label{classKGlobalAccel_a8}


Return the shortcut associated with the action named by {\tt s\-Action}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Action}]the name of the action \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the shortcut. If the action does not exist a null shortcut will be returned.\end{Desc}


Definition at line 87 of file kglobalaccel.cpp.

References KShortcut::null().\index{KGlobalAccel@{KGlobal\-Accel}!setShortcut@{setShortcut}}
\index{setShortcut@{setShortcut}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KGlobal\-Accel::set\-Shortcut (const {\bf QString} \& {\em s\-Action}, const {\bf KShortcut} \& {\em shortcut})}\label{classKGlobalAccel_a9}


Set the shortcut to be associated with the action named by {\tt s\-Action}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Action}]the name of the action \item[{\em shortcut}]the shortcut for the action \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 93 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!setSlot@{setSlot}}
\index{setSlot@{setSlot}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KGlobal\-Accel::set\-Slot (const {\bf QString} \& {\em s\-Action}, const {\bf QObject} $\ast$ {\em p\-Obj\-Slot}, const char $\ast$ {\em ps\-Method\-Slot})}\label{classKGlobalAccel_a10}


Set the slot to be called when the shortcut of the action named by {\tt s\-Action} is pressed. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Action}]the name of the action \item[{\em p\-Obj\-Slot}]the receiver of the signal \item[{\em ps\-Method\-Slot}]the slot to receive the signal \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 95 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!setActionEnabled@{setActionEnabled}}
\index{setActionEnabled@{setActionEnabled}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KGlobal\-Accel::set\-Action\-Enabled (const {\bf QString} \& {\em s\-Action}, bool {\em b\-Enable})}\label{classKGlobalAccel_a11}


Enables or disables action {\tt s\-Action}. 

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


Definition at line 102 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!label@{label}}
\index{label@{label}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KGlobal\-Accel::label (const {\bf QString} \& {\em s\-Action}) const}\label{classKGlobalAccel_a12}


Return the label (i18n'ized short description) associated with the action named by {\tt s\-Action}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Action}]the name of the action \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the label \end{Desc}
\begin{Desc}
\item[Since:]3.3\end{Desc}


Definition at line 97 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!configGroup@{configGroup}}
\index{configGroup@{configGroup}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QString} \& KGlobal\-Accel::config\-Group () const}\label{classKGlobalAccel_a13}


Returns the configuration group that is used to save the accelerators. 

\begin{Desc}
\item[Returns:]the configuration group \end{Desc}
\begin{Desc}
\item[See also:]{\bf KConfig}{\rm (p.\,\pageref{classKConfig})}\end{Desc}


Definition at line 107 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!setConfigGroup@{setConfigGroup}}
\index{setConfigGroup@{setConfigGroup}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KGlobal\-Accel::set\-Config\-Group (const {\bf QString} \& {\em cg})}\label{classKGlobalAccel_a14}


Sets the configuration group that is used to save the accelerators. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cg}]the configuration group \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf KConfig}{\rm (p.\,\pageref{classKConfig})}\end{Desc}


Definition at line 110 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!readSettings@{readSettings}}
\index{readSettings@{readSettings}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KGlobal\-Accel::read\-Settings ({\bf KConfig\-Base} $\ast$ {\em p\-Config} = {\tt 0})}\label{classKGlobalAccel_a15}


Read all shortcuts from {\tt p\-Config}, or (if {\tt p\-Config} is zero) from the application's configuration file {\bf KGlobal::config()}{\rm (p.\,\pageref{classKGlobal_e2})}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em p\-Config}]the configuration file to read from, or 0 for the application configuration file \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 113 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!writeSettings@{writeSettings}}
\index{writeSettings@{writeSettings}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KGlobal\-Accel::write\-Settings ({\bf KConfig\-Base} $\ast$ {\em p\-Config} = {\tt 0}) const}\label{classKGlobalAccel_a16}


Write the current shortcuts to {\tt p\-Config}, or (if {\tt p\-Config} is zero) to the application's configuration file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em p\-Config}]the configuration file to read from, or 0 for the application configuration file \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise \end{Desc}
\begin{Desc}
\item[Since:]3.1\end{Desc}


Definition at line 115 of file kglobalaccel.cpp.\index{KGlobalAccel@{KGlobal\-Accel}!writeSettings@{writeSettings}}
\index{writeSettings@{writeSettings}!KGlobalAccel@{KGlobal\-Accel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KGlobal\-Accel::write\-Settings ({\bf KConfig\-Base} $\ast$ {\em p\-Config}, bool {\em b\-Global}) const}\label{classKGlobalAccel_a17}


Write the current shortcuts to {\tt p\-Config}, or (if {\tt p\-Config} is zero) to the application's configuration file. 

Alternatively, if b\-Global is true, then write to kdeglobals. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em p\-Config}]the configuration file to read from, or 0 for the application configuration file \item[{\em b\-Global}]if true write the configuration to the kde global settings \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 117 of file kglobalaccel.cpp.

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