\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 
static {\bf QString\-List} {\bf recent\-Documents} ()
\item 
static void {\bf add} (const {\bf KURL} \&url)
\item 
static void {\bf add} (const {\bf KURL} \&url, const {\bf QString} \&desktop\-Entry\-Name)
\item 
static void {\bf add} (const {\bf QString} \&document\-Str, bool is\-URL=false)
\item 
static void {\bf clear} ()
\item 
static int {\bf maximum\-Items} ()
\item 
static {\bf QString} {\bf recent\-Document\-Directory} ()
\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(), KDesktop\-File::read\-URL(), recent\-Document\-Directory(), and QDir::remove().

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 75 of file krecentdocument.cpp.

Referenced by add(), KFile\-Dialog::get\-Save\-File\-Name(), KEncoding\-File\-Dialog::get\-Save\-File\-Name\-And\-Encoding(), KFile\-Dialog::get\-Save\-File\-Name\-WId(), KFile\-Dialog::get\-Save\-URL(), KEncoding\-File\-Dialog::get\-Save\-URLAnd\-Encoding(), 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 desktop\-Entry\-Name}]The desktop\-Entry\-Name of the service to use for opening this document. \end{description}
\end{Desc}


Definition at line 80 of file krecentdocument.cpp.

References QDir::abs\-Path(), QString::arg(), KGlobal::config(), KGlobal::dirs(), endl(), QDir::entry\-List(), QFile::exists(), QString::from\-Latin1(), KConfig\-Base::group(), kd\-Debug(), KConfig\-Base::read\-Bool\-Entry(), KConfig\-Base::read\-Entry(), KConfig\-Base::read\-Num\-Entry(), recent\-Document\-Directory(), KStandard\-Dirs::relative\-Location(), QFile::remove(), QString::replace(), KConfig\-Base::set\-Desktop\-Group(), KConfig\-Base::set\-Group(), QString::starts\-With(), KConfig\-Base::write\-Entry(), and KConfig\-Base::write\-Path\-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} = {\tt 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 is\-URL}]Set to {\tt true} if {\tt document\-Str} is an URL and not a local file path. \end{description}
\end{Desc}


Definition at line 148 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 159 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 167 of file krecentdocument.cpp.

References KGlobal::config(), 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 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}
