File indexing completed on 2024-05-12 04:35:07

0001 /* This file is part of the TikZKit project.
0002  *
0003  * Copyright (C) 2013-2014 Dominik Haumann <dhaumann@kde.org>
0004  *
0005  * This library is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU Library General Public License as published
0007  * by the Free Software Foundation, either version 2 of the License, or
0008  * (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  * GNU Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, see
0017  * <http://www.gnu.org/licenses/>.
0018  */
0019 
0020 #ifndef TIKZ_EXPORTER_H
0021 #define TIKZ_EXPORTER_H
0022 
0023 #include <QVector>
0024 #include <QString>
0025 
0026 namespace tikz {
0027 namespace core {
0028 
0029 class TikzLine
0030 {
0031 public:
0032     QString contents;
0033     QVector<qint64> deps;
0034 };
0035 
0036 /**
0037  * Class to generate valid TikZ code.
0038  */
0039 class TikzExport
0040 {
0041     public:
0042         /**
0043          * Default constructor.
0044          */
0045         TikzExport();
0046 
0047         /**
0048          * Destructor
0049          */
0050         virtual ~TikzExport();
0051 
0052     //
0053     // extra functions
0054     //
0055     public:
0056         /**
0057          * Convert the tikz::Document to tikzCode.
0058          */
0059         QString tikzCode();
0060 
0061     //
0062     // Functions to fill tikzpicture
0063     //
0064     public:
0065         /**
0066          * Sets the global option in begin{tikzpicture}[options]
0067          */
0068         void setDocumentOptions(const QString & options);
0069 
0070         /**
0071          * Add one TikZ command.
0072          */
0073         void addTikzLine(const TikzLine & line);
0074 
0075     //
0076     // private data
0077     //
0078     private:
0079         QString m_documentOptions;
0080         QVector<TikzLine> m_lines;
0081 };
0082 
0083 }
0084 }
0085 
0086 #endif // TIKZ_EXPORTER_H
0087 
0088 // kate: indent-width 4; replace-tabs on;