• Skip to content
  • Skip to link menu
  • KDE API Reference
  • KDE Home
  • Contact Us
 

Nepomuk-Core

  • KTp
  • Declarative
conversation-target.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 Lasath Fernando <kde@lasath.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 
20 #ifndef CONVERSATION_TARGET_H
21 #define CONVERSATION_TARGET_H
22 
23 #include <QObject>
24 #include <QIcon>
25 
26 #include "KTp/types.h"
27 
28 class ConversationTarget : public QObject
29 {
30  Q_OBJECT
31 
32  Q_PROPERTY(QIcon avatar READ avatar NOTIFY avatarChanged);
33  Q_PROPERTY(QString nick READ nick NOTIFY nickChanged);
34  Q_PROPERTY(QIcon presenceIcon READ presenceIcon NOTIFY presenceIconChanged);
35  Q_PROPERTY(QString presenceIconName READ presenceIconName NOTIFY presenceIconNameChanged)
36  Q_PROPERTY(QString id READ id CONSTANT)
37  Q_PROPERTY(KTp::ContactPtr contact READ contact CONSTANT)
38  Q_PROPERTY(Tp::AccountPtr account READ account CONSTANT)
39 
40  public:
41  explicit ConversationTarget(const Tp::AccountPtr &account, const KTp::ContactPtr &contact, QObject *parent = 0);
42  virtual ~ConversationTarget();
43 
44  QIcon avatar() const;
45  QString id() const;
46  QString nick() const;
47  QIcon presenceIcon() const;
48  QString presenceIconName() const;
49 
50  KTp::ContactPtr contact() const;
51  Tp::AccountPtr account() const;
52 
53  Q_SIGNALS:
54  void avatarChanged(QIcon avatar);
55  void nickChanged(QString nick);
56  void presenceIconChanged(QIcon icon);
57  void presenceIconNameChanged(QString icon);
58 
59  private Q_SLOTS:
60  void onAvatarDataChanged();
61  void onPresenceChanged();
62 
63  private:
64  void setupContactSignals(KTp::ContactPtr contact);
65  void updateAvatar();
66 
67  class ConversationTargetPrivate;
68  ConversationTargetPrivate *d;
69 };
70 
71 Q_DECLARE_METATYPE(ConversationTarget*)
72 
73 #endif // CONVERSATION_TARGET_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Fri Mar 22 2013 10:58:52 by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ktp-common-internals API Reference

Skip menu "ktp-common-internals API Reference"
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal