| 1 | // Aseprite |
| 2 | // Copyright (C) 2020-2022 Igara Studio S.A. |
| 3 | // Copyright (C) 2018 David Capello |
| 4 | // |
| 5 | // This program is distributed under the terms of |
| 6 | // the End-User License Agreement for Aseprite. |
| 7 | |
| 8 | #ifndef APP_UI_EXPORT_FILE_WINDOW_H_INCLUDED |
| 9 | #define APP_UI_EXPORT_FILE_WINDOW_H_INCLUDED |
| 10 | #pragma once |
| 11 | |
| 12 | #include "app/pref/preferences.h" |
| 13 | #include "obs/signal.h" |
| 14 | |
| 15 | #include "export_file.xml.h" |
| 16 | |
| 17 | #include <string> |
| 18 | |
| 19 | namespace app { |
| 20 | class Doc; |
| 21 | |
| 22 | class ExportFileWindow : public app::gen::ExportFile { |
| 23 | public: |
| 24 | ExportFileWindow(const Doc* doc); |
| 25 | |
| 26 | bool show(); |
| 27 | void savePref(); |
| 28 | |
| 29 | std::string outputFilenameValue() const; |
| 30 | double resizeValue() const; |
| 31 | std::string areaValue() const; |
| 32 | std::string layersValue() const; |
| 33 | int layersIndex() const; |
| 34 | std::string framesValue() const; |
| 35 | doc::AniDir aniDirValue() const; |
| 36 | bool applyPixelRatio() const; |
| 37 | bool () const; |
| 38 | |
| 39 | void setOutputFilename(const std::string& pathAndFilename); |
| 40 | void setResizeScale(const double scale); |
| 41 | void setArea(const std::string& area); |
| 42 | void setAniDir(const doc::AniDir aniDir); |
| 43 | |
| 44 | obs::signal<std::string()> SelectOutputFile; |
| 45 | |
| 46 | private: |
| 47 | void updateOutputFilenameEntry(); |
| 48 | void onOutputFilenameEntryChange(); |
| 49 | void updateAniDir(); |
| 50 | void updateAdjustResizeButton(); |
| 51 | void onAdjustResize(); |
| 52 | void onOK(); |
| 53 | std::string defaultExtension() const; |
| 54 | |
| 55 | const Doc* m_doc; |
| 56 | DocumentPreferences& m_docPref; |
| 57 | std::string m_outputPath; |
| 58 | std::string m_outputFilename; |
| 59 | int m_preferredResize; |
| 60 | }; |
| 61 | |
| 62 | } |
| 63 | |
| 64 | #endif |
| 65 | |