\section{KShortcut\-List Class Reference}
\label{classKShortcutList}\index{KShortcutList@{KShortcutList}}
KShortcut\-List is an abstract base class for {\bf KAccel\-Shortcut\-List}{\rm (p.\,\pageref{classKAccelShortcutList})} and {\bf KStd\-Accel::Shortcut\-List}{\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList})}. Base class for accessing accelerator lists.  


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

Inheritance diagram for KShortcut\-List:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=142pt]{classKShortcutList__inherit__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Other} 
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KShortcut\-List} ()
\begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 
virtual unsigned int {\bf count} () const =0
\begin{CompactList}\small\item\em Returns the number of entries. \item\end{CompactList}\item 
virtual {\bf QString} {\bf name} (unsigned int index) const =0
\begin{CompactList}\small\item\em Returns the name of the shortcut with the given {\tt index}. \item\end{CompactList}\item 
virtual {\bf QString} {\bf label} (unsigned int index) const =0
\begin{CompactList}\small\item\em Returns the (i18n'd) label of the shortcut with the given {\tt index}. \item\end{CompactList}\item 
virtual {\bf QString} {\bf whats\-This} (unsigned int index) const =0
\begin{CompactList}\small\item\em Returns the (i18n'd) What's This text of the shortcut with the given {\tt index}. \item\end{CompactList}\item 
virtual const  KShortcut \& {\bf shortcut} (unsigned int index) const =0
\begin{CompactList}\small\item\em Returns the shortcut with the given {\tt index}. \item\end{CompactList}\item 
virtual const  KShortcut \& {\bf shortcut\-Default} (unsigned int index) const =0
\begin{CompactList}\small\item\em Returns default shortcut with the given {\tt index}. \item\end{CompactList}\item 
virtual bool {\bf is\-Configurable} (unsigned int index) const =0
\begin{CompactList}\small\item\em Checks whether the shortcut with the given {\tt index} is configurable. \item\end{CompactList}\item 
virtual bool {\bf set\-Shortcut} (unsigned int index, const  KShortcut \&shortcut)=0
\begin{CompactList}\small\item\em Sets the shortcut of the given entry. \item\end{CompactList}\item 
virtual bool {\bf is\-Global} (unsigned int index) const 
\begin{CompactList}\small\item\em Checks whether the shortcut with the given {\tt index} is saved in the global configuration. \item\end{CompactList}\item 
virtual int {\bf index} (const  {\bf QString} \&s\-Name) const 
\begin{CompactList}\small\item\em Returns the index of the shortcut with he given name. \item\end{CompactList}\item 
virtual int {\bf index} (const  {\bf KKey\-Sequence} \&key\-Seq) const 
\begin{CompactList}\small\item\em Returns the index of the shortcut with he given key sequence. \item\end{CompactList}\item 
virtual const  {\bf KInstance} $\ast$ {\bf instance} () const 
\begin{CompactList}\small\item\em The {\bf KInstance}{\rm (p.\,\pageref{classKInstance})}. \item\end{CompactList}\item 
virtual {\bf QVariant} {\bf get\-Other} (Other, unsigned int index) const =0\label{classKShortcutList_a14}

\item 
virtual bool {\bf set\-Other} (Other, unsigned int index, {\bf QVariant})=0\label{classKShortcutList_a15}

\item 
virtual bool {\bf save} () const =0
\begin{CompactList}\small\item\em Save the shortcut list. \item\end{CompactList}\item 
virtual bool {\bf read\-Settings} (const  {\bf QString} \&s\-Config\-Group=QString::null, {\bf KConfig\-Base} $\ast$p\-Config=0)
\begin{CompactList}\small\item\em Loads the shortcuts from the given configuration file. \item\end{CompactList}\item 
virtual bool {\bf write\-Settings} (const  {\bf QString} \&s\-Config\-Group=QString::null, {\bf KConfig\-Base} $\ast$p\-Config=0, bool b\-Write\-All=false, bool b\-Global=false) const 
\begin{CompactList}\small\item\em Writes the shortcuts to the given configuration file. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)
\begin{CompactList}\small\item\em used to extend the interface with virtuals without breaking binary compatibility \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
KShortcut\-List is an abstract base class for {\bf KAccel\-Shortcut\-List}{\rm (p.\,\pageref{classKAccelShortcutList})} and {\bf KStd\-Accel::Shortcut\-List}{\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList})}. Base class for accessing accelerator lists. 

