Engauge Digitizer  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | List of all members
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. More...
 
 MimePointsExport (const QString &csvGraph, const QString &htmlGraph)
 Constructor when graph coordinates are available because the transformation is defined. More...
 
 MimePointsExport (const QString &csvPoints)
 Constructor when transformation is not defined. This data is not meant to leave this application. More...
 
MimePointsExportoperator= (const MimePointsExport &other)
 Assignment operator. More...
 
virtual ~MimePointsExport ()
 Destructor. More...
 
QString csvGraph () const
 Get method for csvGraph. More...
 
QString csvPoints () const
 Get method for csvPoints. More...
 
virtual QStringList formats () const
 Available formats, which depend on whether or not the transform is defined. More...
 
QString htmlGraph () const
 Get methjod for htmlGraph. More...
 

Protected Member Functions

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

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::MimePointsExport ( )

Default constructor. Initial contents are overwritten by other constructors.

Definition at line 14 of file MimePointsExport.cpp.

15 {
16 }
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 }
QString csvGraph() const
Get method for csvGraph.
const QString FORMAT_HTML("text/html")
const QString FORMAT_PLAIN("text/plain")
const QString FORMAT_CSV("text/csv")
QString htmlGraph() const
Get methjod for htmlGraph.
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 }
QString csvPoints() const
Get method for csvPoints.
const QString FORMAT_CSV_INTERNAL("text/engauge-points-csv")
MimePointsExport::~MimePointsExport ( )
virtual

Destructor.

Definition at line 42 of file MimePointsExport.cpp.

43 {
44 }

Member Function Documentation

QString MimePointsExport::csvGraph ( ) const

Get method for csvGraph.

Definition at line 46 of file MimePointsExport.cpp.

47 {
48  return m_csvGraph;
49 }
QString MimePointsExport::csvPoints ( ) const

Get method for csvPoints.

Definition at line 51 of file MimePointsExport.cpp.

52 {
53  return m_csvPoints;
54 }
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 }
QString MimePointsExport::htmlGraph ( ) const

Get methjod for htmlGraph.

Definition at line 61 of file MimePointsExport.cpp.

62 {
63  return m_htmlGraph;
64 }
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 }
QString csvPoints() const
Get method for csvPoints.
virtual QStringList formats() const
Available formats, which depend on whether or not the transform is defined.
QString csvGraph() const
Get method for csvGraph.
QString htmlGraph() const
Get methjod for htmlGraph.
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 }
const QString FORMAT_CSV_INTERNAL("text/engauge-points-csv")
const QString FORMAT_HTML("text/html")
const QString FORMAT_PLAIN("text/plain")
const QString FORMAT_CSV("text/csv")

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