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 <tqcolor.h>
00030 #include <tqfont.h>
00031 #include <tqrect.h>
00032 #include <tqvaluelist.h>
00033
00034 typedef TQValueList<TQRect> TQRectList;
00035
00036 class KABEntryPainter
00037 {
00038 public:
00039 KABEntryPainter();
00040 ~KABEntryPainter();
00041
00061 bool printAddressee( const KABC::Addressee &addr, const TQRect &window,
00062 TQPainter *p, int top = 0, bool fake = false,
00063 TQRect *rect = 0 );
00064
00065 void setForegroundColor( const TQColor &color = TQt::black );
00066 void setBackgroundColor( const TQColor &color = TQt::black );
00067 void setHeaderColor( const TQColor &color = TQt::white );
00068
00069 void setHeaderFont( const TQFont &font = TQFont( "Helvetica", 12, TQFont::Normal, true ) );
00070 void setHeadLineFont( const TQFont &font = TQFont( "Helvetica", 12, TQFont::Normal, true ) );
00071 void setBodyFont( const TQFont &font = TQFont( "Helvetica", 12, TQFont::Normal, true ) );
00072 void setFixedFont( const TQFont &font = TQFont( "Courier", 12, TQFont::Normal, true ) );
00073 void setCommentFont( const TQFont &font = TQFont( "Helvetica", 10, TQFont::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( const TQPoint &p );
00089
00094 int hitsPhone( const TQPoint &p );
00095
00100 int hitsTalk( const TQPoint &p );
00101
00106 int hitsURL( const TQPoint &p );
00107
00108 private:
00109 int hits( const TQRectList& rects, const TQPoint &p );
00110
00111 TQColor mForegroundColor;
00112 TQColor mBackgroundColor;
00113 TQColor mHeaderColor;
00114
00115 TQFont mHeaderFont;
00116 TQFont mHeadLineFont;
00117 TQFont mBodyFont;
00118 TQFont mFixedFont;
00119 TQFont mCommentFont;
00120
00121 bool mUseHeaderColor;
00122 bool mShowAddresses;
00123 bool mShowEmails;
00124 bool mShowPhones;
00125 bool mShowURLs;
00126
00127 TQRectList mEmailRects;
00128 TQRectList mPhoneRects;
00129 TQRectList mURLRects;
00130 TQRectList mTalkRects;
00131 };
00132
00133 #endif