libqutim 0.2.80.1

conference.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 CONFERENCE_H
00026 #define CONFERENCE_H
00027 
00028 #include "chatunit.h"
00029 #include "buddy.h"
00030 
00031 namespace qutim_sdk_0_3
00032 {
00033 class ConferencePrivate;
00034 class Buddy;
00035 
00036 class LIBQUTIM_EXPORT Conference : public ChatUnit
00037 {
00038     Q_DECLARE_PRIVATE(Conference)
00039     Q_PROPERTY(QString topic READ topic WRITE setTopic NOTIFY topicChanged)
00040     Q_PROPERTY(qutim_sdk_0_3::Buddy* me READ me NOTIFY meChanged)
00041     Q_PROPERTY(bool isJoined READ isJoined NOTIFY joinedChanged)
00042     Q_OBJECT
00043 public:
00044     Conference(Account *account);
00045     virtual ~Conference();
00046     virtual QString topic() const;
00047     virtual void setTopic(const QString &topic);
00048     virtual Buddy *me() const = 0;
00049     bool isJoined() const;
00050 public slots:
00051     void join();
00052     void leave();
00053     virtual void invite(qutim_sdk_0_3::Contact *contact, const QString &reason = QString());
00054 signals:
00055     void topicChanged(const QString &current, const QString &previous);
00056     void meChanged(qutim_sdk_0_3::Buddy *me);
00057     void left();
00058     void joined();
00059     void joinedChanged(bool isJoined);
00060 protected slots:
00061     void setJoined(bool set);
00062 protected:
00063     bool event(QEvent *ev);
00064     virtual void doJoin() = 0;
00065     virtual void doLeave() = 0;
00066 };
00067 
00068 }
00069 
00070 Q_DECLARE_METATYPE(qutim_sdk_0_3::Conference*)
00071 Q_DECLARE_METATYPE(QList<qutim_sdk_0_3::Conference*>)
00072 
00073 #endif // CONFERENCE_H
00074