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

Nepomuk-Core

  • KTp
types.h
Go to the documentation of this file.
1 /*
2  * Common enums and types in KTp
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_TYPES_H
22 #define KTP_TYPES_H
23 
24 #include "contact.h"
25 
26 #include <TelepathyQt/Account>
27 #include <TelepathyQt/AccountManager>
28 
29 #include <QVariant>
30 
31 //this is deliberately the wrong namespace for backwards compatability, we will change it when the roles are sorted.
32 namespace KTp
33 {
34  enum RowType {
35  ContactRowType,
36  PersonRowType,
37  AccountRowType,
38  GroupRowType,
39  UserRowType
40  };
41 
42  enum ContactsModelRole {
43  // general roles
44  RowTypeRole = Qt::UserRole, //returns one of KTp::ContactRowType, KTp::PersonRowType, KTp::GroupRowType, KTp::AccountRowType
45  IdRole, //returns Contact ID, Account UID, or group ID (group name or "_ungrouped")
46 
47  //telepathy roles
48  ContactRole = Qt::UserRole + 1000,
49  AccountRole,
50 
51  //contact/person roles
52  ContactClientTypesRole = Qt::UserRole + 2000,
53  ContactAvatarPathRole,
54  ContactAvatarPixmapRole,
55  ContactGroupsRole,
56 
57  ContactPresenceNameRole,
58  ContactPresenceMessageRole,
59  ContactPresenceTypeRole,
60  ContactPresenceIconRole,
61 
62  ContactSubscriptionStateRole,
63  ContactPublishStateRole,
64  ContactIsBlockedRole,
65 
66  ContactHasTextChannelRole,
67  ContactUnreadMessageCountRole,
68 
69  ContactCanTextChatRole,
70  ContactCanFileTransferRole,
71  ContactCanAudioCallRole,
72  ContactCanVideoCallRole,
73  ContactTubesRole,
74 
75  //heading roles
76  HeaderTotalUsersRole = Qt::UserRole + 3000,
77  HeaderOnlineUsersRole,
78 
79  CustomRole = Qt::UserRole + 4000 // a placemark for custom roles in inherited models
80  };
81 }
82 
83 Q_DECLARE_METATYPE(Tp::AccountPtr)
84 Q_DECLARE_METATYPE(KTp::ContactPtr)
85 Q_DECLARE_METATYPE(Tp::AccountManagerPtr);
86 
87 
88 #endif // KTP_TYPES_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