• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kaddressbook

kabentrypainter.h

Go to the documentation of this file.
00001 /*
00002     This file is part of KAddressBook.
00003     Copyright (c) 1996-2002 Mirko Boehm <mirko@kde.org>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018 
00019     As a special exception, permission is given to link this program
00020     with any edition of Qt, and distribute the resulting executable,
00021     without including the source code for Qt in the source distribution.
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

kaddressbook

Skip menu "kaddressbook"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal