kaddressbook

mikesstyle.h

00001 /*
00002     This file is part of KAddressBook.
00003     Copyright (c) 1996-2002 Mirko Boehm <mirko@kde.org>
00004                        2002 Mike Pilone <mpilone@slac.com>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of TQt, and distribute the resulting executable,
00022     without including the source code for TQt in the source distribution.
00023 */
00024 
00025 #ifndef MIKESSTYLE_H
00026 #define MIKESSTYLE_H
00027 
00028 #include <tqfont.h>
00029 
00030 #include "printstyle.h"
00031 
00032 namespace KABPrinting {
00033 
00034 class PrintProgress;
00035 
00036 class MikesStyle : public PrintStyle
00037 {
00038   Q_OBJECT
00039   TQ_OBJECT
00040 
00041   public:
00042     MikesStyle( PrintingWizard *parent, const char *name );
00043     ~MikesStyle();
00044 
00045     void print( const KABC::Addressee::List&, PrintProgress* );
00046 
00047   protected:
00048     void doPaint( TQPainter &painter, const KABC::Addressee &addr, int maxHeight,
00049                   const TQFont &font, const TQFont &bFont );
00050     int calcHeight( const KABC::Addressee &addr, const TQFont &font, const TQFont &bFont);
00051     void paintTagLine( TQPainter &p, const TQFont &font);
00052     TQString trimString( const TQString &text, int width, TQFontMetrics &fm);
00053 };
00054 
00055 class MikesStyleFactory : public PrintStyleFactory
00056 {
00057   public:
00058     MikesStyleFactory( PrintingWizard *parent, const char *name = 0 );
00059 
00060     PrintStyle *create() const;
00061     TQString description() const;
00062 };
00063 
00064 }
00065 
00066 #endif