itemsearchjob.h

00001 /*
00002     Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 */
00019 
00020 #ifndef AKONADI_ITEMSEARCHJOB_H
00021 #define AKONADI_ITEMSEARCHJOB_H
00022 
00023 #include <QUrl>
00024 
00025 #include <akonadi/item.h>
00026 #include <akonadi/job.h>
00027 
00028 namespace Akonadi {
00029 
00030 class ItemFetchScope;
00031 class ItemSearchJobPrivate;
00032 
00063 class AKONADI_EXPORT ItemSearchJob : public Job
00064 {
00065   Q_OBJECT
00066 
00067   public:
00074     explicit ItemSearchJob( const QString &query, QObject *parent = 0 );
00075 
00079     ~ItemSearchJob();
00080 
00084     void setQuery( const QString &query );
00085 
00097     void setFetchScope( const ItemFetchScope &fetchScope );
00098 
00111     ItemFetchScope &fetchScope();
00112 
00116     Item::List items() const;
00117 
00129     static QUrl akonadiItemIdUri();
00130 
00131   Q_SIGNALS:
00141     void itemsReceived( const Akonadi::Item::List &items );
00142 
00143   protected:
00144     void doStart();
00145     virtual void doHandleResponse( const QByteArray &tag, const QByteArray &data );
00146 
00147   private:
00148     //@cond PRIVATE
00149     Q_DECLARE_PRIVATE( ItemSearchJob )
00150 
00151     Q_PRIVATE_SLOT( d_func(), void timeout() )
00152     //@endcond
00153 };
00154 
00155 }
00156 
00157 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys