File indexing completed on 2024-04-21 05:50:20

0001 /* This file is part of the KDE project
0002    Copyright (C) 2005 Daniel Teske <teske@squorn.de>
0003 
0004    This program is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU General Public License as
0006    published by the Free Software Foundation; either version 2 of
0007    the License, or (at your option) version 3.
0008 
0009    This program is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012    GNU General Public License for more details.
0013 
0014    You should have received a copy of the GNU General Public License
0015    along with this program.  If not, see <http://www.gnu.org/licenses/>
0016 */
0017 
0018 #ifndef TREEITEM_P_H
0019 #define TREEITEM_P_H
0020 
0021 #include <KBookmark>
0022 #include <QList>
0023 
0024 class TreeItem
0025 {
0026 public:
0027     TreeItem(const KBookmark &bk, TreeItem *parent);
0028     ~TreeItem();
0029     TreeItem *child(int row);
0030     TreeItem *parent() const;
0031 
0032     void insertChildren(int first, int last);
0033     void deleteChildren(int first, int last);
0034     void moveChildren(int first, int last, TreeItem *newParent, int position);
0035     KBookmark bookmark() const;
0036     int childCount();
0037     TreeItem *treeItemForBookmark(const KBookmark &bk);
0038 
0039 private:
0040     void initChildren();
0041 
0042     QList<TreeItem *> children;
0043     TreeItem *mParent;
0044     KBookmark mBookmark;
0045     bool mInitDone;
0046 };
0047 #endif