00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 00002 /* 00003 * This file is part of the libetonyek project. 00004 * 00005 * This Source Code Form is subject to the terms of the Mozilla Public 00006 * License, v. 2.0. If a copy of the MPL was not distributed with this 00007 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 */ 00009 00010 #ifndef IWORKTEXTRECORDER_H_INCLUDED 00011 #define IWORKTEXTRECORDER_H_INCLUDED 00012 00013 #include <string> 00014 00015 #include <boost/shared_ptr.hpp> 00016 00017 #include "IWORKStyle_fwd.h" 00018 00019 namespace libetonyek 00020 { 00021 00022 class IWORKText; 00023 00024 class IWORKTextRecorder 00025 { 00026 public: 00027 IWORKTextRecorder(); 00028 00029 void replay(IWORKText &text) const; 00030 00031 void pushBaseLayoutStyle(const IWORKStylePtr_t &style); 00032 void pushBaseParagraphStyle(const IWORKStylePtr_t &style); 00033 00034 void setLayoutStyle(const IWORKStylePtr_t &style); 00035 void flushLayout(); 00036 00037 void setListStyle(const IWORKStylePtr_t &style); 00038 void setListLevel(const unsigned level); 00039 void flushList(); 00040 00041 void setParagraphStyle(const IWORKStylePtr_t &style); 00042 void flushParagraph(); 00043 00044 void setSpanStyle(const IWORKStylePtr_t &style); 00045 void setLanguage(const IWORKStylePtr_t &style); 00046 void flushSpan(); 00047 00048 void openLink(const std::string &url); 00049 void closeLink(); 00050 00051 void insertText(const std::string &text); 00052 void insertTab(); 00053 void insertSpace(); 00054 void insertLineBreak(); 00055 00056 private: 00057 struct Impl; 00058 00059 private: 00060 boost::shared_ptr<Impl> m_impl; 00061 }; 00062 00063 } 00064 00065 #endif // IWORKTEXTRECORDER_H_INCLUDED 00066 00067 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */