\section{KRecent\-Files\-Action Class Reference}
\label{classKRecentFilesAction}\index{KRecentFilesAction@{KRecentFilesAction}}
This class is an action to handle a recent files submenu. Recent files action.  


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

Inheritance diagram for KRecent\-Files\-Action:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=72pt]{classKRecentFilesAction__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KRecent\-Files\-Action:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=118pt]{classKRecentFilesAction__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf set\-Max\-Items} (uint max\-Items)
\begin{CompactList}\small\item\em Sets the maximum of items in the recent files list. \item\end{CompactList}\item 
void {\bf load\-Entries} ({\bf KConfig} $\ast$config, {\bf QString} groupname=QString::null)
\begin{CompactList}\small\item\em Loads the recent files entries from a given {\bf KConfig} object. \item\end{CompactList}\item 
void {\bf save\-Entries} ({\bf KConfig} $\ast$config, {\bf QString} groupname=QString::null)
\begin{CompactList}\small\item\em Saves the current recent files entries to a given {\bf KConfig} object. \item\end{CompactList}\item 
void {\bf add\-URL} (const  {\bf KURL} \&url)
\begin{CompactList}\small\item\em Add URL to recent files list. \item\end{CompactList}\item 
void {\bf remove\-URL} (const  {\bf KURL} \&url)
\begin{CompactList}\small\item\em Remove an URL from the recent files list. \item\end{CompactList}\item 
void {\bf clear\-URLList} ()
\begin{CompactList}\small\item\em Removes all entries from the recent files list. \item\end{CompactList}\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf url\-Selected} (const  {\bf KURL} \&url)
\begin{CompactList}\small\item\em This signal gets emited when the user selects an URL. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KRecent\-Files\-Action} (const  {\bf QString} \&text, const  KShortcut \&cut, {\bf QObject} $\ast${\bf parent}, const  char $\ast${\bf name}=0, uint max\-Items=10)
\item 
{\bf KRecent\-Files\-Action} (const  {\bf QString} \&text, const  KShortcut \&cut, const  {\bf QObject} $\ast$receiver, const  char $\ast$slot, {\bf QObject} $\ast${\bf parent}, const  char $\ast${\bf name}=0, uint max\-Items=10)
\item 
{\bf KRecent\-Files\-Action} (const  {\bf QString} \&text, const  {\bf QIcon\-Set} \&pix, const  KShortcut \&cut, {\bf QObject} $\ast${\bf parent}, const  char $\ast${\bf name}=0, uint max\-Items=10)
\item 
{\bf KRecent\-Files\-Action} (const  {\bf QString} \&text, const  {\bf QString} \&pix, const  KShortcut \&cut, {\bf QObject} $\ast${\bf parent}, const  char $\ast${\bf name}=0, uint max\-Items=10)
\item 
{\bf KRecent\-Files\-Action} (const  {\bf QString} \&text, const  {\bf QIcon\-Set} \&pix, const  KShortcut \&cut, const  {\bf QObject} $\ast$receiver, const  char $\ast$slot, {\bf QObject} $\ast${\bf parent}, const  char $\ast${\bf name}=0, uint max\-Items=10)
\item 
{\bf KRecent\-Files\-Action} (const  {\bf QString} \&text, const  {\bf QString} \&pix, const  KShortcut \&cut, const  {\bf QObject} $\ast$receiver, const  char $\ast$slot, {\bf QObject} $\ast${\bf parent}, const  char $\ast${\bf name}=0, uint max\-Items=10)
\item 
{\bf KRecent\-Files\-Action} ({\bf QObject} $\ast${\bf parent}=0, const  char $\ast${\bf name}=0, uint max\-Items=10)
\item 
virtual {\bf $\sim$KRecent\-Files\-Action} ()
\begin{CompactList}\small\item\em Destructor. \item\end{CompactList}\item 
uint {\bf max\-Items} () const 
\begin{CompactList}\small\item\em Returns the maximum of items in the recent files list. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
void {\bf item\-Selected} (const  {\bf QString} \&string)\label{classKRecentFilesAction_j0}

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

\end{CompactItemize}


\subsection{Detailed Description}
This class is an action to handle a recent files submenu. Recent files action. 

