#ifndef ELANAVIGATIONBAR_H #define ELANAVIGATIONBAR_H #include #include "ElaDef.h" #include "ElaProperty.h" #include "ElaSuggestBox.h" class ElaNavigationBarPrivate; class ELA_EXPORT ElaNavigationBar : public QWidget { Q_OBJECT Q_Q_CREATE(ElaNavigationBar) Q_PROPERTY_CREATE_Q_H(bool, IsTransparent) Q_PROPERTY_CREATE_Q_H(bool, IsAllowPageOpenInNewWindow) Q_PROPERTY_CREATE_Q_H(int, NavigationBarWidth) public: explicit ElaNavigationBar(QWidget* parent = nullptr); ~ElaNavigationBar() override; void setUserInfoCardVisible(bool isVisible); void setUserInfoCardPixmap(QPixmap pix); void setUserInfoCardTitle(QString title); void setUserInfoCardSubTitle(QString subTitle); ElaNavigationType::NodeResult addExpanderNode(const QString& expanderTitle, QString& expanderKey, ElaIconType::IconName awesome = ElaIconType::None); ElaNavigationType::NodeResult addExpanderNode(const QString& expanderTitle, QString& expanderKey, const QString& targetExpanderKey, ElaIconType::IconName awesome = ElaIconType::None); ElaNavigationType::NodeResult addPageNode(const QString& pageTitle, QWidget* page, ElaIconType::IconName awesome = ElaIconType::None); ElaNavigationType::NodeResult addPageNode(const QString& pageTitle, QWidget* page, int keyPoints, ElaIconType::IconName awesome = ElaIconType::None); ElaNavigationType::NodeResult addPageNode(const QString& pageTitle, QWidget* page, const QString& targetExpanderKey, ElaIconType::IconName awesome = ElaIconType::None); ElaNavigationType::NodeResult addPageNode(const QString& pageTitle, QWidget* page, const QString& targetExpanderKey, int keyPoints, ElaIconType::IconName awesome = ElaIconType::None); ElaNavigationType::NodeResult addFooterNode(const QString& footerTitle, QString& footerKey, int keyPoints = 0, ElaIconType::IconName awesome = ElaIconType::None); ElaNavigationType::NodeResult addFooterNode(const QString& footerTitle, QWidget* page, QString& footerKey, int keyPoints = 0, ElaIconType::IconName awesome = ElaIconType::None); ElaNavigationType::NodeResult addCategoryNode(const QString& categoryTitle, QString& categoryKey); ElaNavigationType::NodeResult addCategoryNode(const QString& categoryTitle, QString& categoryKey, const QString& targetExpanderKey); bool getNodeIsExpanded(QString expanderKey) const; void expandNode(QString expanderKey); void collapseNode(QString expanderKey); void removeNode(QString nodeKey); void setNodeKeyPoints(QString nodeKey, int keyPoints); int getNodeKeyPoints(QString nodeKey) const; void setNodeTitle(QString nodeKey, QString nodeTitle); QString getNodeTitle(QString nodeKey) const; void navigation(QString pageKey, bool isLogClicked = true, bool isRouteBack = false); void setDisplayMode(ElaNavigationType::NavigationDisplayMode displayMode, bool isAnimation = true); ElaNavigationType::NavigationDisplayMode getDisplayMode() const; int getPageOpenInNewWindowCount(QString nodeKey) const; QList getSuggestDataList() const; Q_SIGNALS: Q_SIGNAL void pageOpenInNewWindow(QString nodeKey); Q_SIGNAL void userInfoCardClicked(); Q_SIGNAL void navigationNodeClicked(ElaNavigationType::NavigationNodeType nodeType, QString nodeKey, bool isRouteBack); Q_SIGNAL void navigationNodeAdded(ElaNavigationType::NavigationNodeType nodeType, QString nodeKey, QWidget* page); Q_SIGNAL void navigationNodeRemoved(ElaNavigationType::NavigationNodeType nodeType, QString nodeKey); protected: virtual void paintEvent(QPaintEvent* event) override; }; #endif // ELANAVIGATIONBAR_H