kabentrypainter.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KABENTRYPAINTER_H
00025 #define KABENTRYPAINTER_H
00026
00027 #include <kabc/addressbook.h>
00028
00029 #include <qcolor.h>
00030 #include <qfont.h>
00031 #include <qrect.h>
00032 #include <qvaluelist.h>
00033
00034 typedef QValueList<QRect> QRectList;
00035
00036 class KABEntryPainter
00037 {
00038 public:
00039 KABEntryPainter();
00040 ~KABEntryPainter();
00041
00061 bool printAddressee( const KABC::Addressee &addr, const QRect &window,
00062 QPainter *p, int top = 0, bool fake = false,
00063 QRect *rect = 0 );
00064
00065 void setForegroundColor( const QColor &color = Qt::black );
00066 void setBackgroundColor( const QColor &color = Qt::black );
00067 void setHeaderColor( const QColor &color = Qt::white );
00068
00069 void setHeaderFont( const QFont &font = QFont( "Helvetica", 12, QFont::Normal, true ) );
00070 void setHeadLineFont( const QFont &font = QFont( "Helvetica", 12, QFont::Normal, true ) );
00071 void setBodyFont( const QFont &font = QFont( "Helvetica", 12, QFont::Normal, true ) );
00072 void setFixedFont( const QFont &font = QFont( "Courier", 12, QFont::Normal, true ) );
00073 void setCommentFont( const QFont &font = QFont( "Helvetica", 10, QFont::Normal, true ) );
00074
00075 void setUseHeaderColor( bool value = true );
00076
00077 void setShowAddresses( bool value = true );
00078 void setShowEmails( bool value = true );
00079 void setShowPhones( bool value = true );
00080 void setShowURLs( bool value = true );
00081
00088 int hitsEmail( QPoint p );
00089
00094 int hitsPhone( QPoint p );
00095
00100 int hitsTalk( QPoint p );
00101
00106 int hitsURL( QPoint p );
00107
00108 private:
00109 int hits( const QRectList& rects, QPoint p );
00110
00111 QColor mForegroundColor;
00112 QColor mBackgroundColor;
00113 QColor mHeaderColor;
00114
00115 QFont mHeaderFont;
00116 QFont mHeadLineFont;
00117 QFont mBodyFont;
00118 QFont mFixedFont;
00119 QFont mCommentFont;
00120
00121 bool mUseHeaderColor;
00122 bool mShowAddresses;
00123 bool mShowEmails;
00124 bool mShowPhones;
00125 bool mShowURLs;
00126
00127 QRectList mEmailRects;
00128 QRectList mPhoneRects;
00129 QRectList mURLRects;
00130 QRectList mTalkRects;
00131 };
00132
00133 #endif
This file is part of the documentation for kaddressbook Library Version 3.2.2.