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 IWORKRECORDER_H_INCLUDED 00011 #define IWORKRECORDER_H_INCLUDED 00012 00013 #include <string> 00014 00015 #include <boost/optional.hpp> 00016 #include <boost/shared_ptr.hpp> 00017 00018 #include "IWORKPath_fwd.h" 00019 #include "IWORKStyle.h" 00020 #include "IWORKStylesheet.h" 00021 #include "IWORKTypes_fwd.h" 00022 00023 namespace libetonyek 00024 { 00025 00026 class IWORKCollector; 00027 class IWORKTable; 00028 class IWORKText; 00029 struct IWORKSize; 00030 00031 class IWORKRecorder 00032 { 00033 public: 00034 IWORKRecorder(); 00035 00036 void replay(IWORKCollector &collector) const; 00037 00038 // recorder functions 00039 00040 void collectStyle(const IWORKStylePtr_t &style); 00041 00042 void setGraphicStyle(const IWORKStylePtr_t &style); 00043 00044 void collectGeometry(const IWORKGeometryPtr_t &geometry); 00045 00046 void collectPath(const IWORKPathPtr_t &path); 00047 void collectImage(const IWORKImagePtr_t &image); 00048 void collectLine(const IWORKLinePtr_t &line); 00049 void collectShape(); 00050 00051 void collectMedia(const IWORKMediaContentPtr_t &content); 00052 00053 void collectStylesheet(const IWORKStylesheetPtr_t &stylesheet); 00054 00055 void collectTable(const boost::shared_ptr<IWORKTable> &table); 00056 void collectText(const boost::shared_ptr<IWORKText> &text); 00057 00058 void startGroup(); 00059 void endGroup(); 00060 00061 void startLevel(); 00062 void endLevel(); 00063 00064 void pushStylesheet(const IWORKStylesheetPtr_t &stylesheet); 00065 void popStylesheet(); 00066 00067 private: 00068 struct Impl; 00069 00070 private: 00071 boost::shared_ptr<Impl> m_impl; 00072 }; 00073 00074 } // namespace libetonyek 00075 00076 #endif // IWORKRECORDER_H_INCLUDED 00077 00078 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */