Plasma Engine  2.0
Loading...
Searching...
No Matches
ExposedParametersPropertyWidget.moc.h
1#pragma once
2
3#include <EditorFramework/EditorFrameworkDLL.h>
4#include <EditorFramework/GUI/ExposedParameters.h>
5#include <Foundation/Types/UniquePtr.h>
6#include <GuiFoundation/PropertyGrid/PropertyBaseWidget.moc.h>
7#include <ToolsFoundation/Object/ObjectProxyAccessor.h>
8
9class QToolButton;
10class QAction;
11
12class PL_EDITORFRAMEWORK_DLL plExposedParameterCommandAccessor : public plObjectProxyAccessor
13{
14public:
15 plExposedParameterCommandAccessor(plObjectAccessorBase* pSource, const plAbstractProperty* pParameterProp, const plAbstractProperty* pM_pParameterSourceProp);
16
17 virtual plStatus GetValue(const plDocumentObject* pObject, const plAbstractProperty* pProp, plVariant& out_value, plVariant index = plVariant()) override;
18 virtual plStatus SetValue(const plDocumentObject* pObject, const plAbstractProperty* pProp, const plVariant& newValue, plVariant index = plVariant()) override;
19 virtual plStatus RemoveValue(const plDocumentObject* pObject, const plAbstractProperty* pProp, plVariant index = plVariant()) override;
20 virtual plStatus GetCount(const plDocumentObject* pObject, const plAbstractProperty* pProp, plInt32& out_iCount) override;
21 virtual plStatus GetKeys(const plDocumentObject* pObject, const plAbstractProperty* pProp, plDynamicArray<plVariant>& out_keys) override;
22 virtual plStatus GetValues(const plDocumentObject* pObject, const plAbstractProperty* pProp, plDynamicArray<plVariant>& out_values) override;
23
24public:
25 const plExposedParameters* GetExposedParams(const plDocumentObject* pObject);
26 const plExposedParameter* GetExposedParam(const plDocumentObject* pObject, const char* szParamName);
27 const plRTTI* GetExposedParamsType(const plDocumentObject* pObject);
28 const plRTTI* GetCommonExposedParamsType(const plHybridArray<plPropertySelection, 8>& items);
29 bool IsExposedProperty(const plDocumentObject* pObject, const plAbstractProperty* pProp);
30
31public:
32 const plAbstractProperty* m_pParameterProp = nullptr;
33 const plAbstractProperty* m_pParameterSourceProp = nullptr;
34};
35
37{
38 Q_OBJECT;
39
40protected:
41 virtual void InternalSetValue(const plVariant& value);
42};
43
45{
46 Q_OBJECT
47
48public:
51 virtual void SetSelection(const plHybridArray<plPropertySelection, 8>& items) override;
52
53protected:
54 virtual void OnInit() override;
55 virtual plQtPropertyWidget* CreateWidget(plUInt32 index) override;
56 virtual void UpdateElement(plUInt32 index) override;
57 virtual void UpdatePropertyMetaState() override;
58
59private:
60 void PropertyEventHandler(const plDocumentObjectPropertyEvent& e);
61 void CommandHistoryEventHandler(const plCommandHistoryEvent& e);
62 void FlushQueuedChanges();
63 bool RemoveUnusedKeys(bool bTestOnly);
64 bool FixKeyTypes(bool bTestOnly);
65 void UpdateActionState();
66
67private:
69 plObjectAccessorBase* m_pSourceObjectAccessor = nullptr;
70 plString m_sExposedParamProperty;
71 mutable plDynamicArray<plExposedParameter> m_Parameters;
72 bool m_bNeedsUpdate = false;
73 bool m_bNeedsMetaDataUpdate = false;
74
75 QToolButton* m_pFixMeButton = nullptr;
76 QAction* m_pRemoveUnusedAction = nullptr;
77 QAction* m_pFixTypesAction = nullptr;
78};
This is the base interface for all properties in the reflection system. It provides enough informatio...
Definition AbstractProperty.h:150
Definition DocumentObjectBase.h:11
Definition DynamicArray.h:81
Definition ExposedParametersPropertyWidget.moc.h:13
Definition ExposedParameters.h:19
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Definition ObjectAccessorBase.h:8
Definition ObjectProxyAccessor.h:8
Definition ExposedParametersPropertyWidget.moc.h:37
Definition ExposedParametersPropertyWidget.moc.h:45
Definition PropertyBaseWidget.moc.h:305
Base class for all property widgets.
Definition PropertyBaseWidget.moc.h:28
Definition PropertyBaseWidget.moc.h:340
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
Definition CommandHistory.h:31
Used by plDocumentObjectManager::m_PropertyEvents.
Definition DocumentObjectManager.h:77
Definition ExposedParameters.h:7
An plResult with an additional message for the reason of failure.
Definition Status.h:12