#ifndef GRAPH_VIEW_STYLE_H #define GRAPH_VIEW_STYLE_H #include #include #include "component/view/graphElements/GraphNode.h" #include "component/view/GraphViewStyleImpl.h" #include "data/graph/Node.h" class GraphViewStyle { public: struct NodeMargins { NodeMargins(); int left; int right; int top; int bottom; int spacingX; int spacingY; int minWidth; float charWidth; }; struct NodeStyle { NodeStyle(); std::string color; std::string shadowColor; int shadowBlurRadius; int cornerRadius; float borderWidth; std::string borderColor; bool borderDashed; std::string fontName; size_t fontSize; bool fontBold; Vec2i textOffset; bool undefinedPattern; }; struct EdgeStyle { EdgeStyle(); std::string color; float width; int zValue; bool isStraight; int arrowLength; int arrowWidth; bool arrowClosed; int cornerRadius; int verticalOffset; Vec2i originOffset; Vec2i targetOffset; }; static std::shared_ptr getImpl(); static void setImpl(std::shared_ptr impl); static float getCharWidthForNodeType(Node::NodeType type); static size_t getFontSizeForNodeType(Node::NodeType type); static size_t getFontSizeOfAccessNode(); static size_t getFontSizeOfExpandToggleNode(); static std::string getFontNameForNodeType(Node::NodeType type); static std::string getFontNameOfAccessNode(); static std::string getFontNameOfExpandToggleNode(); static NodeMargins getMarginsForNodeType(Node::NodeType type, bool hasChildren); static NodeMargins getMarginsOfAccessNode(); static NodeMargins getMarginsOfExpandToggleNode(); static NodeStyle getStyleForNodeType(Node::NodeType type, bool isActive, bool isFocused, bool hasChildren); static NodeStyle getStyleOfAccessNode(); static NodeStyle getStyleOfExpandToggleNode(); static EdgeStyle getStyleForEdgeType(Edge::EdgeType type, bool isActive, bool isFocused); private: static std::map s_charWidths; static std::shared_ptr s_impl; }; #endif // GRAPH_VIEW_STYLE_H