All Classes Namespaces Functions Variables Enumerations Properties Pages
importpositiondialog.h
1 /*
2 
3 Pencil2D - Traditional Animation Software
4 Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5 Copyright (C) 2012-2020 Matthew Chiawen Chang
6 
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; version 2 of the License.
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 */
17 #ifndef IMPORTPOSITIONDIALOG_H
18 #define IMPORTPOSITIONDIALOG_H
19 
20 #include <QDialog>
21 
22 namespace Ui {
24 }
25 
26 class Editor;
27 
29 {
30  Q_OBJECT
31 
32  struct ImportPosition {
33 
34  enum Type {
35  CenterOfView,
36  CenterOfCanvas,
37  CenterOfCamera,
38  CenterOfCameraFollowed,
39  None
40  };
41 
42  static Type getTypeFromIndex(int index) {
43  switch (index) {
44  case 0:
45  return CenterOfView;
46  case 1:
47  return CenterOfCanvas;
48  case 2:
49  return CenterOfCamera;
50  case 3:
51  return CenterOfCameraFollowed;
52  default:
53  return None;
54  }
55  }
56  };
57 
58 public:
59  explicit ImportPositionDialog(QWidget *parent = nullptr);
61 
62  void setCore(Editor* editor) { mEditor = editor; }
63 
64 private slots:
65  void didChangeComboBoxIndex(const int index);
66  void changeImportView();
67 
68 private:
69  Ui::ImportPositionDialog *ui;
70 
71  ImportPosition::Type mImportOption = ImportPosition::None;
72  Editor* mEditor = nullptr;
73 };
74 
75 #endif // IMPORTPOSITIONDIALOG_H
Q_OBJECTQ_OBJECT
Definition: editor.h:55
QObject * parent() const const