Home · All Classes · All Namespaces · Modules · Functions · Files

tree-node.h

00001 /*
00002  * This file is part of TelepathyQt4Yell Models
00003  *
00004  * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 #ifndef _TelepathyQt4Yell_Models_tree_node_h_HEADER_GUARD_
00022 #define _TelepathyQt4Yell_Models_tree_node_h_HEADER_GUARD_
00023 
00024 #ifndef IN_TELEPATHY_QT4_YELL_MODELS_HEADER
00025 #error IN_TELEPATHY_QT4_YELL_MODELS_HEADER
00026 #endif
00027 
00028 #include <TelepathyQt4Yell/Models/Global>
00029 
00030 #include <QObject>
00031 #include <QVariant>
00032 
00033 namespace Tpy
00034 {
00035 
00036 class TELEPATHY_QT4_YELL_MODELS_EXPORT TreeNode : public QObject
00037 {
00038     Q_OBJECT
00039     Q_DISABLE_COPY(TreeNode)
00040 
00041 public:
00042     TreeNode();
00043 
00044     virtual ~TreeNode();
00045 
00046     TreeNode *childAt(int index) const;
00047 
00048     void addChild(TreeNode *node);
00049 
00050     int indexOf(TreeNode *node) const;
00051 
00052     int size() const;
00053 
00054     TreeNode *parent() const;
00055 
00056     virtual QVariant data(int role) const;
00057     virtual bool setData(int role, const QVariant &value);
00058     virtual void remove();
00059 
00060 Q_SIGNALS:
00061     void changed(TreeNode *);
00062     void childrenAdded(TreeNode *parent, const QList<TreeNode *> &nodes);
00063     void childrenRemoved(TreeNode *parent, int first, int last);
00064 
00065 private:
00066     struct Private;
00067     friend struct Private;
00068     Private *mPriv;
00069 };
00070 
00071 }
00072 
00073 #endif // _TelepathyQt4Yell_Models_tree_node_h_HEADER_GUARD_


Copyright © 2008-2010 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4-Yell 0.1.6