/* This file is part of the KOffice project Copyright (C) 2002 Werner Trobin Copyright (C) 2002 David Faure This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef TEXTHANDLER_H #define TEXTHANDLER_H #include "tablehandler.h" #include "versionmagic.h" #include #include #include #include #include namespace wvWare { class Style; class Parser; class FunctorBase; namespace Word97 { class PAP; } } class KWordReplacementHandler : public wvWare::InlineReplacementHandler { public: virtual wvWare::U8 hardLineBreak(); virtual wvWare::U8 nonBreakingHyphen(); virtual wvWare::U8 nonRequiredHyphen(); }; class KWordTextHandler : public TQObject, public wvWare::TextHandler { Q_OBJECT public: KWordTextHandler( wvWare::SharedPtr parser ); void setFrameSetElement( const TQDomElement& frameset ); //////// TextHandler interface virtual void sectionStart( wvWare::SharedPtr sep ); virtual void sectionEnd(); virtual void pageBreak(); virtual void headersFound( const wvWare::HeaderFunctor& parseHeaders ); virtual void footnoteFound( wvWare::FootnoteData::Type type, wvWare::UChar character, wvWare::SharedPtr chp, const wvWare::FootnoteFunctor& parseFootnote ); virtual void paragraphStart( wvWare::SharedPtr paragraphProperties ); virtual void paragraphEnd(); virtual void fieldStart( const wvWare::FLD* fld, wvWare::SharedPtr chp ); virtual void fieldSeparator( const wvWare::FLD* fld, wvWare::SharedPtr chp ); virtual void fieldEnd( const wvWare::FLD* fld, wvWare::SharedPtr chp ); virtual void runOfText( const wvWare::UString& text, wvWare::SharedPtr chp ); virtual void tableRowFound( const wvWare::TableRowFunctor& functor, wvWare::SharedPtr tap ); #ifdef IMAGE_IMPORT virtual void pictureFound( const wvWare::PictureFunctor& picture, wvWare::SharedPtr picf, wvWare::SharedPtr chp ); #endif // IMAGE_IMPORT ///////// Our own interface, also used by processStyles // Called at the beginning of a parag/style void paragLayoutBegin(); // Write a tag from the given CHP // Returns that element into pChildElement if set (in that case even an empty FORMAT can be appended) void writeFormat( TQDomElement& parentElement, const wvWare::Word97::CHP* chp, const wvWare::Word97::CHP* refChp, int pos, int len, int formatId, TQDomElement* pChildElement ); // Write the _contents_ (children) of a or