1 #include "CmdMediator.h"
2 #include "DocumentSerialize.h"
4 #include "MainWindowModel.h"
7 #include "QtToString.h"
8 #include <QXmlStreamWriter>
10 #include "ZoomFactorInitial.h"
13 m_zoomControl (ZOOM_CONTROL_MENU_WHEEL_PLUSMINUS),
14 m_zoomFactorInitial (DEFAULT_ZOOM_FACTOR_INITIAL)
20 m_locale (other.locale()),
21 m_zoomControl (other.zoomControl()),
22 m_zoomFactorInitial (other.zoomFactorInitial())
37 LOG4CPP_INFO_S ((*mainCat)) <<
"MainWindowModel::loadXml";
42 while ((reader.tokenType() != QXmlStreamReader::EndElement) ||
43 (reader.name() != DOCUMENT_SERIALIZE_MAIN_WINDOW)){
44 loadNextFromReader(reader);
52 reader.raiseError (
"Cannot read main window data");
62 QTextStream &str)
const
64 str << indentation <<
"MainWindowModel\n";
66 indentation += INDENTATION_DELTA;
68 str << indentation <<
"locale=" << m_locale.name() <<
"\n";
69 str << indentation <<
"zoomControl=" << m_zoomControl <<
"\n";
70 str << indentation <<
"zoomFactorInitial=" << m_zoomFactorInitial <<
"\n";
75 LOG4CPP_INFO_S ((*mainCat)) <<
"MainWindowModel::saveXml";
77 writer.writeStartElement(DOCUMENT_SERIALIZE_MAIN_WINDOW);
78 writer.writeEndElement();
82 QLocale::Country country)
107 return m_zoomControl;
112 return m_zoomFactorInitial;
MainWindowModel & operator=(const MainWindowModel &other)
Assignment constructor.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
void setLocale(QLocale::Language language, QLocale::Country country)
Set method for locale given attributes.
MainWindowModel()
Default constructor.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
ZoomControl zoomControl() const
Get method for zoom control.
Model for DlgSettingsMainWindow and CmdSettingsMainWindow.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setZoomControl(ZoomControl zoomControl)
Set method for zoom control.
void setZoomFactorInitial(ZoomFactorInitial zoomFactorInitial)
Set method for initial zoom factor.
ZoomFactorInitial zoomFactorInitial() const
Get method for initial zoom factor.
QLocale locale() const
Get method for locale.