Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
editor_command.hpp
1// Copyright (c) 2026 ttldtor.
2// SPDX-License-Identifier: BSL-1.0
3#pragma once
4
5#include <portals/widget.hpp>
6
7#include <memory>
8
9namespace portals {
10class ManagedScene;
11
12namespace ui::detail {
13struct RefAccess;
14struct ActionAccess;
15struct AsyncAccess;
16struct EditAccess;
17} // namespace ui::detail
18
23class EditorCommandResult {
24public:
26 std::expected<void, TreeError> result() const noexcept {
27 return result_;
28 }
29
31 explicit operator bool() const noexcept {
32 return result_.has_value();
33 }
34
35private:
36 friend class ManagedScene;
37 friend struct ui::detail::RefAccess;
38 friend struct ui::detail::ActionAccess;
39 friend struct ui::detail::AsyncAccess;
40 friend struct ui::detail::EditAccess;
41
42 EditorCommandResult(std::expected<void, TreeError> result, std::weak_ptr<const void> collector, bool reported)
43 : result_(result), collector_(std::move(collector)), reported_(reported) {
44 }
45
46 std::expected<void, TreeError> result_;
47 std::weak_ptr<const void> collector_;
48
49 bool reported_{};
50};
51} // namespace portals
Owning checked editor command, preserving exactly its collector reporting receipt....
Definition editor_command.hpp:23
std::expected< void, TreeError > result() const noexcept
Definition editor_command.hpp:26
Additive lifecycle owner over one existing Application subtree. UI affine and nonmovable....
Definition managed.hpp:530
Public Portals API.
Definition action.hpp:8