1
/***************************************************************************
2
* Copyright (C) 2003 by Jens Dagerbo *
3
* jens.dagerbo@swipnet.se *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
***************************************************************************/
12
#ifndef __REPLACEITEM_H__
13
#define __REPLACEITEM_H__
16
#include <kdeversion.h>
19
#include "replaceview.h"
21
class ReplaceItem : public QCheckListItem
25
ReplaceItem( ReplaceView * parent, ReplaceItem * after, QString file ) :
26
QCheckListItem( parent,
28
file, QCheckListItem::CheckBox ),
29
_file( file ), _string( file ), _line( 0 ), _isfile( true ),
30
_lineclicked( false ), _clicked( true )
37
ReplaceItem( ReplaceItem * parent, ReplaceItem * after, QString file, QString string, int line ) :
38
QCheckListItem( parent,
40
QString::number( line + 1 ) + ": " + string, QCheckListItem::CheckBox ),
41
_file( file ), _string( string ), _line( line ), _isfile( false ),
42
_lineclicked( false ), _clicked( true )
47
QString const & file() const
57
QString const & string() const
79
ReplaceItem * parent() const
81
return static_cast<ReplaceItem*>( QListViewItem::parent() );
84
ReplaceItem * firstChild() const
86
return static_cast<ReplaceItem*>( QListViewItem::firstChild() );
89
ReplaceItem * nextSibling() const
91
return static_cast<ReplaceItem*>( QListViewItem::nextSibling() );
94
void activate( int column, QPoint const & localPos );
95
bool hasCheckedChildren() const;
96
virtual void stateChange( bool state );
98
static bool s_listview_done;
101
void paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align );
102
void setChecked( bool checked );