Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef QTXMRUACTION_H
00027 #define QTXMRUACTION_H
00028
00029 #include "QtxAction.h"
00030
00031 #include <QStringList>
00032
00033 class QtxResourceMgr;
00034
00035 #ifdef WIN32
00036 #pragma warning( disable:4251 )
00037 #endif
00038
00039 class QTX_EXPORT QtxMRUAction : public QtxAction
00040 {
00041 Q_OBJECT
00042
00043 public:
00045 typedef enum { MoveFirst,
00046 MoveLast,
00047 AddFirst,
00048 AddLast
00049 } InsertionMode;
00050
00051 typedef enum { LinkAuto,
00052 LinkShort,
00053 LinkFull
00054 } LinkType;
00055
00056 public:
00057 QtxMRUAction( QObject* = 0 );
00058 QtxMRUAction( const QString&, const QString&, QObject* = 0 );
00059 QtxMRUAction( const QString&, const QIcon&, const QString&, QObject* = 0 );
00060 virtual ~QtxMRUAction();
00061
00062 int insertMode() const;
00063 void setInsertMode( const int );
00064
00065 int linkType() const;
00066 void setLinkType( const int );
00067
00068 int count() const;
00069 bool isEmpty() const;
00070
00071 int visibleCount() const;
00072 void setVisibleCount( const int );
00073
00074 bool isClearPossible() const;
00075 void setClearPossible( const bool );
00076
00077 int historyCount() const;
00078 void setHistoryCount( const int );
00079
00080 void remove( const int );
00081 void remove( const QString& );
00082 void insert( const QString& );
00083
00084 QString item( const int ) const;
00085 int find( const QString& ) const;
00086 bool contains( const QString& ) const;
00087
00088 virtual void loadLinks( QtxResourceMgr*, const QString&, const bool = true );
00089 virtual void saveLinks( QtxResourceMgr*, const QString&, const bool = true ) const;
00090
00091 public slots:
00092 void clear();
00093
00094 signals:
00095 void activated( const QString& );
00096
00097 private slots:
00098 void onActivated();
00099 void onAboutToShow();
00100 void onCleared( bool );
00101
00102 private:
00103 void updateMenu();
00104
00105 private:
00106 QStringList myLinks;
00107 QAction* myClear;
00108 int myVisCount;
00109 int myHistoryCount;
00110 int myLinkType;
00111 int myInsertMode;
00112 };
00113
00114 #endif