\section{KRecent\-Document Class Reference}
\label{classKRecentDocument}\index{KRecentDocument@{KRecentDocument}}
Manage the \char`\"{}Recent Document Menu\char`\"{} entries displayed by applications such as Kicker and Konqueror.  


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

\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
{\bf QString\-List} {\bf recent\-Documents} ()
\begin{CompactList}\small\item\em Return a list of absolute paths to recent document .desktop files, sorted by date. \item\end{CompactList}\item 
void {\bf add} (const  {\bf KURL} \&url)
\begin{CompactList}\small\item\em Add a new item to the Recent Document menu. \item\end{CompactList}\item 
void {\bf add} (const  {\bf KURL} \&url, const  {\bf QString} \&desktop\-Entry\-Name)
\begin{CompactList}\small\item\em Add a new item to the Recent Document menu, specifying the application to open it with. \item\end{CompactList}\item 
void {\bf add} (const  {\bf QString} \&document\-Str, bool is\-URL=false)
\begin{CompactList}\small\item\em Add a new item to the Recent Document menu. \item\end{CompactList}\item 
void {\bf clear} ()
\begin{CompactList}\small\item\em Clear the recent document menu of all entries. \item\end{CompactList}\item 
int {\bf maximum\-Items} ()
\begin{CompactList}\small\item\em Returns the maximum amount of recent document entries allowed. \item\end{CompactList}\item 
{\bf QString} {\bf recent\-Document\-Directory} ()
\begin{CompactList}\small\item\em Returns the path to the directory where recent document .desktop files are stored. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Manage the \char`\"{}Recent Document Menu\char`\"{} entries displayed by applications such as Kicker and Konqueror. 

These entries are automatically generated .desktop files pointing to the current application and document. You should call the static {\bf add}{\rm (p.\,\pageref{classKRecentDocument_e1})}() method whenever the user opens or saves a new document if you want it to show up in the menu.

You don't have to worry about this if you are using any {\bf KFile\-Dialog}{\rm (p.\,\pageref{classKFileDialog})} derived class to open and save documents, as it already calls this class. User defined limits on the maximum number of documents to save, etc... are all automatically handled.

\begin{Desc}
\item[Author:]Daniel M. Duley $<${\tt mosfet@kde.org}$>$ \end{Desc}




Definition at line 50 of file krecentdocument.h.

\subsection{Member Function Documentation}
\index{KRecentDocument@{KRecent\-Document}!recentDocuments@{recentDocuments}}
\index{recentDocuments@{recentDocuments}!KRecentDocument@{KRecent\-Document}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KRecent\-Document::recent\-Documents ()\hspace{0.3cm}{\tt  [static]}}\label{classKRecentDocument_e0}


Return a list of absolute paths to recent document .desktop files, sorted by date. 



Definition at line 51 of file krecentdocument.cpp.

References QDir::abs\-File\-Path(), QDir::entry\-List(), QDir::exists(), QDir::mkdir(), and recent\-Document\-Directory().

Referenced by clear().\index{KRecentDocument@{KRecent\-Document}!add@{add}}
\index{add@{add}!KRecentDocument@{KRecent\-Document}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRecent\-Document::add (const {\bf KURL} \& {\em url})\hspace{0.3cm}{\tt  [static]}}\label{classKRecentDocument_e1}


Add a new item to the Recent Document menu. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]The url to add. \end{description}
\end{Desc}


Definition at line 69 of file krecentdocument.cpp.

Referenced by add(), KFile\-Dialog::get\-Save\-File\-Name(), KFile\-Dialog::get\-Save\-URL(), KURLRequester\-Dlg::get\-URL(), and KRun::run().\index{KRecentDocument@{KRecent\-Document}!add@{add}}
\index{add@{add}!KRecentDocument@{KRecent\-Document}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRecent\-Document::add (const {\bf KURL} \& {\em url}, const {\bf QString} \& {\em desktop\-Entry\-Name})\hspace{0.3cm}{\tt  [static]}}\label{classKRecentDocument_e2}


Add a new item to the Recent Document menu, specifying the application to open it with. 

The above {\bf add()}{\rm (p.\,\pageref{classKRecentDocument_e1})} method uses argv[0] for the app name, which isn't always flexible enough. This method is used when an application launches another one to open a document.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em url}]The url to add. \item[{\em service\-Desktop\-Name}]The desktop\-Entry\-Name of the service to use for opening this document. \end{description}
\end{Desc}


Definition at line 74 of file krecentdocument.cpp.

References QDir::abs\-Path(), KGlobal::config(), QFile::encode\-Name(), QDir::entry\-List(), QFile::exists(), KURL::file\-Name(), QString::from\-Latin1(), KConfig\-Base::group(), KMime\-Type::icon\-For\-URL(), KConfig\-Base::read\-Bool\-Entry(), KConfig\-Base::read\-Entry(), KConfig\-Base::read\-Num\-Entry(), recent\-Document\-Directory(), QFile::remove(), QString::replace(), KConfig\-Base::set\-Desktop\-Group(), KConfig\-Base::set\-Group(), KURL::url(), and KConfig\-Base::write\-Entry().\index{KRecentDocument@{KRecent\-Document}!add@{add}}
\index{add@{add}!KRecentDocument@{KRecent\-Document}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRecent\-Document::add (const {\bf QString} \& {\em document\-Str}, bool {\em is\-URL} = false)\hspace{0.3cm}{\tt  [static]}}\label{classKRecentDocument_e3}


Add a new item to the Recent Document menu. 

Calls add( url ).

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em document\-Str}]The full path to the document or URL to add.\item[{\em Set}]to {\tt true} if {\tt document\-Str} is an URL and not a local file path. \end{description}
\end{Desc}


Definition at line 139 of file krecentdocument.cpp.

References add(), and KURL::set\-Path().\index{KRecentDocument@{KRecent\-Document}!clear@{clear}}
\index{clear@{clear}!KRecentDocument@{KRecent\-Document}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRecent\-Document::clear ()\hspace{0.3cm}{\tt  [static]}}\label{classKRecentDocument_e4}


Clear the recent document menu of all entries. 



Definition at line 150 of file krecentdocument.cpp.

References recent\-Documents(), and QDir::remove().\index{KRecentDocument@{KRecent\-Document}!maximumItems@{maximumItems}}
\index{maximumItems@{maximumItems}!KRecentDocument@{KRecent\-Document}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KRecent\-Document::maximum\-Items ()\hspace{0.3cm}{\tt  [static]}}\label{classKRecentDocument_e5}


Returns the maximum amount of recent document entries allowed. 



Definition at line 158 of file krecentdocument.cpp.

References KGlobal::config(), QString::from\-Latin1(), and KConfig\-Base::read\-Num\-Entry().\index{KRecentDocument@{KRecent\-Document}!recentDocumentDirectory@{recentDocumentDirectory}}
\index{recentDocumentDirectory@{recentDocumentDirectory}!KRecentDocument@{KRecent\-Document}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KRecent\-Document::recent\-Document\-Directory ()\hspace{0.3cm}{\tt  [static]}}\label{classKRecentDocument_e6}


Returns the path to the directory where recent document .desktop files are stored. 



Definition at line 45 of file krecentdocument.cpp.

References QString::from\-Latin1(), and locate\-Local().

Referenced by add(), and recent\-Documents().

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