The best way to create the action is to use {\bf KStd\-Action::open\-Recent}{\rm (p.\,\pageref{namespaceKStdAction_a67})}. Then you simply need to call {\bf load\-Entries}{\rm (p.\,\pageref{classKRecentFilesAction_i1})} on startup, {\bf save\-Entries}{\rm (p.\,\pageref{classKRecentFilesAction_i2})} on shutdown, {\bf add\-URL}{\rm (p.\,\pageref{classKRecentFilesAction_i3})} when your application loads/saves a file.

\begin{Desc}
\item[Author:]Michael Koch \end{Desc}




Definition at line 1188 of file kaction.h.

\subsection{Constructor \& Destructor Documentation}
\index{KRecentFilesAction@{KRecent\-Files\-Action}!KRecentFilesAction@{KRecentFilesAction}}
\index{KRecentFilesAction@{KRecentFilesAction}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRecent\-Files\-Action::KRecent\-Files\-Action (const {\bf QString} \& {\em text}, const KShortcut \& {\em cut}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = 0, uint {\em max\-Items} = 10)}\label{classKRecentFilesAction_a0}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The text that will be displayed. \item[{\em cut}]The corresponding keyboard accelerator (shortcut). \item[{\em parent}]This action's parent. \item[{\em name}]An internal name for this action. \item[{\em max\-Items}]The maximum number of files to display \end{description}
\end{Desc}


Definition at line 2013 of file kaction.cpp.

References KStd\-Accel::cut(), max\-Items(), and KStd\-Accel::name().\index{KRecentFilesAction@{KRecent\-Files\-Action}!KRecentFilesAction@{KRecentFilesAction}}
\index{KRecentFilesAction@{KRecentFilesAction}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRecent\-Files\-Action::KRecent\-Files\-Action (const {\bf QString} \& {\em text}, const KShortcut \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = 0, uint {\em max\-Items} = 10)}\label{classKRecentFilesAction_a1}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The text that will be displayed. \item[{\em cut}]The corresponding keyboard accelerator (shortcut). \item[{\em receiver}]The SLOT's parent. \item[{\em slot}]The SLOT to invoke when a URL is selected. Its signature is of the form slot\-URLSelected( const KURL \& ). \item[{\em parent}]This action's parent. \item[{\em name}]An internal name for this action. \item[{\em max\-Items}]The maximum number of files to display \end{description}
\end{Desc}


Definition at line 2025 of file kaction.cpp.

References QObject::connect(), KStd\-Accel::cut(), max\-Items(), KStd\-Accel::name(), and url\-Selected().\index{KRecentFilesAction@{KRecent\-Files\-Action}!KRecentFilesAction@{KRecentFilesAction}}
\index{KRecentFilesAction@{KRecentFilesAction}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRecent\-Files\-Action::KRecent\-Files\-Action (const {\bf QString} \& {\em text}, const {\bf QIcon\-Set} \& {\em pix}, const KShortcut \& {\em cut}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = 0, uint {\em max\-Items} = 10)}\label{classKRecentFilesAction_a2}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The text that will be displayed. \item[{\em pix}]The icons that go with this action. \item[{\em cut}]The corresponding keyboard accelerator (shortcut). \item[{\em parent}]This action's parent. \item[{\em name}]An internal name for this action. \item[{\em max\-Items}]The maximum number of files to display \end{description}
\end{Desc}


Definition at line 2043 of file kaction.cpp.

References KStd\-Accel::cut(), max\-Items(), and KStd\-Accel::name().\index{KRecentFilesAction@{KRecent\-Files\-Action}!KRecentFilesAction@{KRecentFilesAction}}
\index{KRecentFilesAction@{KRecentFilesAction}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRecent\-Files\-Action::KRecent\-Files\-Action (const {\bf QString} \& {\em text}, const {\bf QString} \& {\em pix}, const KShortcut \& {\em cut}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = 0, uint {\em max\-Items} = 10)}\label{classKRecentFilesAction_a3}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The text that will be displayed. \item[{\em pix}]The dynamically loaded icon that goes with this action. \item[{\em cut}]The corresponding keyboard accelerator (shortcut). \item[{\em parent}]This action's parent. \item[{\em name}]An internal name for this action. \item[{\em max\-Items}]The maximum number of files to display \end{description}
\end{Desc}


