!XT (Code) Update copyright headers in Code/Sandbox.
[CRYENGINE.git] / Code / Sandbox / Plugins / EditorCommon / NodeGraph / NodeContentWidgetStyle.h
blob9b3dd19feb986e203d553f9503481007e9d71af8
1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
3 #pragma once
5 #include "ICryGraphEditor.h"
6 #include "EditorCommonAPI.h"
8 #include "NodeGraphStyleItem.h"
10 #include <QWidget>
11 #include <QColor>
12 #include <QMargins>
14 #include <unordered_map>
16 namespace CryGraphEditor {
18 class CNodePinWidgetStyle;
19 class CNodeWidgetStyle;
21 class EDITOR_COMMON_API CNodeContentWidgetStyle : protected QWidget
23 Q_OBJECT;
25 public:
26 Q_PROPERTY(QColor backgroundColor READ GetBackgroundColor WRITE SetBackgroundColor DESIGNABLE true);
27 Q_PROPERTY(QMargins margins READ GetMargins WRITE SetMargins DESIGNABLE true);
29 public:
30 CNodeContentWidgetStyle(CNodeWidgetStyle& nodeWidgetStyle);
32 const CNodeWidgetStyle& GetNodeWidgetStyle() const { return m_nodeWidgetStyle; }
34 const QColor& GetBackgroundColor() const { return m_backgroundColor; }
35 void SetBackgroundColor(const QColor& color) { m_backgroundColor = color; }
37 const QMargins& GetMargins() const { return m_margins; }
38 void SetMargins(const QMargins& margins) { m_margins = margins; }
40 void RegisterPinWidgetStyle(CNodePinWidgetStyle* pStyle);
41 const CNodePinWidgetStyle* GetPinWidgetStyle(const char* styleId) const;
43 private:
44 const CNodeWidgetStyle& m_nodeWidgetStyle;
46 QColor m_backgroundColor;
47 QMargins m_margins;
49 std::unordered_map<StyleIdHash, CNodePinWidgetStyle*> m_pinWidgetStylesById;