/usr/include/KTp/types.h is in libktp-dev 15.08.3-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | /*
* Common enums and types in KTp
*
* Copyright (C) 2013 David Edmundson <kde@davidedmundson.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KTP_TYPES_H
#define KTP_TYPES_H
#include "contact.h"
#include "core.h"
#include <TelepathyQt/TextChannel>
#include <TelepathyQt/Account>
#include <TelepathyQt/AccountManager>
#include <QVariant>
//this is deliberately the wrong namespace for backwards compatability, we will change it when the roles are sorted.
namespace KTp
{
enum RowType {
ContactRowType,
PersonRowType,
AccountRowType,
GroupRowType,
RoomRowType,
MergeRowType,
UserRowType = 1000
};
enum ContactsModelRole {
// general roles
RowTypeRole = Qt::UserRole, //returns one of KTp::ContactRowType, KTp::PersonRowType, KTp::GroupRowType, KTp::AccountRowType
IdRole, //returns Contact ID, Account UID, or group ID (group name or "_ungrouped")
PersonIdRole, ///< id of the corresponding contact/person resource in kpeople
//telepathy roles
ContactRole = Qt::UserRole + 1000, ///<return Tp::ContactPtr
AccountRole, ///< return Tp::AccountPtr
ChannelRole, ///< return Tp::ChannelPtr
//contact/person roles
ContactClientTypesRole = Qt::UserRole + 2000, ///< stringlist. See Tp::Contact::ClientTypes
ContactAvatarPathRole, ///<string. path to avatar file
ContactAvatarPixmapRole, ///< QPixmap the pixmap that shall be use as avatar image
ContactGroupsRole, ///< stringlist. of all groups contact is in
ContactPresenceNameRole,
ContactPresenceMessageRole,
ContactPresenceTypeRole,
ContactPresenceIconRole,
ContactSubscriptionStateRole, ///< enum of type Tp::Contact::PresenceState
ContactPublishStateRole, ///< enum of type Tp::Contact::PresenceState
ContactIsBlockedRole, ///< bool, true if contact is blocked
ContactHasTextChannelRole, ///< bool, returns true if a text channel is active for this contact
ContactUnreadMessageCountRole, ///< int. the number of unread messages in active channels with this contact
ContactLastMessageRole, ///string, the last message to/from this contact in an active chat
ContactLastMessageDirectionRole, //enum KTp::Message::MessageDirection direction of last message
ContactCanTextChatRole, ///< bool. You and contact can both text chat
ContactCanFileTransferRole, ///< bool. You and contact can both file transfer
ContactCanAudioCallRole, ///< bool. You and contact can both audio call
ContactCanVideoCallRole, ///< bool. You and contact can both video call
ContactTubesRole, ///< stringlist. common supported dbus + stream services between you and contact
ContactUriRole,
ContactVCardRole, ///< VCard of the contact in KContacts::Addresse format; KPeople only at the moment
//heading roles
HeaderTotalUsersRole = Qt::UserRole + 3000,
HeaderOnlineUsersRole,
CustomRole = Qt::UserRole + 4000 // a placemark for custom roles in inherited models
};
}
static const QString S_KPEOPLE_PROPERTY_ACCOUNT_PATH = QStringLiteral("telepathy-accountPath");
static const QString S_KPEOPLE_PROPERTY_CONTACT_ID = QStringLiteral("telepathy-contactId");
static const QString S_KPEOPLE_PROPERTY_CONTACT_URI = QStringLiteral("telepathy-contactUri");
static const QString S_KPEOPLE_PROPERTY_PRESENCE = QStringLiteral("telepathy-presence");
static const QString S_KPEOPLE_PROPERTY_IS_BLOCKED = QStringLiteral("telepathy-isBlocked");
const QHash<Tp::ConnectionPresenceType, QString> s_presenceStrings = {
{ Tp::ConnectionPresenceTypeUnset, QString() },
{ Tp::ConnectionPresenceTypeOffline, QStringLiteral("offline") },
{ Tp::ConnectionPresenceTypeAvailable, QStringLiteral("available") },
{ Tp::ConnectionPresenceTypeAway, QStringLiteral("away") },
{ Tp::ConnectionPresenceTypeExtendedAway, QStringLiteral("xa") },
{ Tp::ConnectionPresenceTypeHidden, QStringLiteral("hidden") }, //or 'offline' ?
{ Tp::ConnectionPresenceTypeBusy, QStringLiteral("busy") },
{ Tp::ConnectionPresenceTypeUnknown, QStringLiteral("unknown") },
{ Tp::ConnectionPresenceTypeError, QStringLiteral("error") }
};
Q_DECLARE_METATYPE(Tp::AccountPtr)
Q_DECLARE_METATYPE(KTp::ContactPtr)
Q_DECLARE_METATYPE(Tp::AccountManagerPtr);
Q_DECLARE_METATYPE(Tp::ConnectionPtr);
Q_DECLARE_METATYPE(Tp::TextChannelPtr);
Q_DECLARE_METATYPE(Tp::ChannelPtr);
#endif // KTP_TYPES_H
|