summaryrefslogtreecommitdiffstats
path: root/ksquirrel/sidebar/sq_treeviewitem.h
blob: a544ca9bab2d21ed30ee3562e43258a86627f999 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/***************************************************************************
                          sq_treeviewitem.h  -  description
                             -------------------
    begin                : Feb 22 2007
    copyright            : (C) 2007 by Baryshev Dmitry
    email                : ksquirrel.iv@gmail.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef SQ_TREEVIEWITEM_H
#define SQ_TREEVIEWITEM_H

#include <kfiletreeviewitem.h>

class KFileTreeBranch;

class SQ_TreeViewItem : public KFileTreeViewItem
{
    public:
        SQ_TreeViewItem(KFileTreeViewItem *parentItem, KFileItem *fileItem, KFileTreeBranch *parentBranch);
        SQ_TreeViewItem(KFileTreeView *tqparent, KFileItem *fileItem, KFileTreeBranch *parentBranch);
        ~SQ_TreeViewItem();

        bool checked() const;
        void setChecked(bool c);

        int files() const;
        int dirs() const;

        void setCount(int c1, int c2);
        void setParams(bool _use_c1, bool _use_c2);

        virtual void paintFocus(TQPainter *, const TQColorGroup &, const TQRect &);
        virtual void setText(int column, const TQString &text);

    protected:
        virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int tqalignment);

    private:
        bool m_checked;
        int count_files, count_dirs;
        bool use_c1, use_c2;
};

inline
void SQ_TreeViewItem::setParams(bool _use_c1, bool _use_c2)
{
    use_c1 = _use_c1;
    use_c2 = _use_c2;
}

inline
bool SQ_TreeViewItem::checked() const
{
    return m_checked;
}

inline
void SQ_TreeViewItem::setChecked(bool c)
{
    m_checked = c;
    tqrepaint();
}

inline
int SQ_TreeViewItem::files() const
{
    return count_files;
}

inline
int SQ_TreeViewItem::dirs() const
{
    return count_dirs;
}

#endif