Definition at line 2056 of file kaction.cpp.

References KStd\-Accel::cut(), max\-Items(), and KStd\-Accel::name().\index{KRecentFilesAction@{KRecent\-Files\-Action}!KRecentFilesAction@{KRecentFilesAction}}
\index{KRecentFilesAction@{KRecentFilesAction}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRecent\-Files\-Action::KRecent\-Files\-Action (const {\bf QString} \& {\em text}, const {\bf QIcon\-Set} \& {\em pix}, const KShortcut \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = 0, uint {\em max\-Items} = 10)}\label{classKRecentFilesAction_a4}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The text that will be displayed. \item[{\em pix}]The icons that go with this action. \item[{\em cut}]The corresponding keyboard accelerator (shortcut). \item[{\em receiver}]The SLOT's parent. \item[{\em slot}]The SLOT to invoke when a URL is selected. Its signature is of the form slot\-URLSelected( const KURL \& ). \item[{\em parent}]This action's parent. \item[{\em name}]An internal name for this action. \item[{\em max\-Items}]The maximum number of files to display \end{description}
\end{Desc}


Definition at line 2069 of file kaction.cpp.

References QObject::connect(), KStd\-Accel::cut(), max\-Items(), KStd\-Accel::name(), and url\-Selected().\index{KRecentFilesAction@{KRecent\-Files\-Action}!KRecentFilesAction@{KRecentFilesAction}}
\index{KRecentFilesAction@{KRecentFilesAction}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRecent\-Files\-Action::KRecent\-Files\-Action (const {\bf QString} \& {\em text}, const {\bf QString} \& {\em pix}, const KShortcut \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = 0, uint {\em max\-Items} = 10)}\label{classKRecentFilesAction_a5}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The text that will be displayed. \item[{\em pix}]The dynamically loaded icon that goes with this action. \item[{\em cut}]The corresponding keyboard accelerator (shortcut). \item[{\em receiver}]The SLOT's parent. \item[{\em slot}]The SLOT to invoke when a URL is selected. Its signature is of the form slot\-URLSelected( const KURL \& ). \item[{\em parent}]This action's parent. \item[{\em name}]An internal name for this action. \item[{\em max\-Items}]The maximum number of files to display \end{description}
\end{Desc}


Definition at line 2088 of file kaction.cpp.

References QObject::connect(), KStd\-Accel::cut(), max\-Items(), KStd\-Accel::name(), and url\-Selected().\index{KRecentFilesAction@{KRecent\-Files\-Action}!KRecentFilesAction@{KRecentFilesAction}}
\index{KRecentFilesAction@{KRecentFilesAction}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRecent\-Files\-Action::KRecent\-Files\-Action ({\bf QObject} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 0, uint {\em max\-Items} = 10)}\label{classKRecentFilesAction_a6}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]This action's parent. \item[{\em name}]An internal name for this action. \item[{\em max\-Items}]The maximum number of files to display \end{description}
\end{Desc}


Definition at line 2107 of file kaction.cpp.

References max\-Items(), and KStd\-Accel::name().\index{KRecentFilesAction@{KRecent\-Files\-Action}!~KRecentFilesAction@{$\sim$KRecentFilesAction}}
\index{~KRecentFilesAction@{$\sim$KRecentFilesAction}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRecent\-Files\-Action::$\sim${\bf KRecent\-Files\-Action} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKRecentFilesAction_a7}


Destructor. 



Definition at line 2125 of file kaction.cpp.

\subsection{Member Function Documentation}
\index{KRecentFilesAction@{KRecent\-Files\-Action}!maxItems@{maxItems}}
\index{maxItems@{maxItems}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint KRecent\-Files\-Action::max\-Items () const}\label{classKRecentFilesAction_a8}


Returns the maximum of items in the recent files list. 



Definition at line 2130 of file kaction.cpp.

Referenced by KRecent\-Files\-Action().\index{KRecentFilesAction@{KRecent\-Files\-Action}!setMaxItems@{setMaxItems}}
\index{setMaxItems@{setMaxItems}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRecent\-Files\-Action::set\-Max\-Items (uint {\em max\-Items})\hspace{0.3cm}{\tt  [slot]}}\label{classKRecentFilesAction_i0}


