Engauge Digitizer 2
Loading...
Searching...
No Matches
MimePointsExport Class Reference

Custom mime type for separate treatment of graph coordinates and, when there is no transform, points coordinates. More...

#include <MimePointsExport.h>

Inheritance diagram for MimePointsExport:
Inheritance graph
Collaboration diagram for MimePointsExport:
Collaboration graph

Public Member Functions

 MimePointsExport ()
 Default constructor. Initial contents are overwritten by other constructors.
 MimePointsExport (const QString &csvGraph, const QString &htmlGraph)
 Constructor when graph coordinates are available because the transformation is defined.
 MimePointsExport (const QString &csvPoints)
 Constructor when transformation is not defined. This data is not meant to leave this application.
MimePointsExportoperator= (const MimePointsExport &other)
 Assignment operator.
virtual ~MimePointsExport ()
 Destructor.
QString csvGraph () const
 Get method for csvGraph.
QString csvPoints () const
 Get method for csvPoints.
virtual QStringList formats () const
 Available formats, which depend on whether or not the transform is defined.
QString htmlGraph () const
 Get methjod for htmlGraph.

Protected Member Functions

virtual QVariant retrieveData (const QString &format, QVariant::Type preferredType) const
 Returns a variant with the data for the specified format.

Detailed Description

Custom mime type for separate treatment of graph coordinates and, when there is no transform, points coordinates.

Used for export only.

Definition at line 16 of file MimePointsExport.h.

Constructor & Destructor Documentation

◆ MimePointsExport() [1/3]

MimePointsExport::MimePointsExport ( )

Default constructor. Initial contents are overwritten by other constructors.

Definition at line 14 of file MimePointsExport.cpp.

15{
16}

◆ MimePointsExport() [2/3]

MimePointsExport::MimePointsExport ( const QString & csvGraph,
const QString & htmlGraph )

Constructor when graph coordinates are available because the transformation is defined.

Definition at line 18 of file MimePointsExport.cpp.

19 :
20 m_csvGraph (csvGraph),
21 m_htmlGraph (htmlGraph)
22{
23 m_formats << FORMAT_CSV << FORMAT_HTML << FORMAT_PLAIN;
24}
const QString FORMAT_PLAIN("text/plain")
const QString FORMAT_HTML("text/html")
const QString FORMAT_CSV("text/csv")
QString htmlGraph() const
Get methjod for htmlGraph.
QString csvGraph() const
Get method for csvGraph.

◆ MimePointsExport() [3/3]

MimePointsExport::MimePointsExport ( const QString & csvPoints)

Constructor when transformation is not defined. This data is not meant to leave this application.

Definition at line 26 of file MimePointsExport.cpp.

26 :
27 m_csvPoints (csvPoints)
28{
29 m_formats << FORMAT_CSV_INTERNAL;
30}
const QString FORMAT_CSV_INTERNAL("text/engauge-points-csv")
QString csvPoints() const
Get method for csvPoints.

◆ ~MimePointsExport()

MimePointsExport::~MimePointsExport ( )
virtual

Destructor.

Definition at line 42 of file MimePointsExport.cpp.

43{
44}

Member Function Documentation

◆ csvGraph()

QString MimePointsExport::csvGraph ( ) const

Get method for csvGraph.

Definition at line 46 of file MimePointsExport.cpp.

47{
48 return m_csvGraph;
49}

◆ csvPoints()

QString MimePointsExport::csvPoints ( ) const

Get method for csvPoints.

Definition at line 51 of file MimePointsExport.cpp.

52{
53 return m_csvPoints;
54}

◆ formats()

QStringList MimePointsExport::formats ( ) const
virtual

Available formats, which depend on whether or not the transform is defined.

Definition at line 56 of file MimePointsExport.cpp.

57{
58 return m_formats;
59}

◆ htmlGraph()

QString MimePointsExport::htmlGraph ( ) const

Get methjod for htmlGraph.

Definition at line 61 of file MimePointsExport.cpp.

62{
63 return m_htmlGraph;
64}

◆ operator=()

MimePointsExport & MimePointsExport::operator= ( const MimePointsExport & other)

Assignment operator.

Definition at line 32 of file MimePointsExport.cpp.

33{
34 m_csvGraph = other.csvGraph();
35 m_csvPoints = other.csvPoints();
36 m_htmlGraph = other.htmlGraph();
37 m_formats = other.formats();
38
39 return *this;
40}
virtual QStringList formats() const
Available formats, which depend on whether or not the transform is defined.

◆ retrieveData()

QVariant MimePointsExport::retrieveData ( const QString & format,
QVariant::Type preferredType ) const
protectedvirtual

Returns a variant with the data for the specified format.

Definition at line 66 of file MimePointsExport.cpp.

68{
69 if (format == FORMAT_CSV) {
70 return m_csvGraph;
71 } else if (format == FORMAT_CSV_INTERNAL) {
72 return m_csvPoints;
73 } else if (format == FORMAT_HTML) {
74 return m_htmlGraph;
75 } else if (format == FORMAT_PLAIN) {
76 return m_csvGraph;
77 } else {
78 QVariant null;
79 return null;
80 }
81}

The documentation for this class was generated from the following files: