/* * Common enums and types in KTp * * Copyright (C) 2013 David Edmundson * * 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 #include #include #include #include //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, /// 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::AccountSetPtr); 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