All Classes Namespaces Functions Variables Enumerations Properties Pages
importexportdialog.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 
18 #ifndef IMPORTEXPORTDIALOG_H
19 #define IMPORTEXPORTDIALOG_H
20 
21 #include <QDialog>
22 #include <QGroupBox>
23 #include "filetype.h"
24 
25 namespace Ui {
26 class ImportExportDialog;
27 }
28 
29 class QDialogButtonBox;
30 
32 {
33  Q_OBJECT
34 
35 public:
36  enum Mode { Import, Export };
37 
38  explicit ImportExportDialog(QWidget* parent, Mode eMode, FileType eFileType);
39  ~ImportExportDialog() override;
40 
41  void init();
42  QString getFilePath() const;
43  QString getAbsolutePath();
44  QStringList getFilePaths();
45  int getPosIndex() { return mPosIndex; }
46 
47 signals:
48  void filePathsChanged(QStringList filePaths);
49 
50 protected:
51  QGroupBox* getOptionsGroupBox();
52  QGroupBox* getPreviewGroupBox();
53  QDialogButtonBox* getDialogButtonBox();
54 
55  void setFileExtension(const QString& extension);
56  void hideOptionsGroupBox(bool hide);
57  void hidePreviewGroupBox(bool hide);
58  void hideInstructionsLabel(bool hide);
59 
60  void setInstructionsLabel(const QString& text);
61 
62 private slots:
63  void browse();
64  void setPosIndex(int index) { mPosIndex = index; }
65 
66 private:
67  Ui::ImportExportDialog* ui = nullptr;
68 
69  QStringList m_filePaths;
70 
71  FileType mFileType = FileType::ANIMATION;
72  Mode mMode = Import;
73  int mPosIndex = 0;
74 };
75 
76 #endif // IMPORTEXPORTDIALOG_H
QWidget * extension() const const
Q_OBJECTQ_OBJECT
void hide()
QObject * parent() const const