kaddressbook
kabentrypainter.h
Go 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 #ifndef KABENTRYPAINTER_H
00025 #define KABENTRYPAINTER_H
00026
00027 #include <kabc/addressbook.h>
00028
00029 #include <QtCore/QRect>
00030 #include <QtGui/QColor>
00031 #include <QtGui/QFont>
00032
00033 typedef QList<QRect> QRectList;
00034
00035 class KABEntryPainter
00036 {
00037 public:
00038 KABEntryPainter();
00039 ~KABEntryPainter();
00040
00060 bool printAddressee( const KABC::Addressee &addr, const QRect &window,
00061 QPainter *p, int top = 0, bool fake = false,
00062 QRect *rect = 0 );
00063
00064 void setForegroundColor( const QColor &color = Qt::black );
00065 void setBackgroundColor( const QColor &color = Qt::black );
00066 void setHeaderColor( const QColor &color = Qt::white );
00067
00068 void setHeaderFont( const QFont &font = QFont( "Helvetica", 12, QFont::Normal, true ) );
00069 void setHeadLineFont( const QFont &font = QFont( "Helvetica", 12, QFont::Normal, true ) );
00070 void setBodyFont( const QFont &font = QFont( "Helvetica", 12, QFont::Normal, true ) );
00071 void setFixedFont( const QFont &font = QFont( "Courier", 12, QFont::Normal, true ) );
00072 void setCommentFont( const QFont &font = QFont( "Helvetica", 10, QFont::Normal, true ) );
00073
00074 void setUseHeaderColor( bool value = true );
00075
00076 void setShowAddresses( bool value = true );
00077 void setShowEmails( bool value = true );
00078 void setShowPhones( bool value = true );
00079 void setShowURLs( bool value = true );
00080
00087 int hitsEmail( const QPoint &p );
00088
00093 int hitsPhone( const QPoint &p );
00094
00099 int hitsTalk( const QPoint &p );
00100
00105 int hitsURL( const QPoint &p );
00106
00107 private:
00108 int hits( const QRectList& rects, const QPoint &p );
00109
00110 QColor mForegroundColor;
00111 QColor mBackgroundColor;
00112 QColor mHeaderColor;
00113
00114 QFont mHeaderFont;
00115 QFont mHeadLineFont;
00116 QFont mBodyFont;
00117 QFont mFixedFont;
00118 QFont mCommentFont;
00119
00120 bool mUseHeaderColor;
00121 bool mShowAddresses;
00122 bool mShowEmails;
00123 bool mShowPhones;
00124 bool mShowURLs;
00125
00126 QRectList mEmailRects;
00127 QRectList mPhoneRects;
00128 QRectList mURLRects;
00129 QRectList mTalkRects;
00130 };
00131
00132 #endif