wxMaxima
AbsCell.h
Go to the documentation of this file.
1 // -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2 //
3 // Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4 // (C) 2014-2018 Gunter Königsmann <wxMaxima@physikbuch.de>
5 // (C) 2020 Kuba Ober <kuba@bertec.com>
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 //
22 // SPDX-License-Identifier: GPL-2.0+
23 
31 #ifndef ABSCELL_H
32 #define ABSCELL_H
33 
34 #include "Cell.h"
35 
54 class AbsCell final : public Cell
55 {
56 public:
57  AbsCell(GroupCell *group, Configuration **config, std::unique_ptr<Cell> &&inner);
58  AbsCell(GroupCell *group, const AbsCell &cell);
59  std::unique_ptr<Cell> Copy(GroupCell *group) const override;
60  const CellTypeInfo &GetInfo() override;
61 
62  int GetInnerCellCount() const override { return 3; }
63  // cppcheck-suppress objectIndex
64  Cell *GetInnerCell(int index) const override { return (&m_open)[index].get(); }
65 
66  bool BreakUp() override;
67 
68  void Recalculate(AFontSize fontsize) override;
69 
70  void Draw(wxPoint point) override;
71 
72  wxString ToMathML() const override;
73  wxString ToMatlab() const override;
74  wxString ToOMML() const override;
75  wxString ToString() const override;
76  wxString ToTeX() const override;
77  wxString ToXML() const override;
78 
79  void SetNextToDraw(Cell *next) override;
80 
81 private:
82  void MakeBreakupCells();
83 
84  // The pointers below point to inner cells and must be kept contiguous.
85  // ** This is the draw list order. All pointers must be the same:
86  // ** either Cell * or std::unique_ptr<Cell>. NO OTHER TYPES are allowed.
88  std::unique_ptr<Cell> m_open;
90  std::unique_ptr<Cell> m_innerCell;
92  std::unique_ptr<Cell> m_close;
93  // The pointers above point to inner cells and must be kept contiguous.
94 
95 //** Bitfield objects (0 bytes)
96 //**
97  void InitBitFields()
98  { // Keep the initialization order below same as the order
99  // of bit fields in this class!
100  }
101 };
102 
103 #endif // ABSCELL_H
Cell.h
AbsCell::ToMathML
wxString ToMathML() const override
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: AbsCell.cpp:132
AbsCell::Copy
std::unique_ptr< Cell > Copy(GroupCell *group) const override
AbsCell::SetNextToDraw
void SetNextToDraw(Cell *next) override
Definition: AbsCell.cpp:172
AbsCell::BreakUp
bool BreakUp() override
Definition: AbsCell.cpp:155
AbsCell::Recalculate
void Recalculate(AFontSize fontsize) override
Definition: AbsCell.cpp:63
AbsCell::GetInfo
const CellTypeInfo & GetInfo() override
Returns the information about this cell's type.
AbsCell::GetInnerCellCount
int GetInnerCellCount() const override
The number of inner cells - for use by the iterators.
Definition: AbsCell.h:62
AbsCell::GetInnerCell
Cell * GetInnerCell(int index) const override
Definition: AbsCell.h:64
AbsCell
Definition: AbsCell.h:54
Cell
Definition: Cell.h:139
AFontSize
Definition: FontAttribs.h:97
AbsCell::ToOMML
wxString ToOMML() const override
Definition: AbsCell.cpp:140
Configuration
Definition: Configuration.h:83
AbsCell::ToXML
wxString ToXML() const override
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: AbsCell.cpp:146
AbsCell::ToTeX
wxString ToTeX() const override
Convert this cell to its LaTeX representation.
Definition: AbsCell.cpp:125
GroupCell
Definition: GroupCell.h:68
CellTypeInfo
A class that carries information about the type of a cell.
Definition: Cell.h:90
AbsCell::ToMatlab
wxString ToMatlab() const override
Convert this cell to its Matlab representation.
Definition: AbsCell.cpp:116
AbsCell::ToString
wxString ToString() const override
Returns the cell's representation as a string.
Definition: AbsCell.cpp:107