It gives you an unified interface for accessing the accelerator lists of {\bf KAccel}{\rm (p.\,\pageref{classKAccel})} (using ), {\bf KGlobal\-Accel}{\rm (p.\,\pageref{classKGlobalAccel})} (using ), and {\bf KStd\-Accel}{\rm (p.\,\pageref{namespaceKStdAccel})} (using {\bf KStd\-Accel::Shortcut\-List}{\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList})}).



Definition at line 45 of file kshortcutlist.h.

\subsection{Constructor \& Destructor Documentation}
\index{KShortcutList@{KShortcut\-List}!KShortcutList@{KShortcutList}}
\index{KShortcutList@{KShortcutList}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KShortcut\-List::KShortcut\-List ()}\label{classKShortcutList_a0}


Default constructor. 



Definition at line 18 of file kshortcutlist.cpp.

\subsection{Member Function Documentation}
\index{KShortcutList@{KShortcut\-List}!count@{count}}
\index{count@{count}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual unsigned int KShortcut\-List::count () const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKShortcutList_a2}


Returns the number of entries. 

\begin{Desc}
\item[Returns:]the number of entries\end{Desc}


Implemented in {\bf KAccel\-Shortcut\-List} {\rm (p.\,\pageref{classKAccelShortcutList_a4})}, and {\bf KStd\-Accel::Shortcut\-List} {\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList_a2})}.

Referenced by index(), read\-Settings(), and write\-Settings().\index{KShortcutList@{KShortcut\-List}!name@{name}}
\index{name@{name}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KShortcut\-List::name (unsigned int {\em index}) const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKShortcutList_a3}


Returns the name of the shortcut with the given {\tt index}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em index}]the index of the shortcut (must be $<$ {\bf count}{\rm (p.\,\pageref{classKShortcutList_a2})}()) \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the name of the shortcut\end{Desc}


Implemented in {\bf KAccel\-Shortcut\-List} {\rm (p.\,\pageref{classKAccelShortcutList_a5})}, and {\bf KStd\-Accel::Shortcut\-List} {\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList_a3})}.

Referenced by read\-Settings(), and write\-Settings().\index{KShortcutList@{KShortcut\-List}!label@{label}}
\index{label@{label}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KShortcut\-List::label (unsigned int {\em index}) const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKShortcutList_a4}


Returns the (i18n'd) label of the shortcut with the given {\tt index}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em index}]the index of the shortcut (must be $<$ {\bf count}{\rm (p.\,\pageref{classKShortcutList_a2})}()) \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the label (i18n'd) of the shortcut\end{Desc}


Implemented in {\bf KAccel\-Shortcut\-List} {\rm (p.\,\pageref{classKAccelShortcutList_a6})}, and {\bf KStd\-Accel::Shortcut\-List} {\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList_a4})}.\index{KShortcutList@{KShortcut\-List}!whatsThis@{whatsThis}}
\index{whatsThis@{whatsThis}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KShortcut\-List::whats\-This (unsigned int {\em index}) const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKShortcutList_a5}


Returns the (i18n'd) What's This text of the shortcut with the given {\tt index}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em index}]the index of the shortcut (must be $<$ {\bf count}{\rm (p.\,\pageref{classKShortcutList_a2})}()) \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the What's This text (i18n'd) of the shortcut\end{Desc}


Implemented in {\bf KAccel\-Shortcut\-List} {\rm (p.\,\pageref{classKAccelShortcutList_a7})}, and {\bf KStd\-Accel::Shortcut\-List} {\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList_a5})}.\index{KShortcutList@{KShortcut\-List}!shortcut@{shortcut}}
\index{shortcut@{shortcut}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual const KShortcut\& KShortcut\-List::shortcut (unsigned int {\em index}) const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKShortcutList_a6}


Returns the shortcut with the given {\tt index}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em index}]the index of the shortcut (must be $<$ {\bf count}{\rm (p.\,\pageref{classKShortcutList_a2})}()) \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the shortcut \end{Desc}
\begin{Desc}
\item[See also:]{\bf shortcut\-Default()}{\rm (p.\,\pageref{classKShortcutList_a7})}\end{Desc}


Implemented in {\bf KAccel\-Shortcut\-List} {\rm (p.\,\pageref{classKAccelShortcutList_a8})}, and {\bf KStd\-Accel::Shortcut\-List} {\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList_a6})}.

Referenced by index(), and write\-Settings().\index{KShortcutList@{KShortcut\-List}!shortcutDefault@{shortcutDefault}}
\index{shortcutDefault@{shortcutDefault}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual const KShortcut\& KShortcut\-List::shortcut\-Default (unsigned int {\em index}) const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKShortcutList_a7}


Returns default shortcut with the given {\tt index}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em index}]the index of the shortcut (must be $<$ {\bf count}{\rm (p.\,\pageref{classKShortcutList_a2})}()) \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the default shortcut \end{Desc}
\begin{Desc}
\item[See also:]{\bf shortcut()}{\rm (p.\,\pageref{classKShortcutList_a6})}\end{Desc}


Implemented in {\bf KAccel\-Shortcut\-List} {\rm (p.\,\pageref{classKAccelShortcutList_a9})}, and {\bf KStd\-Accel::Shortcut\-List} {\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList_a7})}.

Referenced by read\-Settings(), and write\-Settings().\index{KShortcutList@{KShortcut\-List}!isConfigurable@{isConfigurable}}
\index{isConfigurable@{isConfigurable}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KShortcut\-List::is\-Configurable (unsigned int {\em index}) const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKShortcutList_a8}


Checks whether the shortcut with the given {\tt index} is configurable. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em index}]the index of the shortcut (must be $<$ {\bf count}{\rm (p.\,\pageref{classKShortcutList_a2})}()) \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if configurable, false otherwise\end{Desc}


Implemented in {\bf KAccel\-Shortcut\-List} {\rm (p.\,\pageref{classKAccelShortcutList_a10})}, and {\bf KStd\-Accel::Shortcut\-List} {\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList_a8})}.

Referenced by read\-Settings(), and write\-Settings().\index{KShortcutList@{KShortcut\-List}!setShortcut@{setShortcut}}
\index{setShortcut@{setShortcut}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KShortcut\-List::set\-Shortcut (unsigned int {\em index}, const KShortcut \& {\em shortcut})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKShortcutList_a9}


Sets the shortcut of the given entry. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em index}]the index of the shortcut (must be $<$ {\bf count}{\rm (p.\,\pageref{classKShortcutList_a2})}()) \item[{\em shortcut}]the shortcut\end{description}
\end{Desc}


Implemented in {\bf KAccel\-Shortcut\-List} {\rm (p.\,\pageref{classKAccelShortcutList_a11})}, and {\bf KStd\-Accel::Shortcut\-List} {\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList_a9})}.

Referenced by read\-Settings().\index{KShortcutList@{KShortcut\-List}!isGlobal@{isGlobal}}
\index{isGlobal@{isGlobal}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KShortcut\-List::is\-Global (unsigned int {\em index}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKShortcutList_a10}


Checks whether the shortcut with the given {\tt index} is saved in the global configuration. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em index}]the index of the shortcut (must be $<$ {\bf count}{\rm (p.\,\pageref{classKShortcutList_a2})}()) \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if global, false otherwise\end{Desc}


Reimplemented in {\bf KAccel\-Shortcut\-List} {\rm (p.\,\pageref{classKAccelShortcutList_a12})}.\index{KShortcutList@{KShortcut\-List}!index@{index}}
\index{index@{index}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KShortcut\-List::index (const {\bf QString} \& {\em s\-Name}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKShortcutList_a11}


Returns the index of the shortcut with he given name. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Name}]the name of the shortcut to search \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the index of the shortcut, of -1 if not found\end{Desc}


