summaryrefslogtreecommitdiffstats
path: root/src/svnfrontend/filelistviewitem.h
blob: 3c5780fc36b441193e4fb16e017c0f743221b0f8 (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
86
87
88
/***************************************************************************
 *   Copyright (C) 2005-2007 by Rajko Albrecht                             *
 *   [email protected]                                                   *
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
 ***************************************************************************/
#ifndef FILELISTVIEWITEM_H
#define FILELISTVIEWITEM_H

#include "svnitem.h"
#include <klistview.h>
#include <tqdatetime.h>
#include <tqptrlist.h>
#include "src/svnqt/svnqttypes.hpp"

class TQPainter;
class KFileItem;
class kdesvnfilelist;
class SvnActions;

/**
@author Rajko Albrecht
*/
class FileListViewItem : public KListViewItem,public SvnItem
{
    friend class kdesvnfilelist;
public:
    FileListViewItem(kdesvnfilelist*,const svn::StatusPtr&);
    FileListViewItem(kdesvnfilelist*,FileListViewItem*,const svn::StatusPtr&);

    virtual ~FileListViewItem();
    virtual int compare( TQListViewItem* i, int col, bool ascending ) const;

    virtual void updatetqStatus(const svn::StatusPtr&s);
    virtual void refreshtqStatus(bool childs=false,TQPtrList<SvnItem> *exclude = 0,bool depsonly=false);

#if 0
    virtual void refreshMe();
#endif

    void removeChilds();
    bool isParent(TQListViewItem*which);

    static const int COL_ICON,COL_NAME,COL_LAST_REV,COL_LAST_AUTHOR,COL_LAST_DATE,COL_STATUS/*,COL_CURRENT_REV*/,COL_IS_LOCKED;

    virtual TQString getParentDir()const;
    virtual SvnItem* getParentItem()const;
    virtual FileListViewItem*fItem(){return this;}
    virtual void setStat(const svn::StatusPtr&);
    virtual void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int tqalignment);
    virtual void setOpen(bool o);
    virtual void setOpenNoBlock(bool o);

    virtual void setPreviewPix(const TQPixmap& pixmap);
    virtual const svn::Revision&correctPeg()const;
    virtual FileListViewItem*findChild(const TQString&);

protected:
    TQColor m_highColor;
    short int sortChar;
    kdesvnfilelist*m_Ksvnfilelist;

    virtual void update();

    void makePixmap();
    void init();
    virtual SvnActions*getWrapper()const;
    SvnActions*m_SvnWrapper;
    TQPixmap m_Pixmap;
};

typedef TQPtrList<FileListViewItem> FileListViewItemList;
typedef TQPtrListIterator<FileListViewItem> FileListViewItemListIterator;

#endif