3 * This file is based on TelepathyQt4Yell Models
5 * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
6 * Copyright (C) 2011 Martin Klapetek <martin dot klapetek at gmail dot com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef TELEPATHY_TREE_NODE_H
24 #define TELEPATHY_TREE_NODE_H
28 #include "makneto-backend.h"
30 namespace MaknetoBackend
{
32 class MAKNETO_EXPORT TreeNode
: public QObject
35 Q_DISABLE_COPY(TreeNode
)
42 TreeNode
*childAt(int index
) const;
44 void addChild(TreeNode
*node
);
46 int indexOf(TreeNode
*node
) const;
50 TreeNode
*parent() const;
52 virtual QVariant
data(int role
) const;
53 virtual bool setData(int role
, const QVariant
&value
);
54 virtual void remove();
57 void changed(TreeNode
*);
58 void childrenAdded(TreeNode
*parent
, const QList
<TreeNode
*> &nodes
);
59 void childrenRemoved(TreeNode
*parent
, int first
, int last
);
63 friend struct Private
;
69 #endif // TELEPATHY_TREE_NODE_H