kabentrypainter.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef KAB_PRINTMETHODS_H
00018 #define KAB_PRINTMETHODS_H
00019
00020 #include <qfont.h>
00021 #include <qcolor.h>
00022 #include <qvaluelist.h>
00023 #include <qrect.h>
00024 #include <kabc/addressbook.h>
00025
00026 typedef QValueList<QRect> QRectList;
00027
00028 class KABEntryPainter
00029 {
00030 public:
00031 KABEntryPainter(
00032 QColor foreColor_=Qt::black,
00033 QColor headerColor_=Qt::white, bool useHeaderColor=true,
00034 QColor backColor_=Qt::black,
00035 QFont header_=QFont("Helvetica", 12, QFont::Normal, true),
00036 QFont headlines_=QFont("Helvetica", 12, QFont::Normal, true),
00037 QFont body_=QFont("Helvetica", 12, QFont::Normal, true),
00038 QFont fixed_=QFont("Courier", 12, QFont::Normal, true),
00039 QFont comment_=QFont("Helvetica", 10, QFont::Normal, true),
00040 bool showAddresses_=true,
00041 bool showEmails_=true,
00042 bool showTelephones_=true,
00043 bool showURLs_=true);
00044 ~KABEntryPainter();
00059 bool printEntry(const KABC::Addressee&, const QRect& window,
00060 QPainter *,
00061 int top=0,
00062 bool fake=false,
00063 QRect *rect=0);
00064 void setShowAddresses(bool);
00065 void setShowEmails(bool);
00066 void setShowTelephones(bool);
00067 void setShowURLs(bool);
00072 int hitsEmail(QPoint p);
00075 int hitsTelephones(QPoint p);
00078 int hitsTalkAddresses(QPoint p);
00081 int hitsURLs(QPoint p);
00082 protected:
00083
00084 int hits(const QRectList& rects, QPoint p);
00085
00086 QColor foreColor;
00087
00088 QColor headerColor;
00089
00090 bool useHeaderColor;
00091
00092 QColor backColor;
00093
00094
00095 QFont header;
00096
00097 QFont headlines;
00098
00099 QFont body;
00100
00101 QFont fixed;
00102
00103 QFont comment;
00104
00105
00106 bool showAddresses;
00107
00108 bool showEmails;
00109
00110 bool showTelephones;
00111
00112 bool showURLs;
00113
00114
00115 QRectList emails;
00116
00117
00118 QRectList telephones;
00119
00120
00121 QRectList URLs;
00122
00123
00124 QRectList talk;
00125 };
00126
00127 #endif // KAB_PRINTMETHODS_H
This file is part of the documentation for kdelibs Version 3.1.5.