#ifndef PLOTCONFIG_H
#define PLOTCONFIG_H

#include "qt_version.h"
#include <qobject.h>

#if QT_VERSION < 0x040000
#include <qmainwindow.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qgroupbox.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qcombobox.h>
#include <qvalidator.h>
#include <qtooltip.h>
#include <qcheckbox.h>
#include <qfontdialog.h>
#else
#include <QMainWindow>
#include <QComboBox>
#include <QGridLayout>
#include <QPushButton>
#include <QLineEdit>
#include <QInputDialog>
#include <QTabWidget>
#include <QLabel>
#include <QGroupBox>
#include <QDoubleValidator>
#include <QToolTip>
#include <QCheckBox>
#include <QFontDialog>
#endif
#include "qt_version.h"
#include "qprofile.h"

#define ARRAY_PEACE_SUM "[ Sum(1,16) Sum(1,6) (2,16) ]"
#define ARRAY_PEACE_AVE "[ Ave(1,16) Ave(1,6) (2,16) ]"
#define ARRAY_CODIF_SUM "[ Sum(1,8) Sum(1,16) (1,31) ]"

#define ARRAY_PEACE_SUM_XY "[ Sum(1,16) (1,6) (2,16) ] <0>"
#define ARRAY_PEACE_AVE_XY "[ Ave(1,16) (1,6) (2,16) ] <0>"
#define ARRAY_CODIF_SUM_XY "[ Sum(1,8) (1,16) (1,31) ] <0>"

class PlotConfig : public QWidget
{
	Q_OBJECT
			
	public:
		PlotConfig();
		
		void setSelectedProfile(QProfile * p);
		
		void updateProfile(QProfile * p);
	
	public slots:
		
		void arrayChanged(int);
		
		void arrayToScalarChanged(int);
		
		void arrayChangedXY(int);
		
		void arrayToScalarChangedXY(int);
		
		void pageSizeChanged(int);
		
		void unitsChanged(int);
		
		void pageDPIChanged(int);
		
		
	protected:
		
		QComboBox * vectorCombo;
		QComboBox * arrayCombo;
		QLineEdit * arrayLine;
		QComboBox * arrayToScalarCombo;
		QLineEdit * arrayToScalarLine;
		QComboBox * arrayComboXY;
		QLineEdit * arrayLineXY;
		QComboBox * arrayToScalarComboXY;
		QLineEdit * arrayToScalarLineXY;
		QComboBox * pageSizeCombo;
		QComboBox * pageDPICombo;
		QLineEdit * widthLine;
		QLineEdit * heightLine;
		QComboBox * orientationCombo;
		QComboBox * unitsCombo;
		QComboBox * timeRepCombo;
		QCheckBox * kprinterCheck;
		
		int previous_units;
		double previous_dpi;
		
		double getCurrentDPI();
};

#endif
