You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
96 lines
2.6 KiB
96 lines
2.6 KiB
15 years ago
|
#include "searchdcopinterface.h"
|
||
|
#include "searchinterface.h"
|
||
|
|
||
|
#include <dcopclient.h>
|
||
14 years ago
|
#include <tqregexp.h>
|
||
15 years ago
|
|
||
|
using namespace KTextEditor;
|
||
|
|
||
|
SearchDCOPInterface::SearchDCOPInterface( SearchInterface *Parent, const char *name)
|
||
|
: DCOPObject(name)
|
||
|
{
|
||
|
m_parent = Parent;
|
||
|
m_currentcol = 0;
|
||
|
m_currentrow = 0;
|
||
|
m_currentmatchlen = 0;
|
||
|
}
|
||
|
|
||
|
SearchDCOPInterface::~SearchDCOPInterface()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
14 years ago
|
bool SearchDCOPInterface::findFirstString( TQString text, bool caseSensitive)
|
||
15 years ago
|
{
|
||
|
return m_parent->searchText(0, 0, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive);
|
||
|
}
|
||
14 years ago
|
bool SearchDCOPInterface::findNextString( TQString text, bool caseSensitive)
|
||
15 years ago
|
{
|
||
|
return m_parent->searchText(m_currentrow, m_currentcol+1, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive);
|
||
|
}
|
||
|
|
||
14 years ago
|
bool SearchDCOPInterface::findPreviousString( TQString text, bool caseSensitive)
|
||
15 years ago
|
{
|
||
|
if( m_currentcol == 0)
|
||
|
m_currentrow--;
|
||
|
else
|
||
|
m_currentcol--;
|
||
|
return m_parent->searchText(m_currentrow, m_currentcol, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive, true);
|
||
|
}
|
||
|
|
||
14 years ago
|
bool SearchDCOPInterface::findLastString( TQString text, bool caseSensitive)
|
||
15 years ago
|
{
|
||
|
return m_parent->searchText(0,0, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive, true);
|
||
|
}
|
||
|
|
||
14 years ago
|
bool SearchDCOPInterface::findStringAt( uint row, uint col, TQString text, bool caseSensitive)
|
||
15 years ago
|
{
|
||
|
return m_parent->searchText(row,col, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive);
|
||
|
|
||
|
}
|
||
|
|
||
14 years ago
|
bool SearchDCOPInterface::findFirstRegExp( TQString regexp)
|
||
15 years ago
|
{
|
||
14 years ago
|
return m_parent->searchText( 0,0, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen);
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
bool SearchDCOPInterface::findNextRegExp( TQString regexp)
|
||
15 years ago
|
{
|
||
14 years ago
|
return m_parent->searchText( m_currentrow, m_currentcol+1, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen);
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
bool SearchDCOPInterface::findPreviousRegExp( TQString regexp)
|
||
15 years ago
|
{
|
||
|
if( m_currentcol == 0)
|
||
|
m_currentrow--;
|
||
|
else
|
||
|
m_currentcol--;
|
||
14 years ago
|
return m_parent->searchText( m_currentrow, m_currentcol, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen, true);
|
||
15 years ago
|
|
||
|
}
|
||
|
|
||
14 years ago
|
bool SearchDCOPInterface::findLastRegExp(TQString regexp)
|
||
15 years ago
|
{
|
||
14 years ago
|
return m_parent->searchText( 0,0, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen, true);
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
bool SearchDCOPInterface::findRegExpAt( uint row, uint col, TQString regexp)
|
||
15 years ago
|
{
|
||
14 years ago
|
return m_parent->searchText( row, col, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen, false);
|
||
15 years ago
|
}
|
||
|
|
||
|
uint SearchDCOPInterface::currentMatchLine()
|
||
|
{
|
||
|
return m_currentrow;
|
||
|
}
|
||
|
uint SearchDCOPInterface::currentMatchCol()
|
||
|
{
|
||
|
return m_currentcol;
|
||
|
}
|
||
|
uint SearchDCOPInterface::currentMatchLength()
|
||
|
{
|
||
|
return m_currentmatchlen;
|
||
|
}
|
||
|
|
||
|
|