1 /* 2 Scan Tailor - Interactive post-processing tool for scanned pages. 3 Copyright (C) 2007-2008 Joseph Artsimovich <joseph_a@mail.ru> 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef PROJECTCREATIONCONTEXT_H_ 20 #define PROJECTCREATIONCONTEXT_H_ 21 22 #include <QObject> 23 #include <QPointer> 24 #include <QString> 25 #include <Qt> 26 #include <vector> 27 #include "ImageFileInfo.h" 28 #include "NonCopyable.h" 29 30 class ProjectFilesDialog; 31 class FixDpiDialog; 32 class QWidget; 33 34 class ProjectCreationContext : public QObject { 35 Q_OBJECT 36 DECLARE_NON_COPYABLE(ProjectCreationContext) 37 38 public: 39 explicit ProjectCreationContext(QWidget* parent); 40 41 ~ProjectCreationContext() override; 42 files()43 const std::vector<ImageFileInfo>& files() const { return m_files; } 44 outDir()45 const QString& outDir() const { return m_outDir; } 46 layoutDirection()47 Qt::LayoutDirection layoutDirection() const { return m_layoutDirection; } 48 49 signals: 50 51 void done(ProjectCreationContext* context); 52 53 private slots: 54 55 void projectFilesSubmitted(); 56 57 void projectFilesDialogDestroyed(); 58 59 void fixedDpiSubmitted(); 60 61 void fixDpiDialogDestroyed(); 62 63 private: 64 void showProjectFilesDialog(); 65 66 void showFixDpiDialog(); 67 68 QPointer<ProjectFilesDialog> m_projectFilesDialog; 69 QPointer<FixDpiDialog> m_fixDpiDialog; 70 QString m_outDir; 71 std::vector<ImageFileInfo> m_files; 72 Qt::LayoutDirection m_layoutDirection; 73 QWidget* m_parent; 74 }; 75 76 77 #endif // ifndef PROJECTCREATIONCONTEXT_H_ 78