2015-02-12 15:16:25 +00:00
|
|
|
// Aseprite
|
2017-04-11 21:45:51 +00:00
|
|
|
// Copyright (C) 2001-2017 David Capello
|
2015-02-12 15:16:25 +00:00
|
|
|
//
|
2016-08-26 20:02:58 +00:00
|
|
|
// This program is distributed under the terms of
|
|
|
|
// the End-User License Agreement for Aseprite.
|
2014-03-29 19:58:35 +00:00
|
|
|
|
|
|
|
#ifndef APP_COMMANDS_CMD_SAVE_FILE_H_INCLUDED
|
|
|
|
#define APP_COMMANDS_CMD_SAVE_FILE_H_INCLUDED
|
2014-03-29 22:40:17 +00:00
|
|
|
#pragma once
|
2014-03-29 19:58:35 +00:00
|
|
|
|
|
|
|
#include "app/commands/command.h"
|
2016-09-17 04:01:28 +00:00
|
|
|
#include "doc/selected_frames.h"
|
2014-03-29 19:58:35 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace app {
|
2016-05-31 19:53:30 +00:00
|
|
|
class Document;
|
2015-06-03 19:34:27 +00:00
|
|
|
class FileSelectorDelegate;
|
2014-03-29 19:58:35 +00:00
|
|
|
|
|
|
|
class SaveFileBaseCommand : public Command {
|
|
|
|
public:
|
2017-12-01 02:41:45 +00:00
|
|
|
SaveFileBaseCommand(const char* id, CommandFlags flags);
|
2014-03-29 19:58:35 +00:00
|
|
|
|
|
|
|
std::string selectedFilename() const {
|
|
|
|
return m_selectedFilename;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2015-03-11 18:40:22 +00:00
|
|
|
void onLoadParams(const Params& params) override;
|
2014-08-15 02:07:47 +00:00
|
|
|
bool onEnabled(Context* context) override;
|
2014-03-29 19:58:35 +00:00
|
|
|
|
2017-09-08 19:54:42 +00:00
|
|
|
bool saveAsDialog(Context* context,
|
|
|
|
const std::string& dlgTitle,
|
|
|
|
const std::string& forbiddenFilename = std::string(),
|
2015-06-03 19:34:27 +00:00
|
|
|
FileSelectorDelegate* delegate = nullptr);
|
2016-05-31 19:53:30 +00:00
|
|
|
void saveDocumentInBackground(const Context* context,
|
|
|
|
const app::Document* document,
|
|
|
|
bool markAsSaved) const;
|
2014-03-29 19:58:35 +00:00
|
|
|
|
|
|
|
std::string m_filename;
|
2015-01-26 01:36:32 +00:00
|
|
|
std::string m_filenameFormat;
|
2014-03-29 19:58:35 +00:00
|
|
|
std::string m_selectedFilename;
|
2016-06-01 17:49:24 +00:00
|
|
|
std::string m_frameTag;
|
2017-04-11 21:45:51 +00:00
|
|
|
std::string m_slice;
|
2016-09-17 04:01:28 +00:00
|
|
|
doc::SelectedFrames m_selFrames;
|
|
|
|
bool m_adjustFramesByFrameTag;
|
2014-03-29 19:58:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace app
|
|
|
|
|
|
|
|
#endif
|