libqutim  0.3.2.0
contactsearch.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** qutIM - instant messenger
00004 **
00005 ** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
00006 **
00007 *****************************************************************************
00008 **
00009 ** $QUTIM_BEGIN_LICENSE$
00010 ** This program is free software: you can redistribute it and/or modify
00011 ** it under the terms of the GNU General Public License as published by
00012 ** the Free Software Foundation, either version 3 of the License, or
00013 ** (at your option) any later version.
00014 **
00015 ** This program is distributed in the hope that it will be useful,
00016 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00018 ** See the GNU General Public License for more details.
00019 **
00020 ** You should have received a copy of the GNU General Public License
00021 ** along with this program.  If not, see http://www.gnu.org/licenses/.
00022 ** $QUTIM_END_LICENSE$
00023 **
00024 ****************************************************************************/
00025 #ifndef CONTACTSEARCH_H
00026 #define CONTACTSEARCH_H
00027 
00028 #include "abstractsearchrequest.h"
00029 
00030 namespace qutim_sdk_0_3
00031 {
00032 class Protocol;
00033 class Account;
00034 class Contact;
00035 class Status;
00036 class ContactSearchFactoryPrivate;
00037 class GeneralContactSearchFactoryPrivate;
00038 
00039 class LIBQUTIM_EXPORT ContactSearchRequest : public AbstractSearchRequest
00040 {
00041     Q_OBJECT
00042     Q_DISABLE_COPY(ContactSearchRequest)
00043 public:
00044     ContactSearchRequest();
00045     virtual ~ContactSearchRequest();
00046     virtual Contact *contact(int row) = 0;
00047     virtual int actionCount() const;
00048     virtual QVariant actionData(int index, int role = Qt::DisplayRole);
00049     virtual void actionActivated(int actionIndex, int row);
00050 };
00051 
00052 class LIBQUTIM_EXPORT ContactSearchFactory : public AbstractSearchFactory
00053 {
00054     Q_OBJECT
00055     Q_DECLARE_PRIVATE(ContactSearchFactory)
00056 public:
00057     ContactSearchFactory();
00058     virtual ~ContactSearchFactory();
00059 protected:
00060     ContactSearchFactory(ContactSearchFactoryPrivate *d);
00061 };
00062 
00063 class LIBQUTIM_EXPORT GeneralContactSearchFactory : public ContactSearchFactory
00064 {
00065     Q_OBJECT
00066     Q_DECLARE_PRIVATE(GeneralContactSearchFactory)
00067 public:
00068     GeneralContactSearchFactory(Protocol *protocol);
00069     virtual ~GeneralContactSearchFactory();
00070     virtual QStringList requestList() const;
00071     virtual QVariant data(const QString &request, int role = Qt::DisplayRole);
00072     Account *account(const QString &name) const;
00073     Protocol *protocol() const;
00074 private slots:
00075     void accountAdded(qutim_sdk_0_3::Account *account);
00076     void accountRemoved();
00077     void accountStatusChanged(const qutim_sdk_0_3::Status &status);
00078 };
00079 }
00080 
00081 #endif // CONTACTSEARCH_H
00082