libodsstream
Library for mass spectrometry
Loading...
Searching...
No Matches
OdsTableSettings Class Reference

#include <odstablesettings.h>

Public Member Functions

 OdsTableSettings ()
 
 OdsTableSettings (const OdsTableSettings &other)
 
virtual ~OdsTableSettings ()
 
OdsTableSettingsoperator= (OdsTableSettings const &other)
 
void setVerticalSplit (unsigned int position)
 
void setHorizontalSplit (unsigned int position)
 
const QString & getSheetName () const
 

Protected Member Functions

void setSheetName (const QString &sheetname)
 
const QString getValue (const QString &property) const
 

Private Attributes

friend SettingsXml
 
QString _sheetname
 
std::map< QString, QString > _map_properties
 

Detailed Description

Definition at line 42 of file odstablesettings.h.

Constructor & Destructor Documentation

◆ OdsTableSettings() [1/2]

OdsTableSettings::OdsTableSettings ( )

Definition at line 37 of file odstablesettings.cpp.

38{
39}

◆ OdsTableSettings() [2/2]

OdsTableSettings::OdsTableSettings ( const OdsTableSettings other)

Definition at line 40 of file odstablesettings.cpp.

41{
42 _sheetname = other._sheetname;
44}
std::map< QString, QString > _map_properties

References _map_properties, and _sheetname.

◆ ~OdsTableSettings()

OdsTableSettings::~OdsTableSettings ( )
virtual

Definition at line 45 of file odstablesettings.cpp.

46{
47}

Member Function Documentation

◆ getSheetName()

const QString & OdsTableSettings::getSheetName ( ) const

Definition at line 63 of file odstablesettings.cpp.

64{
65 return _sheetname;
66}

References _sheetname.

◆ getValue()

const QString OdsTableSettings::getValue ( const QString &  property) const
protected

Definition at line 68 of file odstablesettings.cpp.

69{
70 auto it = _map_properties.find(property);
71 if(it != _map_properties.end())
72 {
73 return it->second;
74 }
75 else
76 {
77 return "0";
78 }
79}

References _map_properties.

Referenced by SettingsXml::setCurrentOdsTableSettings(), setVerticalSplit(), and SettingsXml::writeSheetSettings().

◆ operator=()

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

Definition at line 49 of file odstablesettings.cpp.

50{
51 if(this == &other)
52 return *this;
53 _sheetname = other._sheetname;
54 _map_properties = other._map_properties;
55 return *this;
56}

References _map_properties, and _sheetname.

◆ setHorizontalSplit()

void OdsTableSettings::setHorizontalSplit ( unsigned int  position)

Definition at line 99 of file odstablesettings.cpp.

100{
101 if(position == 0)
102 {
103 _map_properties[QString("HorizontalSplitMode")] = QString("0");
104 }
105 else
106 {
107 _map_properties[QString("HorizontalSplitMode")] = QString("2");
108 }
109 _map_properties[QString("HorizontalSplitPosition")] =
110 QString("%1").arg(position);
111}

References _map_properties.

◆ setSheetName()

void OdsTableSettings::setSheetName ( const QString &  sheetname)
protected

Definition at line 58 of file odstablesettings.cpp.

59{
60 _sheetname = sheetname;
61}

References _sheetname.

Referenced by SettingsXml::setCurrentOdsTableSettings().

◆ setVerticalSplit()

void OdsTableSettings::setVerticalSplit ( unsigned int  position)

Definition at line 81 of file odstablesettings.cpp.

82{
83 qDebug() << __FILE__ << " " << __FUNCTION__ << " " << position;
84 if(position == 0)
85 {
86 _map_properties[QString("VerticalSplitMode")] = QString("0");
87 }
88 else
89 {
90 _map_properties[QString("VerticalSplitMode")] = QString("2");
91 }
92 _map_properties[QString("VerticalSplitPosition")] =
93 QString("%1").arg(position);
94 qDebug() << __FILE__ << " " << __FUNCTION__ << " "
95 << getValue("VerticalSplitPosition");
96}
const QString getValue(const QString &property) const

References _map_properties, and getValue().

Referenced by QtableWriter::writeSheet().

Member Data Documentation

◆ _map_properties

std::map<QString, QString> OdsTableSettings::_map_properties
private

◆ _sheetname

QString OdsTableSettings::_sheetname
private

Definition at line 62 of file odstablesettings.h.

Referenced by OdsTableSettings(), getSheetName(), operator=(), and setSheetName().

◆ SettingsXml

friend OdsTableSettings::SettingsXml
private

Definition at line 44 of file odstablesettings.h.


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