.TH "KRecentFilesAction" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KRecentFilesAction \- Recent files action.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kactionclasses.h>\fP
.PP
Inherits \fBKListAction\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBsetMaxItems\fP (uint maxItems)"
.br
.ti -1c
.RI "void \fBloadEntries\fP (\fBKConfig\fP *config, \fBQString\fP groupname=QString::null)"
.br
.ti -1c
.RI "void \fBsaveEntries\fP (\fBKConfig\fP *config, \fBQString\fP groupname=QString::null)"
.br
.ti -1c
.RI "void \fBaddURL\fP (const \fBKURL\fP &url)"
.br
.ti -1c
.RI "void \fBremoveURL\fP (const \fBKURL\fP &url)"
.br
.ti -1c
.RI "void \fBclearURLList\fP ()"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBurlSelected\fP (const \fBKURL\fP &url)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKRecentFilesAction\fP (const \fBQString\fP &text, const \fBKShortcut\fP &cut, \fBQObject\fP *\fBparent\fP, const char *\fBname\fP=0, uint maxItems=10)"
.br
.ti -1c
.RI "\fBKRecentFilesAction\fP (const \fBQString\fP &text, const \fBKShortcut\fP &cut, const \fBQObject\fP *receiver, const char *slot, \fBQObject\fP *\fBparent\fP, const char *\fBname\fP=0, uint maxItems=10)"
.br
.ti -1c
.RI "\fBKRecentFilesAction\fP (const \fBQString\fP &text, const \fBQIconSet\fP &pix, const \fBKShortcut\fP &cut, \fBQObject\fP *\fBparent\fP, const char *\fBname\fP=0, uint maxItems=10)"
.br
.ti -1c
.RI "\fBKRecentFilesAction\fP (const \fBQString\fP &text, const \fBQString\fP &pix, const \fBKShortcut\fP &cut, \fBQObject\fP *\fBparent\fP, const char *\fBname\fP=0, uint maxItems=10)"
.br
.ti -1c
.RI "\fBKRecentFilesAction\fP (const \fBQString\fP &text, const \fBQIconSet\fP &pix, const \fBKShortcut\fP &cut, const \fBQObject\fP *receiver, const char *slot, \fBQObject\fP *\fBparent\fP, const char *\fBname\fP=0, uint maxItems=10)"
.br
.ti -1c
.RI "\fBKRecentFilesAction\fP (const \fBQString\fP &text, const \fBQString\fP &pix, const \fBKShortcut\fP &cut, const \fBQObject\fP *receiver, const char *slot, \fBQObject\fP *\fBparent\fP, const char *\fBname\fP=0, uint maxItems=10)"
.br
.ti -1c
.RI "\fBKRecentFilesAction\fP (\fBQObject\fP *\fBparent\fP=0, const char *\fBname\fP=0, uint maxItems=10)"
.br
.ti -1c
.RI "virtual \fB~KRecentFilesAction\fP ()"
.br
.ti -1c
.RI "virtual int \fBplug\fP (\fBQWidget\fP *widget, int index=-1)"
.br
.ti -1c
.RI "uint \fBmaxItems\fP () const "
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBitemSelected\fP (const \fBQString\fP &string)"
.br
.ti -1c
.RI "void \fBmenuAboutToShow\fP ()"
.br
.ti -1c
.RI "void \fBmenuItemActivated\fP (int id)"
.br
.ti -1c
.RI "void \fBslotClicked\fP ()"
.br
.ti -1c
.RI "virtual void \fBslotActivated\fP (int)"
.br
.ti -1c
.RI "virtual void \fBslotActivated\fP (const \fBQString\fP &)"
.br
.ti -1c
.RI "virtual void \fBslotActivated\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Properties"

.in +1c
.ti -1c
.RI "uint \fBmaxItems\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
Recent files action. 

This class is an action to handle a recent files submenu. The best way to create the action is to use \fBKStdAction::openRecent\fP. Then you simply need to call loadEntries on startup, saveEntries on shutdown, addURL when your application loads/saves a file.
.PP
\fBAuthor:\fP
.RS 4
Michael Koch 
.RE
.PP

.PP
Definition at line 686 of file kactionclasses.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KRecentFilesAction::KRecentFilesAction (const \fBQString\fP & text, const \fBKShortcut\fP & cut, \fBQObject\fP * parent, const char * name = \fC0\fP, uint maxItems = \fC10\fP)"
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIcut\fP The corresponding keyboard accelerator (shortcut). 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.br
\fImaxItems\fP The maximum number of files to display 
.RE
.PP

.PP
Definition at line 929 of file kactionclasses.cpp.
.SS "KRecentFilesAction::KRecentFilesAction (const \fBQString\fP & text, const \fBKShortcut\fP & cut, const \fBQObject\fP * receiver, const char * slot, \fBQObject\fP * parent, const char * name = \fC0\fP, uint maxItems = \fC10\fP)"
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIcut\fP The corresponding keyboard accelerator (shortcut). 
.br
\fIreceiver\fP The SLOT's parent. 
.br
\fIslot\fP The SLOT to invoke when a URL is selected. Its signature is of the form slotURLSelected( const KURL & ). 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.br
\fImaxItems\fP The maximum number of files to display 
.RE
.PP

.PP
Definition at line 941 of file kactionclasses.cpp.
.PP
References QObject::connect(), and urlSelected().
.SS "KRecentFilesAction::KRecentFilesAction (const \fBQString\fP & text, const \fBQIconSet\fP & pix, const \fBKShortcut\fP & cut, \fBQObject\fP * parent, const char * name = \fC0\fP, uint maxItems = \fC10\fP)"
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIpix\fP The icons that go with this action. 
.br
\fIcut\fP The corresponding keyboard accelerator (shortcut). 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.br
\fImaxItems\fP The maximum number of files to display 
.RE
.PP

.PP
Definition at line 959 of file kactionclasses.cpp.
.SS "KRecentFilesAction::KRecentFilesAction (const \fBQString\fP & text, const \fBQString\fP & pix, const \fBKShortcut\fP & cut, \fBQObject\fP * parent, const char * name = \fC0\fP, uint maxItems = \fC10\fP)"
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIpix\fP The dynamically loaded icon that goes with this action. 
.br
\fIcut\fP The corresponding keyboard accelerator (shortcut). 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.br
\fImaxItems\fP The maximum number of files to display 
.RE
.PP

.PP
Definition at line 972 of file kactionclasses.cpp.
.SS "KRecentFilesAction::KRecentFilesAction (const \fBQString\fP & text, const \fBQIconSet\fP & pix, const \fBKShortcut\fP & cut, const \fBQObject\fP * receiver, const char * slot, \fBQObject\fP * parent, const char * name = \fC0\fP, uint maxItems = \fC10\fP)"
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIpix\fP The icons that go with this action. 
.br
\fIcut\fP The corresponding keyboard accelerator (shortcut). 
.br
\fIreceiver\fP The SLOT's parent. 
.br
\fIslot\fP The SLOT to invoke when a URL is selected. Its signature is of the form slotURLSelected( const KURL & ). 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.br
\fImaxItems\fP The maximum number of files to display 
.RE
.PP

.PP
Definition at line 985 of file kactionclasses.cpp.
.PP
References QObject::connect(), and urlSelected().
.SS "KRecentFilesAction::KRecentFilesAction (const \fBQString\fP & text, const \fBQString\fP & pix, const \fBKShortcut\fP & cut, const \fBQObject\fP * receiver, const char * slot, \fBQObject\fP * parent, const char * name = \fC0\fP, uint maxItems = \fC10\fP)"
.PP
\fBParameters:\fP
.RS 4
\fItext\fP The text that will be displayed. 
.br
\fIpix\fP The dynamically loaded icon that goes with this action. 
.br
\fIcut\fP The corresponding keyboard accelerator (shortcut). 
.br
\fIreceiver\fP The SLOT's parent. 
.br
\fIslot\fP The SLOT to invoke when a URL is selected. Its signature is of the form slotURLSelected( const KURL & ). 
.br
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.br
\fImaxItems\fP The maximum number of files to display 
.RE
.PP

.PP
Definition at line 1004 of file kactionclasses.cpp.
.PP
References QObject::connect(), and urlSelected().
.SS "KRecentFilesAction::KRecentFilesAction (\fBQObject\fP * parent = \fC0\fP, const char * name = \fC0\fP, uint maxItems = \fC10\fP)"
.PP
\fBParameters:\fP
.RS 4
\fIparent\fP This action's parent. 
.br
\fIname\fP An internal name for this action. 
.br
\fImaxItems\fP The maximum number of files to display 
.RE
.PP

.PP
Definition at line 1023 of file kactionclasses.cpp.
.SS "KRecentFilesAction::~\fBKRecentFilesAction\fP ()\fC [virtual]\fP"
.PP
Destructor. 
.PP
Definition at line 1045 of file kactionclasses.cpp.
.SH "Member Function Documentation"
.PP 
.SS "int KRecentFilesAction::plug (\fBQWidget\fP * widget, int index = \fC-1\fP)\fC [virtual]\fP"
.PP
'Plug' or insert this action into a given widget. 
.PP
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 \fBKSelectAction\fP object.
.PP
\fBParameters:\fP
.RS 4
\fIwidget\fP The GUI element to display this action. 
.br
\fIindex\fP The index of the item. 
.RE
.PP

.PP
Reimplemented from \fBKSelectAction\fP.
.PP
Definition at line 1189 of file kactionclasses.cpp.
.PP
References QWhatsThis::add(), QObject::connect(), QObject::destroyed(), KToolBar::getButton(), KAction::getToolButtonID(), KToolBar::insertButton(), KGlobal::instance(), KActionCollection::instance(), KAction::isEnabled(), KSelectAction::plug(), KToolBar::setDelayedPopup(), and KAction::whatsThis().
.SS "uint KRecentFilesAction::maxItems () const"
.PP
Returns the maximum of items in the recent files list. 
.PP
.SS "void KRecentFilesAction::setMaxItems (uint maxItems)\fC [slot]\fP"
.PP
Sets the maximum of items in the recent files list. 
.PP
The default for this value is 10 set in the constructor.
.PP
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. 
.PP
Definition at line 1056 of file kactionclasses.cpp.
.PP
References KSelectAction::items(), and KSelectAction::setItems().
.SS "void KRecentFilesAction::loadEntries (\fBKConfig\fP * config, \fBQString\fP groupname = \fCQString::null\fP)\fC [slot]\fP"
.PP
\fBLoads\fP the recent files entries from a given \fBKConfig\fP object. 
.PP
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 'RecentFiles'
.PP
This method does not effect the active group of \fBKConfig\fP. 
.PP
Definition at line 1116 of file kactionclasses.cpp.
.PP
References QString::arg(), QString::isEmpty(), QString::isNull(), and KSelectAction::setItems().
.SS "void KRecentFilesAction::saveEntries (\fBKConfig\fP * config, \fBQString\fP groupname = \fCQString::null\fP)\fC [slot]\fP"
.PP
Saves the current recent files entries to a given \fBKConfig\fP object. 
.PP
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 'RecentFiles'
.PP
This method does not effect the active group of \fBKConfig\fP. 
.PP
Definition at line 1145 of file kactionclasses.cpp.
.PP
References QString::arg(), QString::isEmpty(), and KSelectAction::items().
.SS "void KRecentFilesAction::addURL (const \fBKURL\fP & url)\fC [slot]\fP"
.PP
Add URL to recent files list. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP The URL of the file 
.RE
.PP

.PP
Definition at line 1076 of file kactionclasses.cpp.
.PP
References KGlobal::dirs(), KSelectAction::items(), KStandardDirs::relativeLocation(), KSelectAction::setItems(), and QString::startsWith().
.SS "void KRecentFilesAction::removeURL (const \fBKURL\fP & url)\fC [slot]\fP"
.PP
Remove an URL from the recent files list. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP The URL of the file 
.RE
.PP

.PP
Definition at line 1098 of file kactionclasses.cpp.
.PP
References KSelectAction::items(), and KSelectAction::setItems().
.SS "void KRecentFilesAction::clearURLList ()\fC [slot]\fP"
.PP
Removes all entries from the recent files list. 
.PP
Definition at line 1111 of file kactionclasses.cpp.
.PP
References KSelectAction::clear().
.SS "void KRecentFilesAction::urlSelected (const \fBKURL\fP & url)\fC [signal]\fP"
.PP
This signal gets emited when the user selects an URL. 
.PP
\fBParameters:\fP
.RS 4
\fIurl\fP The URL thats the user selected. 
.RE
.PP

.PP
Referenced by KRecentFilesAction().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
