2 This file is part of libkdepim.
4 Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
21 #ifndef KDEPIM_CATEGORYHIERARCHYREADER_H
22 #define KDEPIM_CATEGORYHIERARCHYREADER_H
24 #include "kdepim_export.h"
31 class QTreeWidgetItem
;
35 class KDEPIM_EXPORT CategoryHierarchyReader
38 void read( QStringList categories
);
39 virtual ~CategoryHierarchyReader() { }
40 static QStringList
path( QString string
);
42 CategoryHierarchyReader() { }
43 virtual void clear() = 0;
44 virtual void goUp() = 0;
45 virtual void addChild( const QString
&label
) = 0;
46 virtual int depth() const = 0;
49 class KDEPIM_EXPORT CategoryHierarchyReaderQComboBox
: public CategoryHierarchyReader
52 CategoryHierarchyReaderQComboBox( QComboBox
*box
)
53 : mBox( box
), mCurrentDepth( 0 ) { }
54 virtual ~CategoryHierarchyReaderQComboBox() { }
59 virtual void addChild( const QString
&label
);
60 virtual int depth() const;
66 class CategoryHierarchyReaderQTreeWidget
: public CategoryHierarchyReader
69 CategoryHierarchyReaderQTreeWidget( QTreeWidget
*tree
)
70 : mTree( tree
), mItem( 0 ), mCurrentDepth( 0 ) {}
71 virtual ~CategoryHierarchyReaderQTreeWidget() {}
76 virtual void addChild( const QString
&label
);
77 virtual int depth() const;
81 QTreeWidgetItem
*mItem
;