00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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