#include "searchinfoprovider.h" #include #include "viewarea.h" #include "notebookexplorer.h" #include "notebookmgr.h" #include "mainwindow.h" using namespace vnotex; SearchInfoProvider::SearchInfoProvider(const ViewArea *p_viewArea, const NotebookExplorer *p_notebookExplorer, const NotebookMgr *p_notebookMgr) : m_viewArea(p_viewArea), m_notebookExplorer(p_notebookExplorer), m_notebookMgr(p_notebookMgr) { } QList SearchInfoProvider::getBuffers() const { return m_viewArea->getAllBuffersInViewSplits(); } Node *SearchInfoProvider::getCurrentFolder() const { return m_notebookExplorer->currentExploredFolderNode(); } Notebook *SearchInfoProvider::getCurrentNotebook() const { return m_notebookExplorer->currentNotebook().data(); } QVector SearchInfoProvider::getNotebooks() const { auto notebooks = m_notebookMgr->getNotebooks(); QVector nbs; nbs.reserve(notebooks.size()); for (const auto &nb : notebooks) { nbs.push_back(nb.data()); } return nbs; } QSharedPointer SearchInfoProvider::create(const MainWindow *p_mainWindow) { return QSharedPointer::create(p_mainWindow->getViewArea(), p_mainWindow->getNotebookExplorer(), &VNoteX::getInst().getNotebookMgr()); }