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

Nepomuk-Core

  • KTp
  • Declarative
conversations-model.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 CONVERSATIONS_MODEL_H
21 #define CONVERSATIONS_MODEL_H
22 
23 #include <QAbstractListModel>
24 
25 #include <TelepathyQt/AbstractClientApprover>
26 #include <KTp/contact.h>
27 
28 class Conversation;
29 
30 class ConversationsModel : public QAbstractListModel, public Tp::AbstractClientHandler
31 {
32  Q_OBJECT
33  Q_PROPERTY(int totalUnreadCount READ totalUnreadCount NOTIFY totalUnreadCountChanged)
34 
35  public:
36  explicit ConversationsModel(QObject *parent);
37  virtual ~ConversationsModel();
38 
39  virtual QVariant data ( const QModelIndex &index, int role = Qt::DisplayRole ) const;
40  virtual int rowCount ( const QModelIndex &parent = QModelIndex() ) const;
41 
43  int totalUnreadCount() const;
44 
45  enum role {
46  ConversationRole = Qt::UserRole
47  };
48 
49  void handleChannels(const Tp::MethodInvocationContextPtr<> &context,
50  const Tp::AccountPtr &account,
51  const Tp::ConnectionPtr &connection,
52  const QList<Tp::ChannelPtr> &channels,
53  const QList<Tp::ChannelRequestPtr> &channelRequests,
54  const QDateTime &userActionTime,
55  const HandlerInfo &handlerInfo);
56  bool bypassApproval() const;
57 
58  public Q_SLOTS:
59  void startChat(const Tp::AccountPtr &account, const KTp::ContactPtr &contact);
60  int nextActiveConversation(int first);
61 
62  private:
63  void removeConversation(Conversation* conversation);
64 
65  class ConversationsModelPrivate;
66  ConversationsModelPrivate *d;
67 
68  private Q_SLOTS:
69  void handleValidityChange(bool);
70  void conversationDelegated();
71 
72  Q_SIGNALS:
73  void totalUnreadCountChanged();
74 };
75 
76 #endif // CONVERSATIONS_MODEL_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