• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • actions
krecentfilesaction.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 1999 Reginald Stadlbauer <reggie@kde.org>
3 (C) 1999 Simon Hausmann <hausmann@kde.org>
4 (C) 2000 Nicolas Hadacek <haadcek@kde.org>
5 (C) 2000 Kurt Granroth <granroth@kde.org>
6 (C) 2000 Michael Koch <koch@kde.org>
7 (C) 2001 Holger Freyther <freyther@kde.org>
8 (C) 2002 Ellis Whitehead <ellis@kde.org>
9 (C) 2003 Andras Mantia <amantia@kde.org>
10 (C) 2005-2006 Hamish Rodda <rodda@kde.org>
11
12 This library is free software; you can redistribute it and/or
13 modify it under the terms of the GNU Library General Public
14 License version 2 as published by the Free Software Foundation.
15
16 This library is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Library General Public License for more details.
20
21 You should have received a copy of the GNU Library General Public License
22 along with this library; see the file COPYING.LIB. If not, write to
23 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA.
25*/
26
27#ifndef KRECENTFILESACTION_H
28#define KRECENTFILESACTION_H
29
30#include <kselectaction.h>
31#include <kurl.h>
32
33class KConfigGroup;
34class KRecentFilesActionPrivate;
35
46class KDEUI_EXPORT KRecentFilesAction : public KSelectAction
47{
48 Q_OBJECT
49 Q_PROPERTY( int maxItems READ maxItems WRITE setMaxItems )
50 Q_DECLARE_PRIVATE(KRecentFilesAction)
51
52public:
58 explicit KRecentFilesAction(QObject *parent);
59
72 KRecentFilesAction(const QString &text, QObject *parent);
73
85 KRecentFilesAction(const KIcon &icon, const QString &text, QObject *parent);
86
90 virtual ~KRecentFilesAction();
91
98 void addAction(QAction* action, const KUrl& url, const QString& name);
99
103 virtual QAction* removeAction(QAction* action);
104
105public Q_SLOTS:
110 virtual void clear();
111
112public:
116 int maxItems() const;
117
126 void setMaxItems( int maxItems );
127
134 void loadEntries( const KConfigGroup &config );
135
142 void saveEntries( const KConfigGroup &config );
143
150 void addUrl( const KUrl& url, const QString& name = QString() );
151
157 void removeUrl( const KUrl& url );
158
162 KUrl::List urls() const;
163
164Q_SIGNALS:
170 void urlSelected( const KUrl& url );
171
177 void recentListCleared();
178
179private:
180 //Internal
181 void clearEntries();
182 // Don't warn about the virtual overload. As the comment of the other
183 // addAction() says, addAction( QAction* ) should not be used.
184 using KSelectAction::addAction;
185
186 Q_PRIVATE_SLOT( d_func(), void _k_urlSelected(QAction*) )
187};
188
189#endif
KConfigGroup
KIcon
A wrapper around QIcon that provides KDE icon features.
Definition: kicon.h:41
KRecentFilesAction
Recent files action.
Definition: krecentfilesaction.h:47
KRecentFilesAction::recentListCleared
void recentListCleared()
This signal gets emitted when the user clear list.
KRecentFilesAction::urlSelected
void urlSelected(const KUrl &url)
This signal gets emitted when the user selects an URL.
KSelectAction
Action for selecting one of several items.
Definition: kselectaction.h:52
KSelectAction::addAction
virtual void addAction(QAction *action)
Add action to the list of selectable actions.
Definition: kselectaction.cpp:230
KUrl::List
KUrl
QAction
QObject
kselectaction.h
kurl.h
config
KSharedConfigPtr config()
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal