\section{KRecent\-Files\-Action Class Reference}
\label{classKRecentFilesAction}\index{KRecentFilesAction@{KRecentFilesAction}}
Recent files action.  


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

Inheritance diagram for KRecent\-Files\-Action:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=69pt]{classKRecentFilesAction__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KRecent\-Files\-Action:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=105pt]{classKRecentFilesAction__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf set\-Max\-Items} (uint max\-Items)
\item 
void {\bf load\-Entries} ({\bf KConfig} $\ast$config, {\bf QString} groupname=QString::null)
\item 
void {\bf save\-Entries} ({\bf KConfig} $\ast$config, {\bf QString} groupname=QString::null)
\item 
void {\bf add\-URL} (const {\bf KURL} \&url)
\item 
void {\bf remove\-URL} (const {\bf KURL} \&url)
\item 
void {\bf clear\-URLList} ()
\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf url\-Selected} (const {\bf KURL} \&url)
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KRecent\-Files\-Action} (const {\bf QString} \&text, const {\bf 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 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 {\bf 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 {\bf 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 {\bf 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 {\bf 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} ()
\item 
virtual int {\bf plug} ({\bf QWidget} $\ast$widget, int index=-1)
\item 
uint {\bf max\-Items} () const 
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
void {\bf item\-Selected} (const {\bf QString} \&string)\label{classKRecentFilesAction_j0}

\item 
void {\bf menu\-About\-To\-Show} ()\label{classKRecentFilesAction_j1}

\item 
void {\bf menu\-Item\-Activated} (int id)\label{classKRecentFilesAction_j2}

\item 
void {\bf slot\-Clicked} ()\label{classKRecentFilesAction_j3}

\item 
virtual void {\bf slot\-Activated} (int)\label{classKRecentFilesAction_j4}

\item 
virtual void {\bf slot\-Activated} (const {\bf QString} \&)\label{classKRecentFilesAction_j5}

\item 
virtual void {\bf slot\-Activated} ()\label{classKRecentFilesAction_j6}

\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*{Properties}
\begin{CompactItemize}
\item 
uint {\bf max\-Items}\label{classKRecentFilesAction_00}

\end{CompactItemize}


\subsection{Detailed Description}
Recent files action. 

This class is an action to handle a recent files submenu. The best way to create the action is to use {\bf KStd\-Action::open\-Recent}{\rm (p.\,\pageref{namespaceKStdAction_a68})}. Then you simply need to call load\-Entries on startup, save\-Entries on shutdown, add\-URL when your application loads/saves a file.

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




Definition at line 686 of file kactionclasses.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 {\bf KShortcut} \& {\em cut}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = {\tt 0}, uint {\em max\-Items} = {\tt 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 929 of file kactionclasses.cpp.\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 KShortcut} \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = {\tt 0}, uint {\em max\-Items} = {\tt 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 941 of file kactionclasses.cpp.

References QObject::connect(), 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 {\bf KShortcut} \& {\em cut}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = {\tt 0}, uint {\em max\-Items} = {\tt 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 959 of file kactionclasses.cpp.\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 {\bf KShortcut} \& {\em cut}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = {\tt 0}, uint {\em max\-Items} = {\tt 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 972 of file kactionclasses.cpp.\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 {\bf KShortcut} \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = {\tt 0}, uint {\em max\-Items} = {\tt 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 985 of file kactionclasses.cpp.

References QObject::connect(), 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 {\bf KShortcut} \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = {\tt 0}, uint {\em max\-Items} = {\tt 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 1004 of file kactionclasses.cpp.

References QObject::connect(), 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} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0}, uint {\em max\-Items} = {\tt 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 1023 of file kactionclasses.cpp.\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 1045 of file kactionclasses.cpp.

\subsection{Member Function Documentation}
\index{KRecentFilesAction@{KRecent\-Files\-Action}!plug@{plug}}
\index{plug@{plug}!KRecentFilesAction@{KRecent\-Files\-Action}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KRecent\-Files\-Action::plug ({\bf QWidget} $\ast$ {\em widget}, int {\em index} = {\tt -1})\hspace{0.3cm}{\tt  [virtual]}}\label{classKRecentFilesAction_a8}


\char`\"{}Plug\char`\"{} or insert this action into a given widget. 

This will typically be a menu or a toolbar. From this point on, you will never need to directly manipulate the item in the menu or toolbar. You do all enabling/disabling/manipulation directly with your {\bf KSelect\-Action}{\rm (p.\,\pageref{classKSelectAction})} object.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em widget}]The GUI element to display this action. \item[{\em index}]The index of the item. \end{description}
\end{Desc}


Reimplemented from {\bf KSelect\-Action} {\rm (p.\,\pageref{classKSelectAction_a8})}.

Definition at line 1189 of file kactionclasses.cpp.

References QWhats\-This::add(), QObject::connect(), QObject::destroyed(), KTool\-Bar::get\-Button(), KAction::get\-Tool\-Button\-ID(), KTool\-Bar::insert\-Button(), KGlobal::instance(), KAction\-Collection::instance(), KAction::is\-Enabled(), KSelect\-Action::plug(), KTool\-Bar::set\-Delayed\-Popup(), and KAction::whats\-This().\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_a9}


Returns the maximum of items in the recent files list. 

\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 1056 of file kactionclasses.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} = {\tt QString::null})\hspace{0.3cm}{\tt  [slot]}}\label{classKRecentFilesAction_i1}


{\bf 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 1116 of file kactionclasses.cpp.

References QString::arg(), QString::is\-Empty(), QString::is\-Null(), 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} = {\tt 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 1145 of file kactionclasses.cpp.

References QString::arg(), QString::is\-Empty(), and KSelect\-Action::items().\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 1076 of file kactionclasses.cpp.

References KGlobal::dirs(), KSelect\-Action::items(), KStandard\-Dirs::relative\-Location(), KSelect\-Action::set\-Items(), and QString::starts\-With().\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 1098 of file kactionclasses.cpp.

References KSelect\-Action::items(), 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 1111 of file kactionclasses.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 
kactionclasses.h\item 
kactionclasses.cpp\end{CompactItemize}
