summaryrefslogtreecommitdiffstats
path: root/kfind/kquery.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /kfind/kquery.h
downloadtdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz
tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kfind/kquery.h')
-rw-r--r--kfind/kquery.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/kfind/kquery.h b/kfind/kquery.h
new file mode 100644
index 000000000..c7e81fcfe
--- /dev/null
+++ b/kfind/kquery.h
@@ -0,0 +1,102 @@
+#ifndef KQUERY_H
+#define KQUERY_H
+
+#include <time.h>
+
+#include <qobject.h>
+#include <qregexp.h>
+#include <qptrqueue.h>
+#include <qdir.h>
+#include <qstringlist.h>
+
+#include <kio/job.h>
+#include <kurl.h>
+#include <kprocess.h>
+
+class KFileItem;
+
+class KQuery : public QObject
+{
+ Q_OBJECT
+
+ public:
+ KQuery(QObject *parent = 0, const char * name = 0);
+ ~KQuery();
+
+ void setSizeRange( int mode, KIO::filesize_t value1, KIO::filesize_t value2 );
+ void setTimeRange( time_t from, time_t to );
+ void setRegExp( const QString &regexp, bool caseSensitive );
+ void setRecursive( bool recursive );
+ void setPath(const KURL & url );
+ void setFileType( int filetype );
+ void setMimeType( const QStringList & mimetype );
+ void setContext( const QString & context, bool casesensitive,
+ bool search_binary, bool useRegexp );
+ void setUsername( QString username );
+ void setGroupname( QString groupname );
+ void setMetaInfo(const QString &metainfo, const QString &metainfokey);
+ void setUseFileIndex(bool);
+
+ void start();
+ void kill();
+ const KURL& url() {return m_url;};
+
+ private:
+ /* Check if file meets the find's requirements*/
+ inline void processQuery(KFileItem*);
+
+ public slots:
+ /* List of files found using slocate */
+ void slotListEntries(QStringList);
+ protected slots:
+ /* List of files found using KIO */
+ void slotListEntries(KIO::Job *, const KIO::UDSEntryList &);
+ void slotResult(KIO::Job *);
+ void slotCanceled(KIO::Job *);
+ void slotreceivedSdtout(KProcess*,char*,int);
+ void slotreceivedSdterr(KProcess*,char*,int);
+ void slotendProcessLocate(KProcess*);
+
+ signals:
+ void addFile(const KFileItem *filename, const QString& matchingLine);
+ void result(int);
+
+ private:
+ void checkEntries();
+
+ int m_filetype;
+ int m_sizemode;
+ KIO::filesize_t m_sizeboundary1;
+ KIO::filesize_t m_sizeboundary2;
+ KURL m_url;
+ time_t m_timeFrom;
+ time_t m_timeTo;
+ QRegExp m_regexp;// regexp for file content
+ bool m_recursive;
+ QStringList m_mimetype;
+ QString m_context;
+ QString m_username;
+ QString m_groupname;
+ QString m_metainfo;
+ QString m_metainfokey;
+ bool m_casesensitive;
+ bool m_search_binary;
+ bool m_regexpForContent;
+ bool m_useLocate;
+ char* bufferLocate;
+ int bufferLocateLength;
+ QStringList locateList;
+ KProcess *processLocate;
+ QPtrList<QRegExp> m_regexps;// regexps for file name
+// QValueList<bool> m_regexpsContainsGlobs; // what should this be good for ? Alex
+ KIO::ListJob *job;
+ bool m_insideCheckEntries;
+ QPtrQueue<KFileItem> m_fileItems;
+ QRegExp* metaKeyRx;
+ int m_result;
+ QStringList ignore_mimetypes;
+ QStringList ooo_mimetypes; // OpenOffice.org mimetypes
+ QStringList koffice_mimetypes;
+};
+
+#endif