fix session id generator
[makneto-zunavac1.git] / src / backend / tree-node.h
blob70bdbf8fef7f575a9f917f114eb25355bb077b0a
1 /* *
2 * Tree model node
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
26 #include <QObject>
27 #include <QVariant>
28 #include "makneto-backend.h"
30 namespace MaknetoBackend {
32 class MAKNETO_EXPORT TreeNode : public QObject
34 Q_OBJECT
35 Q_DISABLE_COPY(TreeNode)
37 public:
38 TreeNode();
40 virtual ~TreeNode();
42 TreeNode *childAt(int index) const;
44 void addChild(TreeNode *node);
46 int indexOf(TreeNode *node) const;
48 int size() 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();
56 Q_SIGNALS:
57 void changed(TreeNode *);
58 void childrenAdded(TreeNode *parent, const QList<TreeNode *> &nodes);
59 void childrenRemoved(TreeNode *parent, int first, int last);
61 private:
62 struct Private;
63 friend struct Private;
64 Private *mPriv;
69 #endif // TELEPATHY_TREE_NODE_H