/usr/include/KTp/Models/groups-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 | /*
* Contact groups model
* This file is based on TelepathyQtYell Models
*
* Copyright (C) 2010 Collabora Ltd. <info@collabora.com>
* 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_GROUPS_MODEL_H
#define TELEPATHY_GROUPS_MODEL_H
#include <QAbstractListModel>
#include <TelepathyQt/Account>
#include <TelepathyQt/AccountManager>
#include <TelepathyQt/TextChannel>
#include <TelepathyQt/Types>
#include <KTp/ktp-export.h>
class ContactModelItem;
class GroupsModelItem;
class AccountsModel;
class ProxyTreeNode;
class TreeNode;
class KTP_EXPORT GroupsModel : public QAbstractItemModel
{
Q_OBJECT
// Q_DISABLE_COPY(GroupsModel)const AccountsModel& am, QObject* parentconst AccontsModel& am, QObject* parent
// Q_PROPERTY(int accountCount READ accountCount NOTIFY accountCountChanged)
Q_ENUMS(Role)
public:
enum Role {
// general roles
GroupNameRole = Qt::DisplayRole
};
explicit GroupsModel(AccountsModel* am, QObject* parent = 0);
virtual ~GroupsModel();
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;
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;
void addContactToGroups(ContactModelItem* contactItem, QStringList groups = QStringList());
///Convenience classes for addContactToGroups
void addContactToGroups(ProxyTreeNode* proxyNode, const QString& group);
void addContactToGroups(ContactModelItem* contactItem, const QString& group);
void removeContactFromGroup(ProxyTreeNode* proxyNode, const QString& group);
Q_SIGNALS:
//a signal for reemitting the operation status, used for displaying errors in GUI
void operationFinished(Tp::PendingOperation *op);
private Q_SLOTS:
// void onNewAccount(const Tp::AccountPtr &account);
void onItemChanged(TreeNode *node);
void onSourceAccountAdded(const QModelIndex &parent, int start, int end);
void onItemsAdded(TreeNode *parent, const QList<TreeNode *> &nodes);
void onItemsRemoved(TreeNode *parent, int first, int last);
void onSourceContactsAdded(TreeNode *parent, const QList<TreeNode *> &nodes);
void onSourceContactsRemoved(TreeNode *parent, int first, int last);
void onContactAddedToGroup(const QString &group);
void onContactRemovedFromGroup(const QString &group);
private:
struct Private;
friend struct Private;
Private *mPriv;
};
#endif // TELEPATHY_GROUPS_MODEL_H
|