wxMaxima
ImgCellBase.h
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-2015 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 IMGCELLBASE_H
24 #define IMGCELLBASE_H
25 
26 #include "Cell.h"
27 #include <wx/image.h>
28 #include "Image.h"
29 
30 #include <wx/filesys.h>
31 #include <wx/fs_arc.h>
32 
33 /* ! The base class of ImgCell and Animation
34 
35 Images and animation share most of the functionality with each other => we
36 can generate a class ImgCellBase that allows us to create pointers that both
37 can point to an ImgCell and an Animation and that can use the methods common
38 to both
39  */
40 class ImgCellBase : public Cell
41 {
42 public:
43  ImgCellBase(GroupCell *group, Configuration **config);
44 
45  virtual std::unique_ptr<Cell> Copy(GroupCell *group) const override = 0;
46  virtual const CellTypeInfo &GetInfo() override = 0;
47  virtual ~ImgCellBase() override;
48 
50  ImgCellBase &operator=(const ImgCellBase&) = delete;
51 
53  virtual wxString GnuplotSource() const override = 0;
54 
56  virtual void SetPPI(int ppi) = 0;
57  virtual int GetPPI() const = 0;
58  virtual size_t GetOriginalWidth() const = 0;
59  virtual size_t GetOriginalHeight() const = 0;
60 
62  virtual bool CanExportSVG() const = 0;
63 
64  friend class AnimationCell;
65 
74  virtual wxSize ToImageFile(wxString filename) = 0;
75 
81  virtual void ClearCache() override = 0;
82 
83  virtual const wxString &GetToolTip(wxPoint point) const override = 0;
84 
86  virtual bool CopyToClipboard() const override = 0;
87 
89  virtual wxString GetExtension() const = 0;
90 
91  virtual double GetMaxWidth() const = 0;
92  virtual double GetHeightList() const = 0;
93  virtual void SetMaxWidth(double width) = 0;
94  virtual void SetMaxHeight(double height) = 0;
95 
96  virtual void Recalculate(AFontSize fontsize) override = 0;
97 
98  virtual void Draw(wxPoint point) override = 0;
99 
100  virtual wxString ToMatlab() const override = 0;
101  virtual wxString ToRTF() const override = 0;
102  virtual wxString ToString() const override = 0;
103  virtual wxString ToTeX() const override = 0;
104  virtual wxString ToXML() const override = 0;
105 
106  virtual bool CanPopOut() const override = 0;
107 };
108 
109 #endif // IMGCELLBASE_H
ImgCellBase::GnuplotSource
virtual wxString GnuplotSource() const override=0
The name of the file with gnuplot commands that created this file.
Cell.h
ImgCellBase::ToXML
virtual wxString ToXML() const override=0
Convert this cell to a representation fit for saving in a .wxmx file.
ImgCellBase::CopyToClipboard
virtual bool CopyToClipboard() const override=0
Copies the cell to the system's clipboard.
ImgCellBase::ToString
virtual wxString ToString() const override=0
Returns the cell's representation as a string.
ImgCellBase::GetToolTip
virtual const wxString & GetToolTip(wxPoint point) const override=0
Cell
Definition: Cell.h:139
ImgCellBase::CanExportSVG
virtual bool CanExportSVG() const =0
Can this image be exported in SVG format?
ImgCellBase::Copy
virtual std::unique_ptr< Cell > Copy(GroupCell *group) const override=0
ImgCellBase::Draw
virtual void Draw(wxPoint point) override=0
ImgCellBase::ToMatlab
virtual wxString ToMatlab() const override=0
Convert this cell to its Matlab representation.
ImgCellBase::SetPPI
virtual void SetPPI(int ppi)=0
Set the image's resolution.
ImgCellBase::ToTeX
virtual wxString ToTeX() const override=0
Convert this cell to its LaTeX representation.
ImgCellBase::operator=
ImgCellBase & operator=(const ImgCellBase &)=delete
This class can be derived from wxAccessible which has no copy constructor.
Image.h
AFontSize
Definition: FontAttribs.h:97
ImgCellBase::ToImageFile
virtual wxSize ToImageFile(wxString filename)=0
AnimationCell
Definition: AnimationCell.h:45
ImgCellBase::GetInfo
virtual const CellTypeInfo & GetInfo() override=0
Returns the information about this cell's type.
Configuration
Definition: Configuration.h:83
ImgCellBase
Definition: ImgCellBase.h:40
ImgCellBase::ToRTF
virtual wxString ToRTF() const override=0
GroupCell
Definition: GroupCell.h:68
ImgCellBase::ClearCache
virtual void ClearCache() override=0
CellTypeInfo
A class that carries information about the type of a cell.
Definition: Cell.h:90
ImgCellBase::CanPopOut
virtual bool CanPopOut() const override=0
Can this cell be popped out interactively in gnuplot?
ImgCellBase::GetExtension
virtual wxString GetExtension() const =0
Returns the file name extension that matches the image type.
ImgCellBase::Recalculate
virtual void Recalculate(AFontSize fontsize) override=0