File indexing completed on 2024-04-21 04:32:12

0001 /*
0002  * Copyright (C) 2010-2015 by Stephen Allewell
0003  * steve.allewell@gmail.com
0004  *
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation; either version 2 of the License, or
0008  * (at your option) any later version.
0009  */
0010 
0011 #ifndef PatternElementDlg_H
0012 #define PatternElementDlg_H
0013 
0014 #include <QDialog>
0015 #include <QList>
0016 #include <QRect>
0017 
0018 #include "ui_PatternElement.h"
0019 
0020 class Document;
0021 class PlanElement;
0022 class PatternElement;
0023 class SelectArea;
0024 class QHideEvent;
0025 class QShowEvent;
0026 
0027 class PatternElementDlg : public QDialog
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     PatternElementDlg(QWidget *, PatternElement *, Document *, const QMap<int, QList<QRect>> &);
0033     virtual ~PatternElementDlg() = default;
0034 
0035     bool showPlan() const;
0036     PlanElement *planElement() const;
0037 
0038 protected:
0039     virtual void hideEvent(QHideEvent *) Q_DECL_OVERRIDE;
0040     virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
0041 
0042 private slots:
0043     void on_DialogButtonBox_accepted();
0044     void on_DialogButtonBox_rejected();
0045     void on_DialogButtonBox_helpRequested();
0046 
0047 private:
0048     SelectArea *m_selectArea;
0049 
0050     PatternElement *m_patternElement;
0051     Document *m_document;
0052 
0053     QRect m_patternRect;
0054     QMap<int, QList<QRect>> m_patternRects;
0055 
0056     Ui::PatternElement ui;
0057 };
0058 
0059 #endif // PatternElementDlg_H