kmail
csshelper.cppGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #include "csshelper.h"
00033 #include "kmkernel.h"
00034
00035 #include "globalsettings.h"
00036
00037 #include <kconfig.h>
00038
00039 #include <qcolor.h>
00040 #include <qfont.h>
00041
00042 namespace KMail {
00043
00044 CSSHelper::CSSHelper( const QPaintDeviceMetrics &pdm ) :
00045 KPIM::CSSHelper( pdm )
00046 {
00047 KConfig * config = KMKernel::config();
00048
00049 KConfigGroup reader( config, "Reader" );
00050 KConfigGroup fonts( config, "Fonts" );
00051 KConfigGroup pixmaps( config, "Pixmaps" );
00052
00053 mRecycleQuoteColors = reader.readBoolEntry( "RecycleQuoteColors", false );
00054
00055 if ( !reader.readBoolEntry( "defaultColors", true ) ) {
00056 mForegroundColor = reader.readColorEntry("ForegroundColor",&mForegroundColor);
00057 mLinkColor = reader.readColorEntry("LinkColor",&mLinkColor);
00058 mVisitedLinkColor = reader.readColorEntry("FollowedColor",&mVisitedLinkColor);
00059 mBackgroundColor = reader.readColorEntry("BackgroundColor",&mBackgroundColor);
00060 cPgpEncrH = reader.readColorEntry( "PGPMessageEncr", &cPgpEncrH );
00061 cPgpOk1H = reader.readColorEntry( "PGPMessageOkKeyOk", &cPgpOk1H );
00062 cPgpOk0H = reader.readColorEntry( "PGPMessageOkKeyBad", &cPgpOk0H );
00063 cPgpWarnH = reader.readColorEntry( "PGPMessageWarn", &cPgpWarnH );
00064 cPgpErrH = reader.readColorEntry( "PGPMessageErr", &cPgpErrH );
00065 cHtmlWarning = reader.readColorEntry( "HTMLWarningColor", &cHtmlWarning );
00066 for ( int i = 0 ; i < 3 ; ++i ) {
00067 const QString key = "QuotedText" + QString::number( i+1 );
00068 mQuoteColor[i] = reader.readColorEntry( key, &mQuoteColor[i] );
00069 }
00070 }
00071
00072 if ( !fonts.readBoolEntry( "defaultFonts", true ) ) {
00073 mBodyFont = fonts.readFontEntry( "body-font", &mBodyFont);
00074 mPrintFont = fonts.readFontEntry( "print-font", &mPrintFont);
00075 mFixedFont = fonts.readFontEntry( "fixed-font", &mFixedFont);
00076 mFixedPrintFont = mFixedFont;
00077 QFont defaultFont = mBodyFont;
00078 defaultFont.setItalic( true );
00079 for ( int i = 0 ; i < 3 ; ++i ) {
00080 const QString key = QString( "quote%1-font" ).arg( i+1 );
00081 mQuoteFont[i] = fonts.readFontEntry( key, &defaultFont );
00082 }
00083 }
00084
00085 mShrinkQuotes = GlobalSettings::self()->shrinkQuotes();
00086
00087 mBackingPixmapStr = pixmaps.readPathEntry("Readerwin");
00088 mBackingPixmapOn = !mBackingPixmapStr.isEmpty();
00089
00090 recalculatePGPColors();
00091 }
00092 }
00093
|