Files
ox/src/nostalgia/studio/projectexplorer.hpp
T

41 lines
969 B
C++

/*
* Copyright 2016 - 2021 gary@drinkingtea.net
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include <ox/event/signal.hpp>
#include <ox/std/memory.hpp>
#include "lib/widget.hpp"
#include "projecttreemodel.hpp"
namespace nostalgia {
class ProjectExplorer: public studio::Widget {
private:
ox::UniquePtr<ProjectTreeModel> m_treeModel;
core::Context *m_ctx = nullptr;
public:
explicit ProjectExplorer(core::Context *ctx) noexcept;
void draw(core::Context *ctx) noexcept override;
void setModel(ox::UniquePtr<ProjectTreeModel> model) noexcept;
ox::Error refreshProjectTreeModel(const ox::String& = {}) noexcept;
constexpr ox::FileSystem *romFs() noexcept {
return m_ctx->rom.get();
}
// slots
public:
ox::Signal<ox::Error(const ox::String&)> fileChosen;
};
}