| 1 | // Aseprite |
| 2 | // Copyright (C) 2019 Igara Studio S.A. |
| 3 | // Copyright (C) 2001-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_WORKSPACE_VIEW_H_INCLUDED |
| 9 | #define APP_UI_WORKSPACE_VIEW_H_INCLUDED |
| 10 | #pragma once |
| 11 | |
| 12 | namespace ui { |
| 13 | class Widget; |
| 14 | } |
| 15 | |
| 16 | namespace app { |
| 17 | class InputChainElement; |
| 18 | class Workspace; |
| 19 | |
| 20 | class WorkspaceView { |
| 21 | public: |
| 22 | virtual ~WorkspaceView() { } |
| 23 | |
| 24 | virtual ui::Widget* getContentWidget() = 0; |
| 25 | |
| 26 | virtual bool canCloneWorkspaceView() { return false; } |
| 27 | virtual WorkspaceView* cloneWorkspaceView() { return nullptr; } |
| 28 | |
| 29 | // Called after the view is added in the correct position inside |
| 30 | // the workspace. It can be used to copy/clone scroll position |
| 31 | // from the original view. |
| 32 | virtual void onClonedFrom(WorkspaceView* from) { |
| 33 | // Do nothing |
| 34 | } |
| 35 | |
| 36 | virtual void onWorkspaceViewSelected() = 0; |
| 37 | |
| 38 | // Returns true if the view was closed successfully or false if |
| 39 | // the user cancels the operation. |
| 40 | virtual bool onCloseView(Workspace* workspace, bool quitting) = 0; |
| 41 | |
| 42 | virtual void onAfterRemoveView(Workspace* workspace) { } |
| 43 | |
| 44 | virtual void (Workspace* workspace) = 0; |
| 45 | |
| 46 | virtual InputChainElement* onGetInputChainElement() { return nullptr; } |
| 47 | }; |
| 48 | |
| 49 | } // namespace app |
| 50 | |
| 51 | #endif |
| 52 | |