00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #ifndef QVINDEXEDSTRINGLIST_H
00026 #define QVINDEXEDSTRINGLIST_H
00027
00028 #include <QStringList>
00029 #include <QMetaType>
00030
00031
00035
00036 #ifndef DOXYGEN_IGNORE_THIS
00037 class QVIndexedStringList: public QStringList
00038 {
00039 private:
00040 int index;
00041
00042 public:
00043 QVIndexedStringList() : QStringList(), index(-1) { }
00044 QVIndexedStringList( const QVIndexedStringList& l ) : QStringList(l), index(l.index) { }
00045 QVIndexedStringList( const QStringList& l ) : QStringList(l), index(l.isEmpty()? -1 : 0) { }
00046 QVIndexedStringList( const QString& i ) { append(i); index = 0; }
00047
00048
00049
00050 void sort();
00051 QVIndexedStringList filter(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
00052 #ifndef QT_NO_REGEXP
00053 QVIndexedStringList filter(const QRegExp &rx) const;
00054 #endif
00055 QVIndexedStringList operator+(const QVIndexedStringList &other) const;
00056
00057
00058
00059 int getIndex() const { return index; }
00060 QString getCurrent() const;
00061 bool setIndex(int i);
00062 bool incIndex();
00063 bool decIndex();
00064 void append(const QString &str);
00065 };
00066
00067 Q_DECLARE_METATYPE(QVIndexedStringList);
00068 #endif
00069 #endif
00070