Path: blob/master/modules/openxr/editor/openxr_action_set_editor.h
10278 views
/**************************************************************************/1/* openxr_action_set_editor.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "../action_map/openxr_action_map.h"33#include "../action_map/openxr_action_set.h"34#include "openxr_action_editor.h"3536class EditorSpinSlider;37class BoxContainer;38class Button;39class LineEdit;40class PanelContainer;41class TextEdit;4243class OpenXRActionSetEditor : public HBoxContainer {44GDCLASS(OpenXRActionSetEditor, HBoxContainer);4546private:47EditorUndoRedoManager *undo_redo;48Ref<OpenXRActionMap> action_map;49Ref<OpenXRActionSet> action_set;5051bool is_expanded = true;5253PanelContainer *panel = nullptr;54Button *fold_btn = nullptr;55VBoxContainer *main_vb = nullptr;56HBoxContainer *action_set_hb = nullptr;57LineEdit *action_set_name = nullptr;58LineEdit *action_set_localized_name = nullptr;59EditorSpinSlider *action_set_priority = nullptr;60Button *add_action = nullptr;61Button *rem_action_set = nullptr;62VBoxContainer *actions_vb = nullptr;6364void _set_fold_icon();65void _theme_changed();66OpenXRActionEditor *_add_action_editor(Ref<OpenXRAction> p_action);6768void _on_toggle_expand();69void _on_action_set_name_changed(const String p_new_text);70void _on_action_set_localized_name_changed(const String p_new_text);71void _on_action_set_priority_changed(const double p_new_value);72void _on_add_action();73void _on_remove_action_set();7475void _on_remove_action(Object *p_action_editor);7677protected:78static void _bind_methods();79void _notification(int p_what);8081// used for undo/redo82void _do_set_name(const String p_new_text);83void _do_set_localized_name(const String p_new_text);84void _do_set_priority(int64_t value);85void _do_add_action_editor(OpenXRActionEditor *p_action_editor);86void _do_remove_action_editor(OpenXRActionEditor *p_action_editor);8788public:89Ref<OpenXRActionSet> get_action_set() { return action_set; }90void set_focus_on_entry();9192void remove_all_actions();9394OpenXRActionSetEditor(Ref<OpenXRActionMap> p_action_map, Ref<OpenXRActionSet> p_action_set);95};969798