parts/replace/replaceitem.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
#ifndef __REPLACEITEM_H__
00013
#define __REPLACEITEM_H__
00014
00015
00016
#include <kdeversion.h>
00017
#include <kdebug.h>
00018
00019
#include "replaceview.h"
00020
00021 class ReplaceItem :
public QCheckListItem
00022 {
00023
public:
00024
00025 ReplaceItem(
ReplaceView * parent,
ReplaceItem * after,
QString file ) :
00026
QCheckListItem( parent,
00027 #if KDE_VERSION > 305
00028 after,
00029 #endif
00030
file,
QCheckListItem::CheckBox ),
00031
_file(
file ),
_string(
file ),
_line( 0 ),
_isfile( true ),
00032
_lineclicked( false ),
_clicked( true )
00033 {
00034 setOpen(
true );
00035 setOn(
true );
00036 }
00037
00038
00039 ReplaceItem(
ReplaceItem * parent,
ReplaceItem * after,
QString file,
QString string,
int line ) :
00040
QCheckListItem( parent,
00041 #if KDE_VERSION > 305
00042 after,
00043 #endif
00044
QString::number( line + 1 ) + ": " + string,
QCheckListItem::CheckBox ),
00045
_file(
file ),
_string( string ),
_line( line ),
_isfile( false ),
00046
_lineclicked( false ),
_clicked( true )
00047 {
00048 setOn(
true );
00049 }
00050
00051 QString const &
file()
const
00052
{
00053
return _file;
00054 }
00055
00056 int line()
const
00057
{
00058
return _line;
00059 }
00060
00061 QString const &
string()
const
00062
{
00063
return _string;
00064 }
00065
00066 bool isFile()
const
00067
{
00068
return _isfile;
00069 }
00070
00071 bool justClicked()
00072 {
00073
bool t =
_clicked;
00074 _clicked =
true;
00075
return t;
00076 }
00077
00078 bool lineClicked()
00079 {
00080
return _lineclicked;
00081 }
00082
00083 ReplaceItem *
parent()
const
00084
{
00085
return static_cast<ReplaceItem*>( QListViewItem::parent() );
00086 }
00087
00088 ReplaceItem *
firstChild()
const
00089
{
00090
return static_cast<ReplaceItem*>( QListViewItem::firstChild() );
00091 }
00092
00093 ReplaceItem *
nextSibling()
const
00094
{
00095
return static_cast<ReplaceItem*>( QListViewItem::nextSibling() );
00096 }
00097
00098
void activate(
int column,
QPoint const & localPos );
00099
bool hasCheckedChildren() const;
00100 virtual
void stateChange(
bool state );
00101
00102 static
bool s_listview_done;
00103
00104 private:
00105 #if KDE_VERSION > 305
00106
void paintCell(
QPainter * p, const
QColorGroup & cg,
int column,
int width,
int align );
00107 #endif
00108
void setChecked(
bool checked );
00109
00110 QString _file;
00111 QString _string;
00112 int _line;
00113 bool const _isfile;
00114 bool _lineclicked;
00115 bool _clicked;
00116 };
00117
00118 #endif
00119
This file is part of the documentation for KDevelop Version 3.0.4.