Sets the maximum of items in the recent files list. 

The default for this value is 10 set in the constructor.

If this value is lesser than the number of items currently in the recent files list the last items are deleted until the number of items are equal to the new maximum. 

Definition at line 2135 of file kaction.cpp.

References KSelect\-Action::items(), and KSelect\-Action::set\-Items().\index{KRecentFilesAction@{KRecent\-Files\-Action}!loadEntries@{loadEntries}}
\index{loadEntries@{loadEntries}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRecent\-Files\-Action::load\-Entries ({\bf KConfig} $\ast$ {\em config}, {\bf QString} {\em groupname} = QString::null)\hspace{0.3cm}{\tt  [slot]}}\label{classKRecentFilesAction_i1}


Loads the recent files entries from a given {\bf KConfig} object. 

You can provide the name of the group used to load the entries. If the groupname is empty, entries are load from a group called 'Recent\-Files'

This method does not effect the active group of {\bf KConfig}. 

Definition at line 2193 of file kaction.cpp.

References KConfig\-Base::group(), QString::is\-Empty(), QString::is\-Null(), KStd\-Accel::key(), KConfig\-Base::read\-Entry(), KConfig\-Base::set\-Group(), and KSelect\-Action::set\-Items().\index{KRecentFilesAction@{KRecent\-Files\-Action}!saveEntries@{saveEntries}}
\index{saveEntries@{saveEntries}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRecent\-Files\-Action::save\-Entries ({\bf KConfig} $\ast$ {\em config}, {\bf QString} {\em groupname} = QString::null)\hspace{0.3cm}{\tt  [slot]}}\label{classKRecentFilesAction_i2}


Saves the current recent files entries to a given {\bf KConfig} object. 

You can provide the name of the group used to load the entries. If the groupname is empty, entries are saved to a group called 'Recent\-Files'

This method does not effect the active group of {\bf KConfig}. 

Definition at line 2222 of file kaction.cpp.

References KConfig\-Base::delete\-Group(), KConfig\-Base::group(), QString::is\-Empty(), KSelect\-Action::items(), KStd\-Accel::key(), KConfig\-Base::set\-Group(), and KConfig\-Base::write\-Entry().\index{KRecentFilesAction@{KRecent\-Files\-Action}!addURL@{addURL}}
\index{addURL@{addURL}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRecent\-Files\-Action::add\-URL (const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [slot]}}\label{classKRecentFilesAction_i3}


Add URL to recent files list. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]The URL of the file \end{description}
\end{Desc}


Definition at line 2155 of file kaction.cpp.

References KSelect\-Action::items(), KURL::pretty\-URL(), and KSelect\-Action::set\-Items().\index{KRecentFilesAction@{KRecent\-Files\-Action}!removeURL@{removeURL}}
\index{removeURL@{removeURL}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRecent\-Files\-Action::remove\-URL (const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [slot]}}\label{classKRecentFilesAction_i4}


Remove an URL from the recent files list. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]The URL of the file \end{description}
\end{Desc}


Definition at line 2175 of file kaction.cpp.

References KSelect\-Action::items(), KURL::pretty\-URL(), and KSelect\-Action::set\-Items().\index{KRecentFilesAction@{KRecent\-Files\-Action}!clearURLList@{clearURLList}}
\index{clearURLList@{clearURLList}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRecent\-Files\-Action::clear\-URLList ()\hspace{0.3cm}{\tt  [slot]}}\label{classKRecentFilesAction_i5}


Removes all entries from the recent files list. 



Definition at line 2188 of file kaction.cpp.

References KSelect\-Action::clear().\index{KRecentFilesAction@{KRecent\-Files\-Action}!urlSelected@{urlSelected}}
\index{urlSelected@{urlSelected}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRecent\-Files\-Action::url\-Selected (const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [signal]}}\label{classKRecentFilesAction_l0}


This signal gets emited when the user selects an URL. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]The URL thats the user selected. \end{description}
\end{Desc}


Referenced by KRecent\-Files\-Action().

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