Mercurial > hg > orthanc-stone
annotate Applications/IStoneApplication.h @ 307:be2660b6e40a am-callable-and-promise
wip: commands + status update
author | am@osimis.io |
---|---|
date | Tue, 25 Sep 2018 15:14:53 +0200 |
parents | 8c8da145fefa |
children | daa04d15192c |
rev | line source |
---|---|
0 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
134
4cff7b1ed31d
upgrade to year 2018
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
51
diff
changeset
|
5 * Copyright (C) 2017-2018 Osimis S.A., Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
47 | 8 * modify it under the terms of the GNU Affero General Public License |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
0 | 11 * |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
47 | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
0 | 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
288 | 24 #include "StoneApplicationContext.h" |
0 | 25 #include <boost/program_options.hpp> |
222 | 26 #include "../Framework/Viewport/WidgetViewport.h" |
287 | 27 #include "json/json.h" |
307 | 28 #include "Commands/ICommand.h" |
29 #include "Commands/BaseCommandBuilder.h" | |
0 | 30 |
31 namespace OrthancStone | |
32 { | |
288 | 33 // a StoneApplication is an application that can actually be executed |
34 // in multiple environments. i.e: it can run natively integrated in a QtApplication | |
35 // or it can be executed as part of a WebPage when compiled into WebAssembly. | |
36 class IStoneApplication : public boost::noncopyable | |
0 | 37 { |
242 | 38 protected: |
288 | 39 StoneApplicationContext* context_; |
242 | 40 |
0 | 41 public: |
288 | 42 virtual ~IStoneApplication() |
0 | 43 { |
44 } | |
45 | |
221
d7b2590744f8
wip: building applications reusable in SDL and WASM
am@osimis.io
parents:
134
diff
changeset
|
46 virtual void DeclareStartupOptions(boost::program_options::options_description& options) = 0; |
288 | 47 virtual void Initialize(StoneApplicationContext* context, |
242 | 48 IStatusBar& statusBar, |
221
d7b2590744f8
wip: building applications reusable in SDL and WASM
am@osimis.io
parents:
134
diff
changeset
|
49 const boost::program_options::variables_map& parameters) = 0; |
274
dc1beee33134
split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
242
diff
changeset
|
50 #if ORTHANC_ENABLE_WASM==1 |
242 | 51 virtual void InitializeWasm() {} // specific initialization when the app is running in WebAssembly. This is called after the other Initialize() |
222 | 52 #endif |
0 | 53 |
54 virtual std::string GetTitle() const = 0; | |
242 | 55 virtual IWidget* GetCentralWidget() = 0; |
0 | 56 |
57 virtual void Finalize() = 0; | |
307 | 58 |
59 virtual BaseCommandBuilder& GetCommandBuilder() = 0; | |
60 | |
61 virtual void ExecuteCommand(ICommand& command) | |
62 { | |
63 } | |
0 | 64 }; |
221
d7b2590744f8
wip: building applications reusable in SDL and WASM
am@osimis.io
parents:
134
diff
changeset
|
65 |
0 | 66 } |