1 /* 2 rows_and_depth_dialog.h MindForger thinking notebook 3 4 Copyright (C) 2016-2020 Martin Dvorak <martin.dvorak@mindforger.com> 5 6 This program is free software; you can redistribute it and/or 7 modify it under the terms of the GNU General Public License 8 as published by the Free Software Foundation; either version 2 9 of the License, or (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 #ifndef M8RUI_ROWS_AND_DEPTH_DIALOG_H 20 #define M8RUI_ROWS_AND_DEPTH_DIALOG_H 21 22 #include <QtWidgets> 23 24 namespace m8r { 25 26 class RowsAndDepthDialog : public QDialog 27 { 28 Q_OBJECT 29 30 public: 31 enum Purpose { 32 BULLETS, 33 NUMBERS, 34 TASKS, 35 BLOCKQUOTE 36 }; 37 38 private: 39 Purpose purpose; 40 41 QLabel* label; 42 43 QSpinBox* rowsSpin; 44 QSpinBox* depthSpin; 45 46 QPushButton* generateButton; 47 QPushButton* closeButton; 48 49 public: 50 explicit RowsAndDepthDialog(QWidget* parent); 51 RowsAndDepthDialog(const RowsAndDepthDialog&) = delete; 52 RowsAndDepthDialog(const RowsAndDepthDialog&&) = delete; 53 RowsAndDepthDialog &operator=(const RowsAndDepthDialog&) = delete; 54 RowsAndDepthDialog &operator=(const RowsAndDepthDialog&&) = delete; 55 ~RowsAndDepthDialog(); 56 setPurpose(Purpose p)57 void setPurpose(Purpose p) { purpose = p; } getPurpose()58 Purpose getPurpose() const { return purpose; } 59 60 void show(); 61 getGenerateButton()62 QPushButton* getGenerateButton() { return generateButton; } getRows()63 int getRows() const { return rowsSpin->value(); } getDepth()64 int getDepth() const { return depthSpin->value(); } 65 }; 66 67 } 68 #endif // M8RUI_ROWS_AND_DEPTH_DIALOG_H 69