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

Nepomuk-Core

  • KTp
  • Models
contacts-model.h
Go to the documentation of this file.
1 /*
2  * Model of all accounts with inbuilt grouping and filtering
3  *
4  * Copyright (C) 2013 David Edmundson <kde@davidedmundson.co.uk>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef KTP_CONTACTS_MODEL_H
22 #define KTP_CONTACTS_MODEL_H
23 
24 #include <KTp/Models/contacts-filter-model.h>
25 #include <KTp/types.h>
26 #include <KTp/ktp-export.h>
27 
28 namespace KTp
29 {
30 
35 class KTP_EXPORT ContactsModel : public KTp::ContactsFilterModel
36 {
37  Q_OBJECT
38  Q_PROPERTY(GroupMode groupMode READ groupMode WRITE setGroupMode NOTIFY groupModeChanged)
39  Q_PROPERTY(bool trackUnreadMessages READ trackUnreadMessages WRITE setTrackUnreadMessages NOTIFY trackUnreadMessagesChanged)
40 
41  Q_PROPERTY(Tp::AccountManagerPtr accountManager READ accountManager WRITE setAccountManager)
42 
43  Q_ENUMS(GroupMode)
44 
45 public:
46  enum GroupMode {
48  NoGrouping,
50  AccountGrouping,
52  GroupGrouping
53  };
54 
55  ContactsModel(QObject *parent);
56 
57  virtual ~ContactsModel();
58 
60  void setAccountManager(const Tp::AccountManagerPtr &accountManager);
61 
63  Tp::AccountManagerPtr accountManager() const;
64 
66  void setGroupMode(GroupMode mode);
67 
69  GroupMode groupMode() const;
70 
74  void setTrackUnreadMessages(bool trackUnread);
75  bool trackUnreadMessages() const;
76 
77 protected:
78  //prevent previously public setSourceModel being called externally
79  virtual void setSourceModel(QAbstractItemModel *sourceModel);
80 
81 Q_SIGNALS:
82  void groupModeChanged();
83  void trackUnreadMessagesChanged();
84 
85 private:
86  class Private;
87  Private *d;
88 
89  void updateGroupProxyModels();
90 };
91 
92 }
93 
94 #endif // KTP_CONTACTS_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