libqutim
0.3.2.0
|
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 AUTHORIZATIONDIALOG_H 00026 #define AUTHORIZATIONDIALOG_H 00027 00028 #include "libqutim_global.h" 00029 #include <QEvent> 00030 00031 00032 namespace qutim_sdk_0_3 00033 { 00034 00035 class Contact; 00036 namespace Authorization 00037 { 00038 00042 //FIXME create new notification filter-like API 00043 class LIBQUTIM_EXPORT Request : public QEvent 00044 { 00045 public: 00046 Request(Contact *contact, const QString &body = QString()) 00047 : QEvent(eventType()), m_contact(contact), m_body(body) {} 00048 Contact *contact() const { return m_contact; } 00049 QString body() const { return m_body; } 00051 static QEvent::Type eventType(); 00052 private: 00053 Type m_type; 00054 Contact *m_contact; 00055 QString m_body; 00056 }; 00057 00058 class LIBQUTIM_EXPORT Reply : public QEvent 00059 { 00060 public: 00061 enum Type { 00062 New, 00063 Accept, 00064 Reject, 00065 Accepted, 00066 Rejected 00067 }; 00068 Reply(Type type, Contact *contact,const QString &body = QString()) 00069 : QEvent(eventType()), m_type(type), m_contact(contact), m_body(body) {} 00070 Contact *contact() const { return m_contact; } 00071 QString body() const { return m_body; } 00072 Type replyType() const { return m_type; } 00073 void setType(Type type) { m_type = type; } 00075 static QEvent::Type eventType(); 00076 private: 00077 Type m_type; 00078 Contact *m_contact; 00079 QString m_body; 00080 }; 00081 00082 LIBQUTIM_EXPORT QObject *service(); //alias 00083 00084 }//namespace Authorization 00085 00086 }//namespace qutim_sdk_0_3 00087 00088 00089 #endif // AUTHORIZATIONDIALOG_H 00090