//**************************************************************************** //! \file wtexter.hpp //! \date 17-10-2004 //! \class WTextHandler //! \brief The text handling class of the Weird Reader inherited from KTextEdit //**************************************************************************** // This file is part of Weird Reader. // // The Weird Reader is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // The Weird Reader 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 Weird Reader; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //**************************************************************************** #ifndef WTEXTER_HPP #define WTEXTER_HPP #include #include #include #include #include #include #include #include #include "wcommentui.hpp" class WCommentObject; //*************************************************************************** class WTextHandler : public KTextEdit //*************************************************************************** { Q_OBJECT int vlines;//!< number of visible lines int tlines;//!< total number of lines bool tend;//!< indicates wether the end has been reached allready protected: std::vector comments;//!< the comments container //! \brief sort the comments ascending after their occurence in the text void sort(); public slots: //! \brief open an ebook //! \param fname the ebook to be opened int open( QString &fname); //! \brief close the ebook void close(); //! \brief scroll one page up void pgUp(); //! \brief scroll one page down void pgDown(); //! \brief overloaded from KTextEdit to react to keyboard input too virtual void moveCursor( CursorAction action, bool select); public: //! \brief standard constructor //! \param parent the parent widget //! \param name the name of the widget WTextHandler ( QWidget *parent = 0, const char * name = 0); //! \brief the destructor ~WTextHandler() {}; //! to allow access to the comments friend class WCommentUI; }; #endif //WTEXTER_HPP