Cogs.Core
IEditor.h
1#pragma once
2
3#include "Base.h"
4
5#include <vector>
6
7namespace Cogs
8{
9 class StringView;
10}
11
12namespace Cogs::Core
13{
14 using EntityIds = std::vector<EntityId>;
15
16 struct Texture;
17
18 template<typename T>
19 struct ResourceHandle_t;
20
21 typedef ResourceHandle_t<Texture> TextureHandle;
22
23 struct EditorState;
24
25 enum class SelectMode
26 {
27 Exclusive = 0,
28 Toggle,
29 Add
30 };
31
32 class COGSCORE_DLL_API IEditor
33 {
34 public:
35 virtual ~IEditor() = default;
36
37 virtual void initialize() = 0;
38 virtual void cleanup() = 0;
39
40 virtual void clear(bool interactive = true) = 0;
41
48 virtual void open(const StringView & path, bool openInRoot, bool synchronous) = 0;
49 virtual void save() = 0;
50 virtual void saveAs() = 0;
51 virtual void saveIncremental() = 0;
52 virtual void exportScene(const StringView & path) = 0;;
53
54 virtual void cut() = 0;
55 virtual void copy() = 0;
56 virtual void paste() = 0;
57
58 virtual void invokeCommand(const StringView & key) = 0;
59
60 virtual void destroy() = 0;
61
62 virtual bool isActive() const = 0;
63
64 virtual EntityIds getSelected() const = 0;
65 virtual void select(const EntityIds & ids, SelectMode mode = SelectMode::Exclusive) = 0;
66
67 virtual void beginFrame() = 0;
68 virtual void show() = 0;
69
70 virtual EditorState* getState() = 0;
71
72 virtual bool showTexture(const StringView & header, TextureHandle & texture) = 0;
73
74 virtual struct EditorCommand* createCommand(const StringView & key) = 0;
75 virtual void createEntity(const StringView & type, const StringView & name) = 0;
76 };
77}
virtual void open(const StringView &path, bool openInRoot, bool synchronous)=0
Open file.
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
Base class for Cogs Editor commands.
Definition: EditorCommand.h:19