Path: blob/master/editor/inspector/editor_inspector.h
21636 views
/**************************************************************************/1/* editor_inspector.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 "editor/inspector/editor_property_name_processor.h"33#include "scene/gui/box_container.h"34#include "scene/gui/button.h"35#include "scene/gui/panel_container.h"36#include "scene/gui/scroll_container.h"3738class AddMetadataDialog;39class AcceptDialog;40class EditorInspector;41class HSeparator;42class LineEdit;43class MarginContainer;44class OptionButton;45class PopupMenu;46class SpinBox;47class StyleBoxFlat;48class TextureRect;49class Timer;5051class EditorPropertyRevert {52public:53static Variant get_property_revert_value(Object *p_object, const StringName &p_property, bool *r_is_valid);54static bool can_property_revert(Object *p_object, const StringName &p_property, const Variant *p_custom_current_value = nullptr);55};5657class EditorInspectorActionButton : public Button {58GDCLASS(EditorInspectorActionButton, Button);5960StringName icon_name;6162protected:63void _notification(int p_what);6465public:66EditorInspectorActionButton(const String &p_text, const StringName &p_icon_name);67};6869class EditorProperty : public Container {70GDCLASS(EditorProperty, Container);7172friend class EditorInspector;7374struct ThemeCache {75Ref<Font> font;7677Ref<StyleBox> background;78Ref<StyleBox> background_selected;79Ref<StyleBox> child_background;80Ref<StyleBox> hover;81Ref<StyleBox> sub_inspector_background[17];8283Ref<Texture2D> key_icon;84Ref<Texture2D> key_next_icon;85Ref<Texture2D> delete_icon;86Ref<Texture2D> checked_icon;87Ref<Texture2D> unchecked_icon;88Ref<Texture2D> revert_icon;89Ref<Texture2D> pin_icon;90Ref<Texture2D> copy_icon;91Ref<Texture2D> copy_node_path_icon;92Ref<Texture2D> paste_icon;93Ref<Texture2D> unfavorite_icon;94Ref<Texture2D> favorite_icon;95Ref<Texture2D> override_icon;96Ref<Texture2D> remove_icon;97Ref<Texture2D> help_icon;9899int font_size = 0;100int font_offset = 0;101int horizontal_separation = 0;102int vertical_separation = 0;103int padding = 0;104int inspector_property_height = 0;105106Color property_color;107Color readonly_property_color;108Color warning_color;109Color readonly_warning_color;110Color property_color_x;111Color property_color_y;112Color property_color_z;113Color property_color_w;114Color sub_inspector_property_color;115} theme_cache;116117public:118enum MenuItems {119MENU_COPY_VALUE,120MENU_PASTE_VALUE,121MENU_COPY_PROPERTY_PATH,122MENU_OVERRIDE_FOR_PROJECT,123MENU_FAVORITE_PROPERTY,124MENU_PIN_VALUE,125MENU_DELETE,126MENU_REVERT_VALUE,127MENU_OPEN_DOCUMENTATION,128};129130enum ColorationMode {131COLORATION_CONTAINER_RESOURCE,132COLORATION_RESOURCE,133COLORATION_EXTERNAL,134};135136enum InlineControlSide {137INLINE_CONTROL_LEFT,138INLINE_CONTROL_RIGHT139};140141private:142String label;143int text_size;144friend class EditorInspector;145Object *object = nullptr;146StringName property;147String property_path;148String doc_path;149bool internal = false;150bool has_doc_tooltip = false;151152int property_usage;153154bool draw_label = true;155bool draw_background = true;156bool read_only = false;157bool checkable = false;158bool checked = false;159bool draw_warning = false;160bool draw_prop_warning = false;161bool keying = false;162bool deletable = false;163bool label_overlayed = false;164165Rect2 right_child_rect;166Rect2 bottom_child_rect;167168Rect2 keying_rect;169bool keying_hover = false;170Rect2 revert_rect;171bool revert_hover = false;172Rect2 check_rect;173bool check_hover = false;174Rect2 delete_rect;175bool delete_hover = false;176177bool can_revert = false;178bool can_pin = false;179bool pin_hidden = false;180bool pinned = false;181182bool can_favorite = false;183bool favorited = false;184185bool use_folding = false;186bool draw_top_bg = true;187188int sub_inspector_color_level = -1;189190void _update_popup();191void _focusable_focused(int p_index);192int _get_v_separation() const { return bottom_editor ? 0 : theme_cache.vertical_separation; }193194bool selectable = true;195bool selected = false;196int selected_focusable;197198float split_ratio;199200Vector<Control *> focusables;201Control *label_reference = nullptr;202Control *bottom_editor = nullptr;203PopupMenu *menu = nullptr;204HBoxContainer *left_container = nullptr;205HBoxContainer *right_container = nullptr;206207HashMap<StringName, Variant> cache;208209GDVIRTUAL0(_update_property)210GDVIRTUAL1(_set_read_only, bool)211212void _update_flags();213214protected:215bool has_borders = false;216bool can_override = false;217218void _notification(int p_what);219static void _bind_methods();220virtual void _set_read_only(bool p_read_only);221222virtual void gui_input(const Ref<InputEvent> &p_event) override;223virtual void shortcut_input(const Ref<InputEvent> &p_event) override;224const Color *_get_property_colors();225226virtual Variant _get_cache_value(const StringName &p_prop, bool &r_valid) const;227virtual StringName _get_revert_property() const;228229void _update_property_bg();230231void _accessibility_action_menu(const Variant &p_data);232void _accessibility_action_click(const Variant &p_data);233234public:235void emit_changed(const StringName &p_property, const Variant &p_value, const StringName &p_field = StringName(), bool p_changing = false);236237String get_tooltip_string(const String &p_string) const;238239virtual Size2 get_minimum_size() const override;240241void set_label(const String &p_label);242String get_label() const;243244void set_read_only(bool p_read_only);245bool is_read_only() const;246247void set_draw_label(bool p_draw_label);248bool is_draw_label() const;249250void set_draw_background(bool p_draw_background);251bool is_draw_background() const;252253Object *get_edited_object();254StringName get_edited_property() const;255inline Variant get_edited_property_value() const {256ERR_FAIL_NULL_V(object, Variant());257return object->get(property);258}259Variant get_edited_property_display_value() const;260EditorInspector *get_parent_inspector() const;261262void set_doc_path(const String &p_doc_path);263void set_internal(bool p_internal);264265virtual void update_property();266void update_editor_property_status();267268virtual bool use_keying_next() const;269270void set_checkable(bool p_checkable);271bool is_checkable() const;272273void set_checked(bool p_checked);274bool is_checked() const;275276void set_draw_warning(bool p_draw_warning);277bool is_draw_warning() const;278279void set_keying(bool p_keying);280bool is_keying() const;281282virtual bool is_colored(ColorationMode p_mode) { return false; }283284void set_deletable(bool p_enable);285bool is_deletable() const;286void add_focusable(Control *p_control);287void grab_focus(int p_focusable = -1);288void select(int p_focusable = -1);289void deselect();290bool is_selected() const;291292void add_inline_control(Control *p_control, InlineControlSide p_side);293HBoxContainer *get_inline_container(InlineControlSide p_side);294void set_label_overlayed(bool p_overlay);295296void set_label_reference(Control *p_control);297void set_bottom_editor(Control *p_control);298299void set_use_folding(bool p_use_folding);300bool is_using_folding() const;301302virtual void expand_all_folding();303virtual void collapse_all_folding();304virtual void expand_revertable();305306virtual Variant get_drag_data(const Point2 &p_point) override;307virtual void update_cache();308virtual bool is_cache_valid() const;309310void set_selectable(bool p_selectable);311bool is_selectable() const;312313void set_name_split_ratio(float p_ratio);314float get_name_split_ratio() const;315316void set_favoritable(bool p_favoritable);317bool is_favoritable() const;318319void set_object_and_property(Object *p_object, const StringName &p_property);320virtual Control *make_custom_tooltip(const String &p_text) const override;321322void set_draw_top_bg(bool p_draw) { draw_top_bg = p_draw; }323324bool can_revert_to_default() const { return can_revert; }325326void menu_option(int p_option);327328EditorProperty();329};330331class EditorInspectorPlugin : public RefCounted {332GDCLASS(EditorInspectorPlugin, RefCounted);333334public:335friend class EditorInspector;336struct AddedEditor {337Control *property_editor = nullptr;338Vector<String> properties;339String label;340bool add_to_end = false;341};342343List<AddedEditor> added_editors;344345protected:346static void _bind_methods();347348GDVIRTUAL1RC(bool, _can_handle, Object *)349GDVIRTUAL1(_parse_begin, Object *)350GDVIRTUAL2(_parse_category, Object *, String)351GDVIRTUAL2(_parse_group, Object *, String)352GDVIRTUAL7R(bool, _parse_property, Object *, Variant::Type, String, PropertyHint, String, BitField<PropertyUsageFlags>, bool)353GDVIRTUAL1(_parse_end, Object *)354355#ifndef DISABLE_DEPRECATED356void _add_property_editor_bind_compat_92322(const String &p_for_property, Control *p_prop, bool p_add_to_end);357static void _bind_compatibility_methods();358#endif // DISABLE_DEPRECATED359public:360void add_custom_control(Control *control);361void add_property_editor(const String &p_for_property, Control *p_prop, bool p_add_to_end = false, const String &p_label = String());362void add_property_editor_for_multiple_properties(const String &p_label, const Vector<String> &p_properties, Control *p_prop);363364virtual bool can_handle(Object *p_object);365virtual void parse_begin(Object *p_object);366virtual void parse_category(Object *p_object, const String &p_category);367virtual void parse_group(Object *p_object, const String &p_group);368virtual bool parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const BitField<PropertyUsageFlags> p_usage, const bool p_wide = false);369virtual void parse_end(Object *p_object);370};371372class EditorInspectorCategory : public Control {373GDCLASS(EditorInspectorCategory, Control);374375friend class EditorInspector;376377// Right-click context menu options.378enum ClassMenuOption {379MENU_OPEN_DOCS,380MENU_UNFAVORITE_ALL,381};382383struct ThemeCache {384int horizontal_separation = 0;385int vertical_separation = 0;386int class_icon_size = 0;387388Color font_color;389390Ref<Font> bold_font;391int bold_font_size = 0;392393Ref<Texture2D> icon_favorites;394Ref<Texture2D> icon_unfavorite;395Ref<Texture2D> icon_help;396397Ref<StyleBox> background;398} theme_cache;399400PropertyInfo info;401402Ref<Texture2D> icon;403String label;404String doc_class_name;405PopupMenu *menu = nullptr;406bool is_favorite = false;407bool menu_icon_dirty = true;408409void _handle_menu_option(int p_option);410void _popup_context_menu(const Point2i &p_position);411void _update_icon();412void _theme_changed();413414protected:415static void _bind_methods();416417void _notification(int p_what);418virtual void gui_input(const Ref<InputEvent> &p_event) override;419420void _accessibility_action_menu(const Variant &p_data);421422public:423void set_as_favorite();424void set_property_info(const PropertyInfo &p_info);425void set_doc_class_name(const String &p_name);426427virtual Size2 get_minimum_size() const override;428virtual Control *make_custom_tooltip(const String &p_text) const override;429430EditorInspectorCategory();431};432433class EditorInspectorSection : public Container {434GDCLASS(EditorInspectorSection, Container);435436friend class EditorInspector;437438String label;439String section;440Color bg_color;441bool vbox_added = false; // Optimization.442bool foldable = false;443bool checkable = false;444bool checked = false;445bool keying = false;446int indent_depth = 0;447int level = 1;448String related_enable_property;449450Timer *dropping_unfold_timer = nullptr;451bool dropping_for_unfold = false;452453Rect2 check_rect;454bool check_hover = false;455Rect2 keying_rect;456bool keying_hover = false;457bool header_hover = false;458459bool checkbox_only = false;460461HashSet<StringName> revertable_properties;462463void _test_unfold();464int _get_header_height();465Ref<Texture2D> _get_arrow();466Ref<Texture2D> _get_checkbox();467468EditorInspector *_get_parent_inspector() const;469470struct ThemeCache {471int horizontal_separation = 0;472int vertical_separation = 0;473int inspector_margin = 0;474int indent_size = 0;475int key_padding_size = 0;476477Color warning_color;478Color prop_subsection;479Color font_color;480Color font_disabled_color;481Color font_hover_color;482Color font_pressed_color;483Color font_hover_pressed_color;484Color font_hover_mono_color;485486Ref<Font> font;487int font_size = 0;488Ref<Font> bold_font;489int bold_font_size = 0;490Ref<Font> light_font;491int light_font_size = 0;492493Ref<Texture2D> arrow;494Ref<Texture2D> arrow_collapsed;495Ref<Texture2D> arrow_collapsed_mirrored;496Ref<Texture2D> icon_gui_checked;497Ref<Texture2D> icon_gui_unchecked;498Ref<Texture2D> icon_gui_animation_key;499500Ref<StyleBoxFlat> indent_box;501Ref<StyleBoxFlat> key_hover;502} theme_cache;503504protected:505Object *object = nullptr;506VBoxContainer *vbox = nullptr;507508void _notification(int p_what);509static void _bind_methods();510virtual void gui_input(const Ref<InputEvent> &p_event) override;511512void _accessibility_action_collapse(const Variant &p_data);513void _accessibility_action_expand(const Variant &p_data);514515public:516virtual Size2 get_minimum_size() const override;517virtual Control *make_custom_tooltip(const String &p_text) const override;518519void setup(const String &p_section, const String &p_label, Object *p_object, const Color &p_bg_color, bool p_foldable, int p_indent_depth = 0, int p_level = 1);520String get_section() const;521String get_label() const { return label; }522VBoxContainer *get_vbox();523void unfold();524void fold();525void set_bg_color(const Color &p_bg_color);526void reset_timer();527void set_checkable(const String &p_related_check_property, bool p_checkbox_only, bool p_checked);528inline bool is_checkable() const { return checkable; }529void set_checked(bool p_checked);530void set_keying(bool p_keying);531532bool has_revertable_properties() const;533void property_can_revert_changed(const String &p_path, bool p_can_revert);534void _property_edited(const String &p_property);535void update_property();536537EditorInspectorSection();538~EditorInspectorSection();539};540541class ArrayPanelContainer : public PanelContainer {542GDCLASS(ArrayPanelContainer, PanelContainer);543544protected:545void _notification(int p_what);546547void _accessibility_action_menu(const Variant &p_data);548549public:550ArrayPanelContainer();551};552553class EditorInspectorArray : public EditorInspectorSection {554GDCLASS(EditorInspectorArray, EditorInspectorSection);555556enum Mode {557MODE_NONE,558MODE_USE_COUNT_PROPERTY,559MODE_USE_MOVE_ARRAY_ELEMENT_FUNCTION,560} mode = MODE_NONE;561StringName count_property;562StringName array_element_prefix;563String swap_method;564565int count = 0;566int selected = -1;567568VBoxContainer *elements_vbox = nullptr;569570Control *control_dropping = nullptr;571bool dropping = false;572573Button *add_button = nullptr;574575AcceptDialog *resize_dialog = nullptr;576SpinBox *new_size_spin_box = nullptr;577578// Pagination.579int page_length = 5;580int page = 0;581int max_page = 0;582int begin_array_index = 0;583int end_array_index = 0;584585bool read_only = false;586bool movable = true;587bool is_const = false;588bool numbered = false;589590enum MenuOptions {591OPTION_MOVE_UP = 0,592OPTION_MOVE_DOWN,593OPTION_NEW_BEFORE,594OPTION_NEW_AFTER,595OPTION_REMOVE,596OPTION_CLEAR_ARRAY,597OPTION_RESIZE_ARRAY,598};599int popup_array_index_pressed = -1;600PopupMenu *rmb_popup = nullptr;601602struct ArrayElement {603PanelContainer *panel = nullptr;604MarginContainer *margin = nullptr;605HBoxContainer *hbox = nullptr;606Button *move_up = nullptr;607TextureRect *move_texture_rect = nullptr;608Button *move_down = nullptr;609Label *number = nullptr;610VBoxContainer *vbox = nullptr;611Button *erase = nullptr;612};613LocalVector<ArrayElement> array_elements;614615Ref<StyleBoxFlat> odd_style;616Ref<StyleBoxFlat> even_style;617618int _get_array_count();619void _add_button_pressed();620void _paginator_page_changed(int p_page);621622void _rmb_popup_id_pressed(int p_id);623624void _control_dropping_draw();625626void _vbox_visibility_changed();627628void _panel_draw(int p_index);629void _panel_gui_input(Ref<InputEvent> p_event, int p_index);630void _panel_gui_focus(int p_index);631void _panel_gui_unfocus(int p_index);632void _move_element(int p_element_index, int p_to_pos);633void _clear_array();634void _resize_array(int p_size);635Array _extract_properties_as_array(const List<PropertyInfo> &p_list);636int _drop_position() const;637638void _new_size_spin_box_value_changed(float p_value);639void _new_size_spin_box_text_submitted(const String &p_text);640void _resize_dialog_confirmed();641642void _update_elements_visibility();643void _setup();644645Variant get_drag_data_fw(const Point2 &p_point, Control *p_from);646void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);647bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;648649void _remove_item(int p_index);650651protected:652void _notification(int p_what);653static void _bind_methods();654655public:656void setup_with_move_element_function(Object *p_object, const String &p_label, const StringName &p_array_element_prefix, int p_page, const Color &p_bg_color, bool p_foldable, bool p_movable = true, bool p_is_const = false, bool p_numbered = false, int p_page_length = 5, const String &p_add_item_text = "");657void setup_with_count_property(Object *p_object, const String &p_label, const StringName &p_count_property, const StringName &p_array_element_prefix, int p_page, const Color &p_bg_color, bool p_foldable, bool p_movable = true, bool p_is_const = false, bool p_numbered = false, int p_page_length = 5, const String &p_add_item_text = "", const String &p_swap_method = "");658VBoxContainer *get_vbox(int p_index);659660void show_menu(int p_index, const Vector2 &p_offset);661662EditorInspectorArray(bool p_read_only);663};664665class EditorPaginator : public HBoxContainer {666GDCLASS(EditorPaginator, HBoxContainer);667668int page = 0;669int max_page = 0;670Button *first_page_button = nullptr;671Button *prev_page_button = nullptr;672LineEdit *page_line_edit = nullptr;673Label *page_count_label = nullptr;674Button *next_page_button = nullptr;675Button *last_page_button = nullptr;676677void _first_page_button_pressed();678void _prev_page_button_pressed();679void _page_line_edit_text_submitted(const String &p_text);680void _next_page_button_pressed();681void _last_page_button_pressed();682683protected:684void _notification(int p_what);685static void _bind_methods();686687public:688void update(int p_page, int p_max_page);689690EditorPaginator();691};692693class EditorInspector : public ScrollContainer {694GDCLASS(EditorInspector, ScrollContainer);695696friend class EditorPropertyResource;697698enum {699MAX_PLUGINS = 1024700};701static Ref<EditorInspectorPlugin> inspector_plugins[MAX_PLUGINS];702static int inspector_plugin_count;703704struct ThemeCache {705Color prop_subsection;706} theme_cache;707708EditorInspectorSection::ThemeCache section_theme_cache;709EditorInspectorCategory::ThemeCache category_theme_cache;710EditorProperty::ThemeCache property_theme_cache;711712bool can_favorite = false;713PackedStringArray current_favorites;714VBoxContainer *favorites_section = nullptr;715VBoxContainer *favorites_vbox = nullptr;716VBoxContainer *favorites_groups_vbox = nullptr;717HSeparator *favorites_separator = nullptr;718719EditorInspector *root_inspector = nullptr;720721VBoxContainer *base_vbox = nullptr;722VBoxContainer *begin_vbox = nullptr;723VBoxContainer *main_vbox = nullptr;724725// Map used to cache the instantiated editors.726HashMap<StringName, List<EditorProperty *>> editor_property_map;727List<EditorInspectorSection *> sections;728HashSet<StringName> pending;729730void _clear(bool p_hide_plugins = true);731Object *object = nullptr;732Object *next_object = nullptr;733734//735736LineEdit *search_box = nullptr;737bool show_standard_categories = false;738bool show_custom_categories = false;739bool hide_script = true;740bool hide_metadata = true;741bool use_doc_hints = false;742EditorPropertyNameProcessor::Style property_name_style = EditorPropertyNameProcessor::STYLE_CAPITALIZED;743bool use_settings_name_style = true;744bool use_filter = false;745bool autoclear = false;746bool use_folding = false;747int changing;748bool update_all_pending = false;749bool read_only = false;750bool keying = false;751bool wide_editors = false;752bool deletable_properties = false;753bool mark_unsaved = true;754755float refresh_countdown;756bool update_tree_pending = false;757StringName _prop_edited;758StringName property_selected;759int property_focusable;760int update_scroll_request;761762bool updating_theme = false;763764struct DocCacheInfo {765String doc_path;766String theme_item_name;767};768769HashMap<StringName, HashMap<StringName, DocCacheInfo>> doc_cache;770HashSet<StringName> restart_request_props;771HashMap<String, String> custom_property_descriptions;772HashMap<String, String> doc_property_class_remaps;773774HashMap<ObjectID, int> scroll_cache;775776String property_prefix; // Used for sectioned inspector.777String object_class;778779static inline Variant property_clipboard;780781bool restrict_to_basic = false;782783void _edit_set(const String &p_name, const Variant &p_value, bool p_refresh_all, const String &p_changed_field);784785void _property_changed(const String &p_path, const Variant &p_value, const String &p_name = "", bool p_changing = false, bool p_update_all = false);786void _multiple_properties_changed(const Vector<String> &p_paths, const Array &p_values, bool p_changing = false);787void _property_keyed(const String &p_path, bool p_advance);788void _property_keyed_with_value(const String &p_path, const Variant &p_value, bool p_advance);789void _property_deleted(const String &p_path);790void _property_checked(const String &p_path, bool p_checked);791void _property_pinned(const String &p_path, bool p_pinned);792bool _property_path_matches(const String &p_property_path, const String &p_filter, EditorPropertyNameProcessor::Style p_style);793bool _resource_properties_matches(const Ref<Resource> &p_resource, const String &p_filter);794795void _resource_selected(const String &p_path, Ref<Resource> p_resource);796void _property_selected(const String &p_path, int p_focusable);797void _object_id_selected(const String &p_path, ObjectID p_id);798799void _update_current_favorites();800void _set_property_favorited(const String &p_path, bool p_favorited);801void _clear_current_favorites();802803void _node_removed(Node *p_node);804805HashMap<StringName, int> per_array_page;806void _page_change_request(int p_new_page, const StringName &p_array_prefix);807808void _changed_callback();809void _edit_request_change(Object *p_object, const String &p_prop);810811void _keying_changed();812813void _parse_added_editors(VBoxContainer *p_current_vbox, EditorInspectorSection *p_section, Ref<EditorInspectorPlugin> p_plugin);814815void _vscroll_changed(double);816817void _feature_profile_changed();818819bool _is_property_disabled_by_feature_profile(const StringName &p_property);820821void _section_toggled_by_user(const String &p_path, bool p_value);822823AddMetadataDialog *add_meta_dialog = nullptr;824825void _add_meta_confirm();826void _show_add_meta_dialog();827828void _handle_menu_option(int p_option);829void _add_section_in_tree(EditorInspectorSection *p_section, VBoxContainer *p_current_vbox);830static EditorInspector *_get_control_parent_inspector(Control *p_control);831832protected:833static void _bind_methods();834void _notification(int p_what);835836public:837static void add_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin);838static void remove_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin);839static void cleanup_plugins();840841static EditorProperty *instantiate_property_editor(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide = false);842843static void initialize_section_theme(EditorInspectorSection::ThemeCache &p_cache, Control *p_control);844static void initialize_category_theme(EditorInspectorCategory::ThemeCache &p_cache, Control *p_control);845static void initialize_property_theme(EditorProperty::ThemeCache &p_cache, Control *p_control);846847static void set_property_clipboard(const Variant &p_value);848static Variant get_property_clipboard();849850bool is_main_editor_inspector() const;851String get_selected_path() const;852853void update_tree();854void update_property(const String &p_prop);855void edit(Object *p_object);856Object *get_edited_object();857Object *get_next_edited_object();858859void set_keying(bool p_active);860void set_read_only(bool p_read_only);861void set_mark_unsaved(bool p_mark) { mark_unsaved = p_mark; }862863EditorPropertyNameProcessor::Style get_property_name_style() const;864void set_property_name_style(EditorPropertyNameProcessor::Style p_style);865866// If true, the inspector will update its property name style according to the current editor settings.867void set_use_settings_name_style(bool p_enable);868869void set_autoclear(bool p_enable);870871void set_show_categories(bool p_show_standard, bool p_show_custom);872void set_use_doc_hints(bool p_enable);873void set_hide_script(bool p_hide);874void set_hide_metadata(bool p_hide);875876void set_use_filter(bool p_use);877void register_text_enter(Node *p_line_edit);878879void set_use_folding(bool p_use_folding, bool p_update_tree = true);880bool is_using_folding();881882void collapse_all_folding();883void expand_all_folding();884void expand_revertable();885886void set_scroll_offset(int p_offset);887int get_scroll_offset() const;888889void set_property_prefix(const String &p_prefix);890String get_property_prefix() const;891892void add_custom_property_description(const String &p_class, const String &p_property, const String &p_description);893String get_custom_property_description(const String &p_property) const;894895void remap_doc_property_class(const String &p_property_prefix, const String &p_class);896897void set_object_class(const String &p_class);898String get_object_class() const;899900void set_use_wide_editors(bool p_enable);901void set_root_inspector(EditorInspector *p_root_inspector);902EditorInspector *get_root_inspector() { return is_sub_inspector() ? root_inspector : this; }903bool is_sub_inspector() const { return root_inspector != nullptr; }904905void set_use_deletable_properties(bool p_enabled);906907void set_restrict_to_basic_settings(bool p_restrict);908909EditorInspector();910};911912913