File indexing completed on 2024-05-12 16:29:17

0001 /*
0002  *  Copyright (c) 2010 Carlos Licea <carlos@kdab.com>
0003  *
0004  *  This library is free software; you can redistribute it and/or modify
0005  *  it under the terms of the GNU Lesser General Public License as published
0006  *  by the Free Software Foundation; either version 2.1 of the License, or
0007  *  (at your option) any later version.
0008  *
0009  *  This library is distributed in the hope that it will be useful,
0010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012  *  GNU Lesser General Public License for more details.
0013  *
0014  *  You should have received a copy of the GNU Lesser General Public License
0015  *  along with this program; if not, write to the Free Software
0016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0017  */
0018 
0019 #ifndef KORAWCELLCHILD_H
0020 #define KORAWCELLCHILD_H
0021 
0022 #include <QByteArray>
0023 
0024 #include "KoCellChild.h"
0025 #include "koodf2_export.h"
0026 
0027 
0028 /**
0029  * \class KoRawCellChild
0030  * \brief This class is a Cell child that can take any given QBuffer 
0031  * and will insert its contents blindly.
0032  * 
0033  * Its purpose is to allow the user to insert custom elements or elements for
0034  * which the appropriate class has not been provided.
0035  *
0036  * \note The class will insert its content "blindly," so, invalid XML or ODF *can* be created.
0037  * It's the user's responsibility to ensure that it's not the case.
0038  * \note KoRawCellData takes ownership of the given buffer.
0039  */
0040 class KOODF2_EXPORT KoRawCellChild : public KoCellChild
0041 {
0042 public:
0043     explicit KoRawCellChild(const QByteArray &content);
0044     ~KoRawCellChild() override;
0045 
0046 protected:
0047     void saveOdf(KoXmlWriter& writer, KoGenStyles& styles) const override;
0048 
0049 private:
0050     QByteArray m_content;
0051 };
0052 
0053 #endif