00001 /* 00002 Copyright © 2010 guillaume belz 00003 00004 This file is part of QExtend. 00005 00006 QExtend is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 any later version. 00010 00011 QExtend is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with QExtend. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #ifndef QEXTEND_RECENTMENU_H 00021 #define QEXTEND_RECENTMENU_H 00022 00023 #include <QtGui/QMenu> 00024 #include <QtCore/QStringList> 00025 #include <QExtend/Core/qextend_global> 00026 00027 namespace QExtend { 00028 00029 00031 00033 00041 class QEXTEND_EXPORT RecentMenu : public QMenu 00042 { 00043 Q_OBJECT 00044 00045 public: 00046 RecentMenu(const QString &title, QWidget *parent = 0); 00047 00048 bool clearItem() const; 00049 void setClearItem(const bool value); 00050 00051 int maxSize() const; 00052 void setMaxSize(const int value); 00053 00054 void addRecent(const QString &filename); 00055 00056 public Q_SLOTS: 00057 void clear(); 00058 00059 Q_SIGNALS: 00060 void openFile(const QString filename); 00061 00062 private Q_SLOTS: 00063 void clicked(QAction* action); 00064 00065 private: 00066 void update(); 00067 00068 QStringList m_filenames; 00069 bool m_clearItem; 00070 int m_maxSize; 00071 }; 00072 00073 } 00074 00075 #endif // QEXTEND_RECENTMENU_H
© 2000-2024 - www.developpez.com