Back to index

scribus-ng  1.3.4.dfsg+svn20071115
filesearch.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #ifndef _FILESEARCH_H
00008 #define _FILESEARCH_H
00009 
00010 #include "scribusapi.h"
00011 #include "deferredtask.h"
00012 #include <qstringlist.h>
00013 #include <qvaluestack.h>
00014 #include <qdir.h>
00015 
00016 class QTimer;
00017 
00024 class SCRIBUS_API FileSearch : public DeferredTask
00025 {
00026        Q_OBJECT
00027 
00028 public:
00043        FileSearch(QObject* parent, const QString & fileName, const QString & searchBase = QString::null, int depthLimit = -1, bool caseSensitive=true);
00044 
00045        ~FileSearch();
00046 
00047 public slots:
00049        virtual void start();
00050 
00054        const QStringList & matchingFiles() const;
00055 
00057        int foundCount() const;
00058 
00060        const QString & fileName() const;
00061 
00066        const QDir & currentDir() const;
00067 
00068 signals:
00074        void searchComplete(const QStringList&, const QString&);
00075 
00076 protected slots:
00077        virtual void next();
00078 
00079 protected:
00082        void pushStack();
00083 
00086        void addCurrentDirFiles();
00087 
00089        bool m_caseSensitive;
00090 
00092        QString m_searchBase;
00093 
00095        QString m_fileName;
00096 
00098        QStringList m_matchingFiles;
00099 
00104        QValueStack<QStringList> m_tree;
00105 
00109        QValueStack<QStringList::const_iterator> m_iter;
00110 
00113        QDir m_dir;
00114 
00116        int m_depth;
00117 
00119        int m_maxdepth;
00120 };
00121 
00122 #endif