22 #include <tdeglobalsettings.h>
24 #include <libtdepim/htmldiffalgodisplay.h>
28 static TQString textToHTML( const TQString &text )
30 return TQStyleSheet::convertFromPlainText( text );
33 HTMLDiffAlgoDisplay::HTMLDiffAlgoDisplay( TQWidget *parent )
34 : KTextBrowser( parent )
36 setWrapPolicy( TQTextEdit::AtWordBoundary );
37 setVScrollBarMode( TQScrollView::AlwaysOff );
38 setHScrollBarMode( TQScrollView::AlwaysOff );
41 void HTMLDiffAlgoDisplay::begin()
46 mText.append( "<html>" );
47 mText.append( TQString( "<body text=\"%1\" bgcolor=\"%2\">" )
48 .arg( TDEGlobalSettings::textColor().name() )
49 .arg( TDEGlobalSettings::baseColor().name() ) );
51 mText.append( "<center><table>" );
52 mText.append( TQString( "<tr><th></th><th align=\"center\">%1</th><td> </td><th align=\"center\">%2</th></tr>" )
54 .arg( mRightTitle ) );
57 void HTMLDiffAlgoDisplay::end()
59 mText.append( "</table></center>"
66 void HTMLDiffAlgoDisplay::setLeftSourceTitle( const TQString &title )
71 void HTMLDiffAlgoDisplay::setRightSourceTitle( const TQString &title )
76 void HTMLDiffAlgoDisplay::additionalLeftField( const TQString & id, const TQString &value )
78 mText.append( TQString( "<tr><td align=\"right\"><b>%1:</b></td><td bgcolor=\"#9cff83\">%2</td><td></td><td></td></tr>" )
80 .arg( textToHTML( value ) ) );
83 void HTMLDiffAlgoDisplay::additionalRightField( const TQString & id, const TQString &value )
85 mText.append( TQString( "<tr><td align=\"right\"><b>%1:</b></td><td></td><td></td><td bgcolor=\"#9cff83\">%2</td></tr>" )
87 .arg( textToHTML( value ) ) );
90 void HTMLDiffAlgoDisplay::conflictField( const TQString & id, const TQString &leftValue,
91 const TQString &rightValue )
93 mText.append( TQString( "<tr><td align=\"right\"><b>%1:</b></td><td bgcolor=\"#ff8686\">%2</td><td></td><td bgcolor=\"#ff8686\">%3</td></tr>" )
95 .arg( textToHTML( leftValue ) )
96 .arg( textToHTML( rightValue ) ) );
TDEPIM classes for drag and drop of mails.
|