ui: basic search view
- Added a basic SearchView (+ controller and qt implementation) - SearchView can set the active element of other views by dispatching a message. - SearchView adjusts its text when the active element is changed by other views. - Added wrappers for Button and EditBox that allow the usage of simple callback functions.
This commit is contained in:
@@ -3,8 +3,12 @@ add_files(
|
|||||||
|
|
||||||
qt/element/QtCodeFile.cpp
|
qt/element/QtCodeFile.cpp
|
||||||
qt/element/QtCodeFile.h
|
qt/element/QtCodeFile.h
|
||||||
|
qt/element/QtButton.cpp
|
||||||
|
qt/element/QtButton.h
|
||||||
qt/element/QtCodeSnippet.cpp
|
qt/element/QtCodeSnippet.cpp
|
||||||
qt/element/QtCodeSnippet.h
|
qt/element/QtCodeSnippet.h
|
||||||
|
qt/element/QtEditBox.cpp
|
||||||
|
qt/element/QtEditBox.h
|
||||||
qt/element/QtMainWindow.cpp
|
qt/element/QtMainWindow.cpp
|
||||||
qt/element/QtMainWindow.h
|
qt/element/QtMainWindow.h
|
||||||
|
|
||||||
@@ -23,6 +27,8 @@ add_files(
|
|||||||
qt/view/QtGraphView.h
|
qt/view/QtGraphView.h
|
||||||
qt/view/QtMainView.cpp
|
qt/view/QtMainView.cpp
|
||||||
qt/view/QtMainView.h
|
qt/view/QtMainView.h
|
||||||
|
qt/view/QtSearchView.cpp
|
||||||
|
qt/view/QtSearchView.h
|
||||||
|
|
||||||
qt/QtGuiFactory.cpp
|
qt/QtGuiFactory.cpp
|
||||||
qt/QtGuiFactory.h
|
qt/QtGuiFactory.h
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "qt/view/QtCodeView.h"
|
#include "qt/view/QtCodeView.h"
|
||||||
#include "qt/view/QtGraphView.h"
|
#include "qt/view/QtGraphView.h"
|
||||||
#include "qt/view/QtMainView.h"
|
#include "qt/view/QtMainView.h"
|
||||||
|
#include "qt/view/QtSearchView.h"
|
||||||
|
|
||||||
QtGuiFactory::QtGuiFactory()
|
QtGuiFactory::QtGuiFactory()
|
||||||
{
|
{
|
||||||
@@ -26,3 +27,8 @@ std::shared_ptr<GraphView> QtGuiFactory::createGraphView(ViewLayout* viewLayout)
|
|||||||
{
|
{
|
||||||
return View::create<QtGraphView>(viewLayout);
|
return View::create<QtGraphView>(viewLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<SearchView> QtGuiFactory::createSearchView(ViewLayout* viewLayout) const
|
||||||
|
{
|
||||||
|
return View::create<QtSearchView>(viewLayout);
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ public:
|
|||||||
virtual std::shared_ptr<MainView> createMainView() const;
|
virtual std::shared_ptr<MainView> createMainView() const;
|
||||||
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const;
|
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const;
|
||||||
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const;
|
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const;
|
||||||
|
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_GUI_FACTORY_H
|
#endif // QT_GUI_FACTORY_H
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#include "qt/element/QtButton.h"
|
||||||
|
|
||||||
|
QtButton::QtButton(QWidget *parent)
|
||||||
|
: QPushButton(parent)
|
||||||
|
, m_onClick(nullptr)
|
||||||
|
{
|
||||||
|
connect(this, SIGNAL(clicked()), this, SLOT(slotOnClick()));
|
||||||
|
}
|
||||||
|
|
||||||
|
QtButton::~QtButton()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtButton::setCallbackOnClick(std::function<void(void)> callback)
|
||||||
|
{
|
||||||
|
m_onClick = callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtButton::slotOnClick()
|
||||||
|
{
|
||||||
|
if (m_onClick)
|
||||||
|
m_onClick();
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef QT_BUTTON_H
|
||||||
|
#define QT_BUTTON_H
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
|
class QtButton: public QPushButton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QtButton(QWidget *parent);
|
||||||
|
~QtButton();
|
||||||
|
|
||||||
|
void setCallbackOnClick(std::function<void(void)> callback);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void slotOnClick();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::function<void(void)> m_onClick;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QT_BUTTON_H
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#include "qt/element/QtEditBox.h"
|
||||||
|
|
||||||
|
QtEditBox::QtEditBox(QWidget *parent)
|
||||||
|
: QLineEdit(parent)
|
||||||
|
, m_onReturnPressed(nullptr)
|
||||||
|
{
|
||||||
|
connect(this, SIGNAL(returnPressed()), this, SLOT(slotOnReturnPressed()));
|
||||||
|
}
|
||||||
|
|
||||||
|
QtEditBox::~QtEditBox()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtEditBox::setCallbackOnReturnPressed(std::function<void(void)> callback)
|
||||||
|
{
|
||||||
|
m_onReturnPressed = callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtEditBox::slotOnReturnPressed()
|
||||||
|
{
|
||||||
|
if (m_onReturnPressed)
|
||||||
|
m_onReturnPressed();
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
#ifndef QT_EDIT_BOX_H
|
||||||
|
#define QT_EDIT_BOX_H
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
#include <QLineEdit>
|
||||||
|
|
||||||
|
class QtEditBox: public QLineEdit
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QtEditBox(QWidget *parent);
|
||||||
|
~QtEditBox();
|
||||||
|
|
||||||
|
void setCallbackOnReturnPressed(std::function<void(void)> callback);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void slotOnReturnPressed();
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::function<void(void)> m_onReturnPressed;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QT_EDIT_BOX_H
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
#include "qt/view/QtSearchView.h"
|
||||||
|
|
||||||
|
#include <QtWidgets>
|
||||||
|
|
||||||
|
#include "qt/element/QtButton.h"
|
||||||
|
#include "qt/element/QtEditBox.h"
|
||||||
|
#include "qt/QtWidgetWrapper.h"
|
||||||
|
#include "qt/utility/utilityQt.h"
|
||||||
|
#include "component/controller/SearchController.h"
|
||||||
|
|
||||||
|
QtSearchView::QtSearchView(ViewLayout* viewLayout)
|
||||||
|
: SearchView(viewLayout)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QtSearchView::~QtSearchView()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtSearchView::createWidgetWrapper()
|
||||||
|
{
|
||||||
|
setWidgetWrapper(std::make_shared<QtWidgetWrapper>(std::make_shared<QFrame>()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtSearchView::initGui()
|
||||||
|
{
|
||||||
|
QWidget* widget = QtWidgetWrapper::getWidgetOfView(this);
|
||||||
|
utility::setWidgetBackgroundColor(widget, Colori(190, 190, 190, 255));
|
||||||
|
|
||||||
|
QBoxLayout* layout = new QBoxLayout(QBoxLayout::LeftToRight);
|
||||||
|
layout->setSpacing(3);
|
||||||
|
layout->setContentsMargins(3, 3, 3, 3);
|
||||||
|
widget->setLayout(layout);
|
||||||
|
|
||||||
|
m_searchBox = new QtEditBox(widget);
|
||||||
|
m_searchBox->setPlaceholderText("Please enter your search string.");
|
||||||
|
m_searchBox->setCallbackOnReturnPressed(std::bind(&QtSearchView::onSeachButtonClick, this));
|
||||||
|
|
||||||
|
m_searchButton = new QtButton(widget);
|
||||||
|
m_searchButton->setText("Search");
|
||||||
|
m_searchButton->setCallbackOnClick(std::bind(&QtSearchView::onSeachButtonClick, this));
|
||||||
|
|
||||||
|
widget->layout()->addWidget(m_searchBox);
|
||||||
|
widget->layout()->addWidget(m_searchButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtSearchView::setText(const std::string& s) const
|
||||||
|
{
|
||||||
|
if (m_searchBox->text() != s.c_str())
|
||||||
|
{
|
||||||
|
m_searchBox->setText(s.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtSearchView::onSeachButtonClick()
|
||||||
|
{
|
||||||
|
getController()->search(m_searchBox->text().toStdString());
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
#ifndef QT_SEARCH_VIEW_H
|
||||||
|
#define QT_SEARCH_VIEW_H
|
||||||
|
|
||||||
|
#include "component/view/SearchView.h"
|
||||||
|
|
||||||
|
class QtEditBox;
|
||||||
|
class QtButton;
|
||||||
|
|
||||||
|
class QtSearchView: public SearchView
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QtSearchView(ViewLayout* viewLayout);
|
||||||
|
~QtSearchView();
|
||||||
|
|
||||||
|
// View implementation
|
||||||
|
virtual void createWidgetWrapper();
|
||||||
|
virtual void initGui();
|
||||||
|
|
||||||
|
// SearchView implementation
|
||||||
|
virtual void setText(const std::string& s) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void onSeachButtonClick();
|
||||||
|
|
||||||
|
QtEditBox* m_searchBox;
|
||||||
|
QtButton* m_searchButton;
|
||||||
|
};
|
||||||
|
|
||||||
|
# endif // QT_SEARCH_VIEW_H
|
||||||
@@ -22,6 +22,8 @@ add_files(
|
|||||||
component/controller/Controller.h
|
component/controller/Controller.h
|
||||||
component/controller/GraphController.cpp
|
component/controller/GraphController.cpp
|
||||||
component/controller/GraphController.h
|
component/controller/GraphController.h
|
||||||
|
component/controller/SearchController.cpp
|
||||||
|
component/controller/SearchController.h
|
||||||
|
|
||||||
component/view/graphElements/GraphNode.cpp
|
component/view/graphElements/GraphNode.cpp
|
||||||
component/view/graphElements/GraphNode.h
|
component/view/graphElements/GraphNode.h
|
||||||
@@ -32,6 +34,8 @@ add_files(
|
|||||||
component/view/GraphView.h
|
component/view/GraphView.h
|
||||||
component/view/MainView.cpp
|
component/view/MainView.cpp
|
||||||
component/view/MainView.h
|
component/view/MainView.h
|
||||||
|
component/view/SearchView.cpp
|
||||||
|
component/view/SearchView.h
|
||||||
component/view/View.cpp
|
component/view/View.cpp
|
||||||
component/view/View.h
|
component/view/View.h
|
||||||
component/view/ViewLayout.cpp
|
component/view/ViewLayout.cpp
|
||||||
|
|||||||
@@ -3,8 +3,10 @@
|
|||||||
#include "component/Component.h"
|
#include "component/Component.h"
|
||||||
#include "component/controller/CodeController.h"
|
#include "component/controller/CodeController.h"
|
||||||
#include "component/controller/GraphController.h"
|
#include "component/controller/GraphController.h"
|
||||||
|
#include "component/controller/SearchController.h"
|
||||||
#include "component/view/CodeView.h"
|
#include "component/view/CodeView.h"
|
||||||
#include "component/view/GraphView.h"
|
#include "component/view/GraphView.h"
|
||||||
|
#include "component/view/SearchView.h"
|
||||||
#include "component/view/ViewLayout.h"
|
#include "component/view/ViewLayout.h"
|
||||||
#include "gui/GuiFactory.h"
|
#include "gui/GuiFactory.h"
|
||||||
|
|
||||||
@@ -44,6 +46,15 @@ std::shared_ptr<Component> ComponentFactory::createGraphComponent()
|
|||||||
return component;
|
return component;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<Component> ComponentFactory::createSearchComponent()
|
||||||
|
{
|
||||||
|
std::shared_ptr<SearchView> view = m_guiFactory->createSearchView(m_viewLayout);
|
||||||
|
std::shared_ptr<SearchController> controller = std::make_shared<SearchController>(m_graphAccess);
|
||||||
|
|
||||||
|
std::shared_ptr<Component> component = std::make_shared<Component>(view, controller);
|
||||||
|
return component;
|
||||||
|
}
|
||||||
|
|
||||||
ComponentFactory::ComponentFactory()
|
ComponentFactory::ComponentFactory()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public:
|
|||||||
|
|
||||||
std::shared_ptr<Component> createCodeComponent();
|
std::shared_ptr<Component> createCodeComponent();
|
||||||
std::shared_ptr<Component> createGraphComponent();
|
std::shared_ptr<Component> createGraphComponent();
|
||||||
|
std::shared_ptr<Component> createSearchComponent();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ComponentFactory();
|
ComponentFactory();
|
||||||
|
|||||||
@@ -28,11 +28,13 @@ void ComponentManager::setup()
|
|||||||
GraphView* graphView = graphComponent->getView<GraphView>();
|
GraphView* graphView = graphComponent->getView<GraphView>();
|
||||||
graphView->addNode(Vec2i(-100, -100), "foo");
|
graphView->addNode(Vec2i(-100, -100), "foo");
|
||||||
graphView->addNode(Vec2i(50, 50), "bar");
|
graphView->addNode(Vec2i(50, 50), "bar");
|
||||||
|
|
||||||
m_components.push_back(graphComponent);
|
m_components.push_back(graphComponent);
|
||||||
|
|
||||||
std::shared_ptr<Component> codeComponent = m_componentFactory->createCodeComponent();
|
std::shared_ptr<Component> codeComponent = m_componentFactory->createCodeComponent();
|
||||||
m_components.push_back(codeComponent);
|
m_components.push_back(codeComponent);
|
||||||
|
|
||||||
|
std::shared_ptr<Component> searchComponent = m_componentFactory->createSearchComponent();
|
||||||
|
m_components.push_back(searchComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
ComponentManager::ComponentManager()
|
ComponentManager::ComponentManager()
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ struct AnnotatedText
|
|||||||
Id tokenId;
|
Id tokenId;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CodeController: public Controller, public MessageListener<MessageActivateToken>
|
class CodeController
|
||||||
|
: public Controller
|
||||||
|
, public MessageListener<MessageActivateToken>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CodeController(std::shared_ptr<LocationAccess> locationAccess);
|
CodeController(std::shared_ptr<LocationAccess> locationAccess);
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
#include "component/controller/SearchController.h"
|
||||||
|
|
||||||
|
#include "component/view/SearchView.h"
|
||||||
|
#include "data/access/GraphAccess.h"
|
||||||
|
#include "utility/messaging/type/MessageActivateToken.h"
|
||||||
|
|
||||||
|
SearchController::SearchController(std::shared_ptr<GraphAccess> graphAccess)
|
||||||
|
: m_graphAccess(graphAccess)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
SearchController::~SearchController()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchController::search(const std::string& s)
|
||||||
|
{
|
||||||
|
LOG_INFO("searching string: \"" + s + "\"");
|
||||||
|
Id nodeId = m_graphAccess->getIdForNodeWithName(s);
|
||||||
|
if (nodeId > 0)
|
||||||
|
{
|
||||||
|
LOG_INFO("Node with name \"" + s + "\" found.");
|
||||||
|
MessageActivateToken message(nodeId);
|
||||||
|
message.dispatch();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG_INFO("Node with name \"" + s + "\" not found.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SearchController::handleMessage(MessageActivateToken* message)
|
||||||
|
{
|
||||||
|
getView()->setText(m_graphAccess->getNameForNodeWithId(message->tokenId));
|
||||||
|
}
|
||||||
|
|
||||||
|
SearchView* SearchController::getView()
|
||||||
|
{
|
||||||
|
return Controller::getView<SearchView>();
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#ifndef SEARCH_CONTROLLER_H
|
||||||
|
#define SEARCH_CONTROLLER_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "component/controller/Controller.h"
|
||||||
|
#include "utility/messaging/MessageListener.h"
|
||||||
|
#include "utility/messaging/type/MessageActivateToken.h"
|
||||||
|
|
||||||
|
class GraphAccess;
|
||||||
|
class SearchView;
|
||||||
|
|
||||||
|
class SearchController
|
||||||
|
: public Controller
|
||||||
|
, public MessageListener<MessageActivateToken>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SearchController(std::shared_ptr<GraphAccess> graphAccess);
|
||||||
|
~SearchController();
|
||||||
|
|
||||||
|
void search(const std::string& s);
|
||||||
|
//void autocomplete(const std::string& s);
|
||||||
|
|
||||||
|
private:
|
||||||
|
virtual void handleMessage(MessageActivateToken* message);
|
||||||
|
SearchView* getView();
|
||||||
|
|
||||||
|
std::shared_ptr<GraphAccess> m_graphAccess;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SEARCH_CONTROLLER_H
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#include "component/view/SearchView.h"
|
||||||
|
|
||||||
|
#include "component/controller/SearchController.h"
|
||||||
|
|
||||||
|
SearchView::SearchView(ViewLayout* viewLayout)
|
||||||
|
: View(viewLayout, Vec2i(100, 100))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
SearchView::~SearchView()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string SearchView::getName() const
|
||||||
|
{
|
||||||
|
return "SearchView";
|
||||||
|
}
|
||||||
|
|
||||||
|
SearchController* SearchView::getController()
|
||||||
|
{
|
||||||
|
return View::getController<SearchController>();
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef SEARCH_VIEW_H
|
||||||
|
#define SEARCH_VIEW_H
|
||||||
|
|
||||||
|
#include "component/view/View.h"
|
||||||
|
|
||||||
|
class SearchController;
|
||||||
|
|
||||||
|
class SearchView : public View
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SearchView(ViewLayout* viewLayout);
|
||||||
|
virtual ~SearchView();
|
||||||
|
|
||||||
|
virtual std::string getName() const;
|
||||||
|
|
||||||
|
virtual void setText(const std::string& s) const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
SearchController* getController();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SEARCH_VIEW_H
|
||||||
@@ -175,9 +175,20 @@ void Storage::logLocations() const
|
|||||||
LOG_INFO(str.str());
|
LOG_INFO(str.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
Token* Storage::getToken(Id tokenId) const
|
|
||||||
|
Id Storage::getIdForNodeWithName(const std::string& name) const
|
||||||
{
|
{
|
||||||
return m_graph.getTokenById(tokenId); // Todo: copy information.
|
Node* node = m_graph.findNode([&](Node* node){
|
||||||
|
return node->getName() == name;
|
||||||
|
});
|
||||||
|
|
||||||
|
return (node ? node->getId() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Storage::getNameForNodeWithId(Id id) const
|
||||||
|
{
|
||||||
|
Node* node = m_graph.getNodeById(id);
|
||||||
|
return (node ? node->getName() : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
TokenLocationCollection Storage::getTokenLocationsForTokenId(Id id) const
|
TokenLocationCollection Storage::getTokenLocationsForTokenId(Id id) const
|
||||||
|
|||||||
@@ -45,8 +45,11 @@ public:
|
|||||||
void logGraph() const;
|
void logGraph() const;
|
||||||
void logLocations() const;
|
void logLocations() const;
|
||||||
|
|
||||||
virtual Token* getToken(Id tokenId) const;
|
// GraphAccess implementation
|
||||||
|
virtual Id getIdForNodeWithName(const std::string& name) const;
|
||||||
|
virtual std::string getNameForNodeWithId(Id id) const;
|
||||||
|
|
||||||
|
// LocationAccess implementation
|
||||||
virtual TokenLocationCollection getTokenLocationsForTokenId(Id locationId) const;
|
virtual TokenLocationCollection getTokenLocationsForTokenId(Id locationId) const;
|
||||||
virtual TokenLocationFile getTokenLocationsForLinesInFile(
|
virtual TokenLocationFile getTokenLocationsForLinesInFile(
|
||||||
const std::string& fileName, unsigned int firstLineNumber, unsigned int lastLineNumber
|
const std::string& fileName, unsigned int firstLineNumber, unsigned int lastLineNumber
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#ifndef GRAPH_ACCESS_H
|
#ifndef GRAPH_ACCESS_H
|
||||||
#define GRAPH_ACCESS_H
|
#define GRAPH_ACCESS_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "utility/types.h"
|
#include "utility/types.h"
|
||||||
|
|
||||||
class Token;
|
class Token;
|
||||||
@@ -10,7 +12,8 @@ class GraphAccess
|
|||||||
public:
|
public:
|
||||||
virtual ~GraphAccess();
|
virtual ~GraphAccess();
|
||||||
|
|
||||||
virtual Token* getToken(Id tokenId) const = 0;
|
virtual Id getIdForNodeWithName(const std::string& name) const = 0;
|
||||||
|
virtual std::string getNameForNodeWithId(Id id) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
class CodeView;
|
class CodeView;
|
||||||
class GraphView;
|
class GraphView;
|
||||||
class MainView;
|
class MainView;
|
||||||
|
class SearchView;
|
||||||
class ViewLayout;
|
class ViewLayout;
|
||||||
|
|
||||||
class GuiFactory
|
class GuiFactory
|
||||||
@@ -17,6 +18,7 @@ public:
|
|||||||
virtual std::shared_ptr<MainView> createMainView() const = 0;
|
virtual std::shared_ptr<MainView> createMainView() const = 0;
|
||||||
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const = 0;
|
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const = 0;
|
||||||
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const = 0;
|
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const = 0;
|
||||||
|
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GUI_FACTORY_H
|
#endif // GUI_FACTORY_H
|
||||||
|
|||||||
Reference in New Issue
Block a user