| 1 | // Aseprite |
|---|---|
| 2 | // Copyright (C) 2021 Igara Studio S.A. |
| 3 | // Copyright (C) 2016 David Capello |
| 4 | // |
| 5 | // This program is distributed under the terms of |
| 6 | // the End-User License Agreement for Aseprite. |
| 7 | |
| 8 | #ifndef APP_UI_BROWSER_VIEW_H_INCLUDED |
| 9 | #define APP_UI_BROWSER_VIEW_H_INCLUDED |
| 10 | #pragma once |
| 11 | |
| 12 | #include "app/ui/tabs.h" |
| 13 | #include "app/ui/workspace_view.h" |
| 14 | #include "ui/view.h" |
| 15 | |
| 16 | namespace app { |
| 17 | class BrowserView : public ui::Widget |
| 18 | , public TabView |
| 19 | , public WorkspaceView { |
| 20 | public: |
| 21 | BrowserView(); |
| 22 | ~BrowserView(); |
| 23 | |
| 24 | void loadFile(const std::string& file, |
| 25 | const std::string& section = std::string()); |
| 26 | |
| 27 | // TabView implementation |
| 28 | std::string getTabText() override; |
| 29 | TabIcon getTabIcon() override; |
| 30 | gfx::Color getTabColor() override; |
| 31 | |
| 32 | // WorkspaceView implementation |
| 33 | ui::Widget* getContentWidget() override { return this; } |
| 34 | bool canCloneWorkspaceView() override { return true; } |
| 35 | WorkspaceView* cloneWorkspaceView() override; |
| 36 | void onWorkspaceViewSelected() override; |
| 37 | bool onCloseView(Workspace* workspace, bool quitting) override; |
| 38 | void onTabPopup(Workspace* workspace) override; |
| 39 | |
| 40 | private: |
| 41 | class CMarkBox; |
| 42 | |
| 43 | ui::View m_view; |
| 44 | CMarkBox* m_textBox; |
| 45 | }; |
| 46 | |
| 47 | } // namespace app |
| 48 | |
| 49 | #endif |
| 50 |