valentina/mainwindow.h

87 lines
2.7 KiB
C
Raw Normal View History

2013-06-20 16:09:50 +02:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
2013-07-03 14:29:26 +02:00
#include <QLabel>
2013-07-13 12:51:31 +02:00
#include <QtXml>
#include <QComboBox>
2013-07-03 14:29:26 +02:00
#include "widgets/vmaingraphicsscene.h"
#include "dialogs/dialogsinglepoint.h"
2013-07-17 13:38:11 +02:00
#include "dialogs/dialogincrements.h"
2013-07-13 12:51:31 +02:00
#include "tools/vtoolsimplepoint.h"
#include "xml/vdomdocument.h"
#include "container/vcontainer.h"
2013-07-25 14:00:51 +02:00
#include "dialogs/dialogendline.h"
2013-06-20 16:09:50 +02:00
namespace Ui {
class MainWindow;
}
2013-07-03 14:29:26 +02:00
namespace Tools{
enum Enum
{
ArrowTool,
2013-07-25 14:00:51 +02:00
SinglePointTool,
EndLineTool
2013-07-03 14:29:26 +02:00
};
}
2013-06-20 16:09:50 +02:00
class MainWindow : public QMainWindow
{
2013-07-03 14:29:26 +02:00
Q_OBJECT
2013-06-20 16:09:50 +02:00
public:
2013-07-03 14:29:26 +02:00
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
public slots:
void mouseMove(QPointF scenePos);
2013-07-25 14:00:51 +02:00
void ToolSinglePoint(bool checked);
void ActionAroowTool();
void ActionDraw(bool checked);
void ActionDetails(bool checked);
2013-07-13 12:51:31 +02:00
void ToolCanseled();
void SinglePointCreated(const QString name, const QPointF point);
2013-07-25 14:00:51 +02:00
void ActionNewDraw();
2013-07-13 12:51:31 +02:00
void currentDrawChanged( int index );
2013-07-25 14:00:51 +02:00
void OptionDraw();
void ActionSaveAs();
void ActionSave();
void ActionOpen();
void ActionNew();
2013-07-13 12:51:31 +02:00
void haveChange();
2013-07-17 13:38:11 +02:00
void ChangedSize(const QString &text);
void ChangedGrowth(const QString & text);
2013-07-25 14:00:51 +02:00
void ActionTable(bool checked);
void ClosedActionTable();
void ToolEndLine(bool checked);
void ClosedDialogEndLine(int result);
2013-07-13 12:51:31 +02:00
protected:
virtual void keyPressEvent ( QKeyEvent * event );
virtual void showEvent( QShowEvent *event );
2013-07-17 13:38:11 +02:00
virtual void closeEvent ( QCloseEvent * event );
2013-06-20 16:09:50 +02:00
private:
2013-07-03 14:29:26 +02:00
Ui::MainWindow *ui;
2013-07-13 12:51:31 +02:00
Tools::Enum tool;
2013-07-03 14:29:26 +02:00
VMainGraphicsScene *scene;
QLabel *mouseCoordinate;
QLabel *helpLabel;
bool isInitialized;
DialogSinglePoint *dialogSinglePoint;
2013-07-17 13:38:11 +02:00
DialogIncrements *dialogTable;
2013-07-25 14:00:51 +02:00
DialogEndLine *dialogEndLine;
2013-07-13 12:51:31 +02:00
VDomDocument *doc;
VContainer *data;
QComboBox *comboBoxDraws;
QString fileName;
bool changeInFile;
2013-07-03 14:29:26 +02:00
void ToolBarOption();
void ToolBarDraws();
void CanselTool();
void ArrowTool();
2013-07-17 13:38:11 +02:00
void CreateManTableIGroup () const;
void SetEnableWidgets(bool enable);
2013-07-25 14:00:51 +02:00
void SetEnableTool(bool enable);
2013-06-20 16:09:50 +02:00
};
#endif // MAINWINDOW_H