/usr/include/KTp/Models/accounts-model.h is in libktpcommoninternalsprivate-dev 0.3.1-0ubuntu1.
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 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | /*
* Accounts and contacts model
* This file is based on TelepathyQtYell Models
*
* Copyright (C) 2010 Collabora Ltd. <info@collabora.co.uk>
* Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
*
* 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 TELEPATHY_ACCOUNTS_MODEL_H
#define TELEPATHY_ACCOUNTS_MODEL_H
#include <QAbstractListModel>
#include <TelepathyQt/Account>
#include <TelepathyQt/AccountManager>
#include <TelepathyQt/TextChannel>
#include <TelepathyQt/Types>
#include <KTp/ktp-export.h>
class ContactModelItem;
class TreeNode;
class KTP_EXPORT AccountsModel : public QAbstractItemModel
{
Q_OBJECT
Q_DISABLE_COPY(AccountsModel)
Q_PROPERTY(int accountCount READ accountCount NOTIFY accountCountChanged)
Q_ENUMS(Role)
public:
enum Role {
// general roles
ItemRole = Qt::UserRole,
AvatarRole,
IdRole,
// account roles
ValidRole,
EnabledRole,
ConnectionManagerNameRole,
ProtocolNameRole,
DisplayNameRole,
IconRole,
NicknameRole,
ConnectsAutomaticallyRole,
ChangingPresenceRole,
AutomaticPresenceRole,
AutomaticPresenceTypeRole,
AutomaticPresenceStatusMessageRole,
CurrentPresenceRole,
CurrentPresenceTypeRole,
CurrentPresenceStatusMessageRole,
RequestedPresenceRole,
RequestedPresenceTypeRole,
RequestedPresenceStatusMessageRole,
ConnectionStatusRole,
ConnectionStatusReasonRole,
// contact roles
AliasRole,
PresenceRole,
PresenceStatusRole,
PresenceTypeRole,
PresenceMessageRole,
SubscriptionStateRole,
PublishStateRole,
BlockedRole,
GroupsRole,
TextChatCapabilityRole,
MediaCallCapabilityRole,
AudioCallCapabilityRole,
VideoCallCapabilityRole,
UpgradeCallCapabilityRole,
FileTransferCapabilityRole,
DesktopSharingCapabilityRole,
TotalUsersCountRole,
OnlineUsersCountRole,
CustomRole // a placemark for custom roles in inherited models
};
explicit AccountsModel(QObject *parent = 0);
virtual ~AccountsModel();
void setAccountManager(const Tp::AccountManagerPtr &am);
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
virtual QVariant data(const QModelIndex &index, int role) const;
Tp::AccountPtr accountForContactItem(ContactModelItem* contactItem) const;
Tp::AccountPtr accountPtrForPath(const QString &accountPath) const;
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
virtual QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const;
virtual QModelIndex index(TreeNode *node) const;
virtual QModelIndex parent(const QModelIndex &index) const;
int accountCount() const;
Q_INVOKABLE QObject *accountItemForId(const QString &id) const;
Q_INVOKABLE QObject *contactItemForId(const QString &accountId, const QString &contactId) const;
Q_SIGNALS:
void accountCountChanged();
void accountConnectionStatusChanged(const QString &accountId, int status);
public Q_SLOTS:
void onNewAccount(const Tp::AccountPtr &account);
void onItemChanged(TreeNode *node);
void onItemsAdded(TreeNode *parent, const QList<TreeNode *> &nodes);
void onItemsRemoved(TreeNode *parent, int first, int last);
private:
struct Private;
friend struct Private;
Private *mPriv;
};
#endif // TELEPATHY_ACCOUNTS_MODEL_H
|