libqutim  0.3.1.0
buddy.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** qutIM - instant messenger
4 **
5 ** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
6 **
7 *****************************************************************************
8 **
9 ** $QUTIM_BEGIN_LICENSE$
10 ** This program is free software: you can redistribute it and/or modify
11 ** it under the terms of the GNU General Public License as published by
12 ** the Free Software Foundation, either version 3 of the License, or
13 ** (at your option) any later version.
14 **
15 ** This program is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 ** See the GNU General Public License for more details.
19 **
20 ** You should have received a copy of the GNU General Public License
21 ** along with this program. If not, see http://www.gnu.org/licenses/.
22 ** $QUTIM_END_LICENSE$
23 **
24 ****************************************************************************/
25 #ifndef BUDDY_H
26 #define BUDDY_H
27 
28 #include "chatunit.h"
29 #include "status.h"
30 #include <QIcon>
31 #include <QMetaType>
32 
33 namespace qutim_sdk_0_3
34 {
35 class Account;
36 class Message;
37 class BuddyPrivate;
38 
40 {
41  Q_OBJECT
42  Q_DECLARE_PRIVATE(Buddy)
43  Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
44  Q_PROPERTY(QString avatar READ avatar NOTIFY avatarChanged)
45  Q_PROPERTY(qutim_sdk_0_3::Status status READ status NOTIFY statusChanged)
46 public:
47  Buddy(Account *account);
48  Buddy(BuddyPrivate &d, Account *account);
49  virtual ~Buddy();
53  virtual QString avatar() const;
59  virtual QString title() const;
60  virtual QString name() const;
61  virtual Status status() const;
67  virtual bool sendMessage(const Message &message) = 0;
68  virtual void setName(const QString &name);
69 // virtual void setStatus(const Status &);
70 signals:
71  void avatarChanged(const QString &path);
72  void statusChanged(const qutim_sdk_0_3::Status &current, const qutim_sdk_0_3::Status &previous);
73  void nameChanged(const QString &current, const QString &previous);
74 protected:
75  bool event(QEvent *ev);
76 private:
77  //TODO move to protocols
78  Q_PRIVATE_SLOT(d_func(), void _q_status_changed(const qutim_sdk_0_3::Status &now,const qutim_sdk_0_3::Status &old))
79 };
80 }
81 
82 Q_DECLARE_METATYPE(qutim_sdk_0_3::Buddy*)
83 Q_DECLARE_METATYPE(QList<qutim_sdk_0_3::Buddy*>)
84 
85 #endif // BUDDY_H
86 

Generated by Doxygen