summaryrefslogtreecommitdiffstats
path: root/commands/command_edit.h
diff options
context:
space:
mode:
Diffstat (limited to 'commands/command_edit.h')
-rw-r--r--commands/command_edit.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/commands/command_edit.h b/commands/command_edit.h
index a148550b3..aeecc0bab 100644
--- a/commands/command_edit.h
+++ b/commands/command_edit.h
@@ -375,6 +375,33 @@ private:
void redo() override;
};
+#ifdef SUBSURFACE_MOBILE
+// Edit a full dive. This is used on mobile where we don't have per-field granularity.
+// It may add or edit a dive site.
+class EditDive : public Base {
+public:
+ EditDive(dive *oldDive, dive *newDive, dive_site *createDs, dive_site *editDs, location_t dsLocation); // Takes ownership of newDive
+private:
+ dive *oldDive; // Dive that is going to be overwritten
+ OwningDivePtr newDive; // New data
+ int changedFields;
+
+ dive_site *siteToRemove;
+ OwningDiveSitePtr siteToAdd;
+
+ dive_site *siteToEdit;
+ location_t dsLocation;
+
+ void undo() override;
+ void redo() override;
+ bool workToBeDone() override;
+
+ void exchangeDives();
+ void editDs();
+};
+
+#endif // SUBSURFACE_MOBILE
+
} // namespace Command
#endif