mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
434644b381
The code is rather complex. Firstly, we have different representations of pictures throughout the code. Secondly, this tries to do add the pictures in batches to the divepicture model and that is always rather tricky. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
// SPDX-License-Identifier: GPL-2.0
|
|
// Note: this header file is used by the undo-machinery and should not be included elsewhere.
|
|
|
|
#ifndef COMMAND_PICTURES_H
|
|
#define COMMAND_PICTURES_H
|
|
|
|
#include "command_base.h"
|
|
#include "command.h" // for PictureListForDeletion/Addition
|
|
|
|
// We put everything in a namespace, so that we can shorten names without polluting the global namespace
|
|
namespace Command {
|
|
|
|
class SetPictureOffset final : public Base {
|
|
public:
|
|
SetPictureOffset(dive *d, const QString &filename, offset_t offset); // Pictures are identified by the unique (dive,filename) pair
|
|
private:
|
|
dive *d; // null means no work to be done
|
|
QString filename;
|
|
offset_t offset;
|
|
|
|
void undo() override;
|
|
void redo() override;
|
|
bool workToBeDone() override;
|
|
};
|
|
|
|
class RemovePictures final : public Base {
|
|
public:
|
|
RemovePictures(const std::vector<PictureListForDeletion> &pictures);
|
|
private:
|
|
std::vector<PictureListForDeletion> picturesToRemove; // for redo
|
|
std::vector<PictureListForAddition> picturesToAdd; // for undo
|
|
|
|
void undo() override;
|
|
void redo() override;
|
|
bool workToBeDone() override;
|
|
};
|
|
|
|
} // namespace Command
|
|
#endif
|