wxMaxima
FunCell.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-2016 Gunter Königsmann <wxMaxima@physikbuch.de>
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //
21 // SPDX-License-Identifier: GPL-2.0+
22 
23 #ifndef FUNCELL_H
24 #define FUNCELL_H
25 
26 #include "Cell.h"
52 class FunCell final : public Cell
53 {
54 public:
55  FunCell(GroupCell *group, Configuration **config,
56  std::unique_ptr<Cell> &&name, std::unique_ptr<Cell> &&arg);
57  FunCell(GroupCell *group, const FunCell &cell);
58  std::unique_ptr<Cell> Copy(GroupCell *group) const override;
59  const CellTypeInfo &GetInfo() override;
60 
61  int GetInnerCellCount() const override { return 2; }
62  // cppcheck-suppress objectIndex
63  Cell *GetInnerCell(int index) const override { return (&m_nameCell)[index].get(); }
64 
65  void Recalculate(AFontSize fontsize) override;
66 
67  void Draw(wxPoint point) override;
68 
69  wxString ToMathML() const override;
70  wxString ToMatlab() const override;
71  wxString ToOMML() const override;
72  wxString ToString() const override;
73  wxString ToTeX() const override;
74  wxString ToXML() const override;
75 
76  void SetAltCopyText(const wxString &text) override { m_altCopyText = text; }
77  const wxString &GetAltCopyText() const override { return m_altCopyText; }
78 
79  bool BreakUp() override;
80 
81  void SetNextToDraw(Cell *next) override;
82 
83 private:
85  wxString m_altCopyText;
86 
87  // The pointers below point to inner cells and must be kept contiguous.
88  // ** This is the draw list order. All pointers must be the same:
89  // ** either Cell * or std::unique_ptr<Cell>. NO OTHER TYPES are allowed.
90  std::unique_ptr<Cell> m_nameCell;
91  std::unique_ptr<Cell> m_argCell;
92  // The pointers above point to inner cells and must be kept contiguous.
93 
94 //** Bitfield objects (0 bytes)
95 //**
96  void InitBitFields()
97  { // Keep the initialization order below same as the order
98  // of bit fields in this class!
99  }
100 };
101 
102 #endif // FUNCELL_H
FunCell::ToOMML
wxString ToOMML() const override
Definition: FunCell.cpp:149
Cell.h
FunCell::GetInnerCellCount
int GetInnerCellCount() const override
The number of inner cells - for use by the iterators.
Definition: FunCell.h:61
FunCell::ToString
wxString ToString() const override
Returns the cell's representation as a string.
Definition: FunCell.cpp:86
FunCell::ToMatlab
wxString ToMatlab() const override
Convert this cell to its Matlab representation.
Definition: FunCell.cpp:95
FunCell::GetAltCopyText
const wxString & GetAltCopyText() const override
Get the text set using SetAltCopyText - may be empty.
Definition: FunCell.h:77
Cell
Definition: Cell.h:139
FunCell::ToXML
wxString ToXML() const override
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: FunCell.cpp:130
FunCell::ToMathML
wxString ToMathML() const override
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: FunCell.cpp:141
AFontSize
Definition: FontAttribs.h:97
FunCell::SetAltCopyText
void SetAltCopyText(const wxString &text) override
Definition: FunCell.h:76
FunCell::ToTeX
wxString ToTeX() const override
Convert this cell to its LaTeX representation.
Definition: FunCell.cpp:105
Configuration
Definition: Configuration.h:83
FunCell::GetInfo
const CellTypeInfo & GetInfo() override
Returns the information about this cell's type.
FunCell::Recalculate
void Recalculate(AFontSize fontsize) override
Definition: FunCell.cpp:54
FunCell::Copy
std::unique_ptr< Cell > Copy(GroupCell *group) const override
GroupCell
Definition: GroupCell.h:68
FunCell::BreakUp
bool BreakUp() override
Definition: FunCell.cpp:155
CellTypeInfo
A class that carries information about the type of a cell.
Definition: Cell.h:90
FunCell
Definition: FunCell.h:52
FunCell::GetInnerCell
Cell * GetInnerCell(int index) const override
Definition: FunCell.h:63
FunCell::SetNextToDraw
void SetNextToDraw(Cell *next) override
Definition: FunCell.cpp:170