IWORKTableRecorder.h
Go to the documentation of this file.
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 IWORKTABLERECORDER_H_INCLUDED
00011 #define IWORKTABLERECORDER_H_INCLUDED
00012 
00013 #include <boost/optional.hpp>
00014 #include <boost/shared_ptr.hpp>
00015 
00016 #include "IWORKStyle_fwd.h"
00017 #include "IWORKTable.h"
00018 #include "IWORKTypes.h"
00019 
00020 namespace libetonyek
00021 {
00022 
00023 class IWORKText;
00024 
00025 class IWORKTableRecorder
00026 {
00027 public:
00028   IWORKTableRecorder();
00029 
00030   void replay(IWORKTable &table) const;
00031 
00032   void setSize(unsigned columns, unsigned rows);
00033   void setHeaders(unsigned headerColumns, unsigned headerRows, unsigned footerRows);
00034   void setBandedRows(bool banded);
00035   void setRepeated(bool columns, bool rows);
00036 
00037   void setStyle(const IWORKStylePtr_t &style);
00038   void setSizes(const IWORKColumnSizes_t &columnSizes, const IWORKRowSizes_t &rowSizes);
00039   void setBorders(const IWORKGridLineList_t &verticalLines, const IWORKGridLineList_t &horizontalLines);
00040   void insertCell(unsigned column, unsigned row, const boost::optional<std::string> &value, const boost::shared_ptr<IWORKText> &content, unsigned columnSpan, unsigned rowSpan, const boost::optional<IWORKFormula> &formula, const IWORKStylePtr_t &style, IWORKCellType type);
00041   void insertCoveredCell(unsigned column, unsigned row);
00042 
00043   void setDefaultCellStyle(IWORKTable::CellType type, const IWORKStylePtr_t &style);
00044   void setDefaultLayoutStyle(IWORKTable::CellType type, const IWORKStylePtr_t &style);
00045   void setDefaultParagraphStyle(IWORKTable::CellType type, const IWORKStylePtr_t &style);
00046 
00047 private:
00048   struct Impl;
00049 
00050 private:
00051   boost::shared_ptr<Impl> m_impl;
00052 };
00053 
00054 }
00055 
00056 #endif // IWORKTABLERECORDER_H_INCLUDED
00057 
00058 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */