1 /*************************************************************************** 2 DocPostCard - a postcard version of the document 3 ------------------- 4 begin : Aug 2006 5 copyright : (C) 2006 by Klaas Freitag 6 email : freitag@kde.org 7 ***************************************************************************/ 8 9 /*************************************************************************** 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either version 2 of the License, or * 14 * (at your option) any later version. * 15 * * 16 ***************************************************************************/ 17 18 #ifndef DOCPOSTCARD_H 19 #define DOCPOSTCARD_H 20 21 #include <qstring.h> 22 #include "htmlview.h" 23 #include "kraftdoc.h" 24 25 class QUrl; 26 27 class DocPostCard : public HtmlView 28 { 29 Q_OBJECT 30 public: 31 enum DisplayMode { Full, Mini }; 32 33 DocPostCard( QWidget *parent = 0 ); 34 35 signals: 36 void selectPage( int ); 37 38 public slots: 39 void setHeaderData( const QString&, const QString&, const QString&, const QString&, const QString& ); 40 void setPositions( DocPositionList, DocPositionBase::TaxType, double, double ); 41 void setFooterData( const QString&, const QString& ); 42 void renderDoc( int id = -1 ); 43 void slotSetMode( DisplayMode, int id = -1 ); 44 void slotShowPrices( bool showIt ); 45 46 protected: 47 QString renderDocMini( int ) const; 48 QString renderDocFull( int ); 49 QString header(bool, const QString&, const QString&, const QString& protocol, 50 const QString& = QString() ) const; 51 52 private slots: 53 void slotUrlSelected( const QUrl& kurl); 54 55 private: 56 QString htmlify( const QString& ) const; 57 58 DocGuardedPtr mDoc; 59 QString mType; 60 QString mId; 61 QString mPreText; 62 QString mPostText; 63 QString mDate; 64 QString mAddress; 65 QString mPositions; 66 QString mGoodbye; 67 QString mTotal; 68 int mPositionCount; 69 DisplayMode mMode; 70 bool mShowPrices; 71 }; 72 73 #endif 74