summaryrefslogtreecommitdiffstats
path: root/ksirc/kstextview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ksirc/kstextview.cpp')
-rw-r--r--ksirc/kstextview.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/ksirc/kstextview.cpp b/ksirc/kstextview.cpp
index 151a3be6..bd43d82c 100644
--- a/ksirc/kstextview.cpp
+++ b/ksirc/kstextview.cpp
@@ -24,7 +24,7 @@
#include <tqvaluestack.h>
#include <tqdragobject.h>
#include <tqtimer.h>
-#include <clipboard.h>
+#include <tqclipboard.h>
#include <tqdict.h>
#include <kcharsets.h>
#include <kapplication.h>
@@ -245,7 +245,7 @@ Item *TextChunk::breakLine( int width )
return 0;
}
-Item::LayoutResetStatus TextChunk::resetLayout()
+Item::LayoutResettqStatus TextChunk::resetLayout()
{
if ( m_originalTextLength == 0 )
@@ -376,12 +376,12 @@ Item *TextChunk::hardBreak( const StringPtr &rightHandSide )
selStart->offset -= m_text.len;
selEnd->offset -= m_text.len;
selStart->item = selEnd->item = chunk;
- chunk->setSelectionStatus( m_selection );
+ chunk->setSelectiontqStatus( m_selection );
m_selection = NoSelection;
} else if ( selEnd->offset >= m_text.len ) {
selEnd->offset -= m_text.len;
selEnd->item = chunk;
- chunk->setSelectionStatus( SelectionEnd );
+ chunk->setSelectiontqStatus( SelectionEnd );
m_selection = SelectionStart;
}
}
@@ -389,7 +389,7 @@ Item *TextChunk::hardBreak( const StringPtr &rightHandSide )
if ( selection && selection->offset >= m_text.len ) {
selection->offset -= m_text.len;
selection->item = chunk;
- chunk->setSelectionStatus( m_selection );
+ chunk->setSelectiontqStatus( m_selection );
m_selection = NoSelection;
}
@@ -433,7 +433,7 @@ int TextChunk::paintSelection( TQPainter &p, int x, const StringPtr &text )
const int width = m_metrics.width( str );
- const TQColorGroup &cg = m_parag->textView()->colorGroup();
+ const TQColorGroup &cg = m_parag->textView()->tqcolorGroup();
if (m_props.bgSelColor.isValid())
p.fillRect( x, 0, width, height(), m_props.bgSelColor );
@@ -482,11 +482,11 @@ void TextChunk::mergeSelection( TextChunk *child, SelectionPoint *selection )
selection->item = this;
- if ( ( m_selection == SelectionStart && child->selectionStatus() == SelectionEnd ) ||
- ( m_selection == SelectionEnd && child->selectionStatus() == SelectionStart ) )
+ if ( ( m_selection == SelectionStart && child->selectiontqStatus() == SelectionEnd ) ||
+ ( m_selection == SelectionEnd && child->selectiontqStatus() == SelectionStart ) )
m_selection = SelectionBoth;
else
- m_selection = child->selectionStatus();
+ m_selection = child->selectiontqStatus();
}
ImageItem::ImageItem( TextParag *parag, const TQPixmap &pixmap )
@@ -512,7 +512,7 @@ void ImageItem::paint( TQPainter &painter )
if (m_props.bgSelColor.isValid())
painter.fillRect( 0, 0, width(), h, m_props.bgSelColor );
else {
- const TQColorGroup &cg = m_parag->textView()->colorGroup();
+ const TQColorGroup &cg = m_parag->textView()->tqcolorGroup();
painter.fillRect( 0, 0, width(), h, cg.highlight() );
}
}
@@ -520,7 +520,7 @@ void ImageItem::paint( TQPainter &painter )
painter.drawPixmap( 0, y, m_pixmap );
}
-Item::LayoutResetStatus ImageItem::resetLayout()
+Item::LayoutResettqStatus ImageItem::resetLayout()
{
// nothin' to do
return KeepItem;
@@ -645,7 +645,7 @@ bool Tokenizer::parseNextToken( Token &tok )
return false;
tok.id = Token::Text;
- tok.value = StringPtr( m_text.unicode() + idx,
+ tok.value = StringPtr( m_text.tqunicode() + idx,
m_text.length() - idx );
tok.attributes.clear();
return true;
@@ -658,7 +658,7 @@ bool Tokenizer::parseNextToken( Token &tok )
{
tok.id = Token::Text;
tok.attributes.clear();
- tok.value = StringPtr( m_text.unicode(),
+ tok.value = StringPtr( m_text.tqunicode(),
(*m_lastTag).index );
m_textBeforeFirstTagProcessed = true;
@@ -676,7 +676,7 @@ bool Tokenizer::parseNextToken( Token &tok )
if ( lastType == TagIndex::Open &&
type == TagIndex::Close )
{
- const TQChar *tagStart = m_text.unicode() + lastIndex + 1;
+ const TQChar *tagStart = m_text.tqunicode() + lastIndex + 1;
uint tagLen = ( index - 1 ) - ( lastIndex + 1 ) + 1;
// </bleh> ?
if ( *tagStart == '/' )
@@ -699,7 +699,7 @@ bool Tokenizer::parseNextToken( Token &tok )
{
tok.id = Token::Text;
tok.attributes.clear();
- tok.value = StringPtr( m_text.unicode() + lastIndex + 1,
+ tok.value = StringPtr( m_text.tqunicode() + lastIndex + 1,
( index - 1 ) - lastIndex );
m_lastTag = it;
@@ -715,7 +715,7 @@ bool Tokenizer::parseNextToken( Token &tok )
Tokenizer::TagIndexList Tokenizer::scanTagIndices( const TQString &text )
{
- const TQChar *start = text.unicode();
+ const TQChar *start = text.tqunicode();
const TQChar *p = start;
const TQChar *endP = p + text.length();
bool quoted = false;
@@ -754,7 +754,7 @@ Tokenizer::TagIndexList Tokenizer::scanTagIndices( const TQString &text )
void Tokenizer::resolveEntities( TQString &text, TagIndexList &tags )
{
- const TQChar *p = text.unicode();
+ const TQChar *p = text.tqunicode();
const TQChar *endP = p + text.length();
uint i = 0;
bool scanForSemicolon = false;
@@ -793,13 +793,13 @@ void Tokenizer::resolveEntities( TQString &text, TagIndexList &tags )
if ( entityValue.isNull() )
continue;
- const uint ampersandPos = ampersand - text.unicode();
+ const uint ampersandPos = ampersand - text.tqunicode();
text[ ampersandPos ] = entityValue;
text.remove( ampersandPos + 1, entityLength + 1 );
i = ampersandPos;
- p = text.unicode() + i;
- endP = text.unicode() + text.length();
+ p = text.tqunicode() + i;
+ endP = text.tqunicode() + text.length();
ampersand = 0;
uint adjustment = entityLength + 1;
@@ -1081,7 +1081,7 @@ TQString TextLine::updateSelection( const SelectionPoint &start, const Selection
{
if ( i == start.item )
{
- i->setSelectionStatus( Item::SelectionStart );
+ i->setSelectiontqStatus( Item::SelectionStart );
StringPtr txt = i->text();
if ( !txt.isNull() )
@@ -1090,7 +1090,7 @@ TQString TextLine::updateSelection( const SelectionPoint &start, const Selection
}
else if ( i == end.item )
{
- i->setSelectionStatus( Item::SelectionEnd );
+ i->setSelectiontqStatus( Item::SelectionEnd );
StringPtr txt = i->text();
if ( !txt.isNull() )
@@ -1098,7 +1098,7 @@ TQString TextLine::updateSelection( const SelectionPoint &start, const Selection
}
else
{
- i->setSelectionStatus( Item::InSelection );
+ i->setSelectiontqStatus( Item::InSelection );
selectedText += i->text().toTQString();
}
@@ -1111,7 +1111,7 @@ void TextLine::clearSelection()
{
Item *i = m_items.first();
for (; i; i = m_items.next() )
- i->setSelectionStatus( Item::NoSelection );
+ i->setSelectiontqStatus( Item::NoSelection );
}
void TextLine::appendItem( Item *i, int layoutUpdatePolicy )
@@ -1225,7 +1225,7 @@ TextParag::~TextParag()
{
}
-void TextParag::layout( int width )
+void TextParag::tqlayout( int width )
{
TQPtrList<Item> items;
@@ -1658,7 +1658,7 @@ void TextView::viewportResizeEvent( TQResizeEvent *ev )
TQScrollView::viewportResizeEvent(ev);
if ( ev->size().width() != ev->oldSize().width() )
- layout();
+ tqlayout();
int newdiff = ev->size().height() - ev->oldSize().height();
setContentsPos( 0, contentsY()-newdiff );
@@ -1720,7 +1720,7 @@ void TextView::clear()
stopAutoScroll();
clearSelection();
m_parags.clear();
- layout();
+ tqlayout();
viewport()->erase();
}
@@ -1728,7 +1728,7 @@ TextParagIterator TextView::appendParag( const TQString &richText )
{
TextParag *parag = new TextParag( this, richText );
m_parags.append( parag );
- layout( false );
+ tqlayout( false );
scrollToBottom();
TQPtrListIterator<TextParag> it( m_parags );
it.toLast();
@@ -1758,7 +1758,7 @@ bool TextView::removeParag( const TextParagIterator &parag )
if(m_selectionEnd.item != 0)
m_selectionEnd.pos.ry() -= height;
- //layout( false );
+ //tqlayout( false );
contentsChange(-height, true);
@@ -1768,14 +1768,14 @@ bool TextView::removeParag( const TextParagIterator &parag )
return true;
}
-void TextView::clearSelection( bool repaint )
+void TextView::clearSelection( bool tqrepaint )
{
m_selectionStart = SelectionPoint();
m_selectionEnd = SelectionPoint();
m_selectionEndBeforeStart = false;
m_selectedText = TQString();
clearSelectionInternal();
- if ( repaint )
+ if ( tqrepaint )
updateContents();
}
@@ -1814,7 +1814,7 @@ void TextView::setLinkColor( const TQColor &linkColor )
void TextView::copy()
{
- TQApplication::clipboard()->setText( m_selectedText );
+ TQApplication::tqclipboard()->setText( m_selectedText );
}
void TextView::clearSelectionInternal()
@@ -1840,7 +1840,7 @@ void TextView::contentsMousePressEvent( TQMouseEvent *ev )
Item *itemUnderMouse = itemAt( ev->pos(), &p, Item::SelectFuzzy );
if ( p.item && ( ev->button() & Qt::LeftButton ) ) {
m_selectionMaybeStart = p;
- p.item->setSelectionStatus( Item::NoSelection );
+ p.item->setSelectiontqStatus( Item::NoSelection );
}
if ( TextChunk *text = dynamic_cast<TextChunk *>( itemUnderMouse ) ) {
StringPtr href = text->props().attributes[ "href" ];
@@ -1953,7 +1953,7 @@ void TextView::contentsMouseReleaseEvent( TQMouseEvent *ev )
m_selectionMaybeStart = SelectionPoint();
if ( (ev->button() & Qt::LeftButton) && !m_selectedText.isEmpty() )
- TQApplication::clipboard()->setText( m_selectedText, TQClipboard::Selection );
+ TQApplication::tqclipboard()->setText( m_selectedText, TQClipboard::Selection );
if ( clicked ) {
emitLinkClickedForMouseEvent( ev );
@@ -1962,7 +1962,7 @@ void TextView::contentsMouseReleaseEvent( TQMouseEvent *ev )
if (ev->button() & Qt::MidButton)
{
- emit pasteReq( KApplication::clipboard()->text( TQClipboard::Selection ) );
+ emit pasteReq( KApplication::tqclipboard()->text( TQClipboard::Selection ) );
return;
}
}
@@ -1973,7 +1973,7 @@ void TextView::fontChange( const TQFont & )
for (; it.current(); ++it )
it.current()->fontChange( font() );
- layout( true );
+ tqlayout( true );
}
void TextView::startDrag()
@@ -2103,11 +2103,11 @@ TQString TextView::updateSelection( const SelectionPoint &start, const Selection
{
if ( start.pos.x() == end.pos.x() )
{
- i->setSelectionStatus( Item::NoSelection );
+ i->setSelectiontqStatus( Item::NoSelection );
return TQString();
}
- i->setSelectionStatus( Item::SelectionBoth );
+ i->setSelectiontqStatus( Item::SelectionBoth );
// ### ugly
const TextChunk *t = dynamic_cast<TextChunk *>( i );
@@ -2119,7 +2119,7 @@ TQString TextView::updateSelection( const SelectionPoint &start, const Selection
}
else
{
- i->setSelectionStatus( Item::SelectionBoth );
+ i->setSelectiontqStatus( Item::SelectionBoth );
// ### ugly
TextChunk *t = dynamic_cast<TextChunk *>( i );
@@ -2156,7 +2156,7 @@ TQString TextView::updateSelection( const SelectionPoint &start, const Selection
return selectedText;
}
-void TextView::layout( bool force )
+void TextView::tqlayout( bool force )
{
int height = 0;
int contentsWidth = visibleWidth();
@@ -2166,7 +2166,7 @@ void TextView::layout( bool force )
for (; it.current(); ++it )
{
if ( !it.current()->isLayouted() || force )
- it.current()->layout( width );
+ it.current()->tqlayout( width );
height += it.current()->height();
contentsWidth = kMax( contentsWidth, it.current()->minWidth() );
@@ -2182,7 +2182,7 @@ void TextView::layout( bool force )
void TextView::contentsChange(int heightChange, bool force)
{
if(m_height == -1){
- layout(force);
+ tqlayout(force);
}
else {
m_height += heightChange;
@@ -2248,7 +2248,7 @@ void TextParagIterator::setRichText( const TQString &richText )
m_paragIt.current()->setRichText( richText );
TextView *textView = m_paragIt.current()->textView();
- textView->layout( false );
+ textView->tqlayout( false );
if ( textView->isUpdatesEnabled() )
textView->updateContents();