Definition at line 32 of file kshortcutlist.cpp.\index{KShortcutList@{KShortcut\-List}!index@{index}}
\index{index@{index}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KShortcut\-List::index (const {\bf KKey\-Sequence} \& {\em key\-Seq}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKShortcutList_a12}


Returns the index of the shortcut with he given key sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the key sequence to search for \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the index of the shortcut, of -1 if not found\end{Desc}


Definition at line 37 of file kshortcutlist.cpp.

References count(), KKey\-Sequence::is\-Null(), and shortcut().\index{KShortcutList@{KShortcut\-List}!instance@{instance}}
\index{instance@{instance}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const  {\bf KInstance} $\ast$ KShortcut\-List::instance () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKShortcutList_a13}


The {\bf KInstance}{\rm (p.\,\pageref{classKInstance})}. 

\begin{Desc}
\item[Returns:]the {\bf KInstance}{\rm (p.\,\pageref{classKInstance})} of the list, can be 0 if not available\end{Desc}


Definition at line 51 of file kshortcutlist.cpp.\index{KShortcutList@{KShortcut\-List}!save@{save}}
\index{save@{save}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool KShortcut\-List::save () const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKShortcutList_a16}


Save the shortcut list. 

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


Implemented in {\bf KAccel\-Shortcut\-List} {\rm (p.\,\pageref{classKAccelShortcutList_a15})}, and {\bf KStd\-Accel::Shortcut\-List} {\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList_a12})}.\index{KShortcutList@{KShortcut\-List}!readSettings@{readSettings}}
\index{readSettings@{readSettings}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut\-List::read\-Settings (const {\bf QString} \& {\em s\-Config\-Group} = QString::null, {\bf KConfig\-Base} $\ast$ {\em p\-Config} = 0)\hspace{0.3cm}{\tt  [virtual]}}\label{classKShortcutList_a17}


Loads the shortcuts from the given configuration file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Config\-Group}]the group in the configuration file \item[{\em p\-Config}]the configuration file to load from \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 66 of file kshortcutlist.cpp.

References KGlobal::config(), count(), KConfig\-Base::has\-Group(), is\-Configurable(), QString::is\-Empty(), name(), KConfig\-Base::read\-Entry(), set\-Shortcut(), and shortcut\-Default().\index{KShortcutList@{KShortcut\-List}!writeSettings@{writeSettings}}
\index{writeSettings@{writeSettings}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut\-List::write\-Settings (const {\bf QString} \& {\em s\-Config\-Group} = QString::null, {\bf KConfig\-Base} $\ast$ {\em p\-Config} = 0, bool {\em b\-Write\-All} = false, bool {\em b\-Global} = false) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKShortcutList_a18}


Writes the shortcuts to the given configuration file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Config\-Group}]the group in the configuration file \item[{\em p\-Config}]the configuration file to save to \item[{\em b\-Write\-All}]true to write all actions \item[{\em b\-Global}]true to write to the global configuration file \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 104 of file kshortcutlist.cpp.

References KGlobal::config(), count(), KConfig\-Base::delete\-Entry(), KConfig\-Base::delete\-Group(), KConfig\-Base::has\-Group(), is\-Configurable(), QString::is\-Empty(), name(), KConfig\-Base::read\-Entry(), shortcut(), shortcut\-Default(), KConfig\-Base::sync(), and KConfig\-Base::write\-Entry().

Referenced by KStd\-Accel::Shortcut\-List::save(), and KAccel\-Shortcut\-List::save().\index{KShortcutList@{KShortcut\-List}!virtual_hook@{virtual\_\-hook}}
\index{virtual_hook@{virtual\_\-hook}!KShortcutList@{KShortcut\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KShortcut\-List::virtual\_\-hook (int {\em id}, void $\ast$ {\em data})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKShortcutList_b0}


used to extend the interface with virtuals without breaking binary compatibility 



Reimplemented in {\bf KAccel\-Shortcut\-List} {\rm (p.\,\pageref{classKAccelShortcutList_b0})}, and {\bf KStd\-Accel::Shortcut\-List} {\rm (p.\,\pageref{classKStdAccel_1_1ShortcutList_b0})}.

Definition at line 196 of file kshortcutlist.cpp.

Referenced by KStd\-Accel::Shortcut\-List::virtual\_\-hook(), and KAccel\-Shortcut\-List::virtual\_\-hook().

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