Mercurial > hg > orthanc-stone
annotate Applications/IStoneApplication.h @ 1364:dd50d0852ae2 broker
SdlSimpleViewer fixes
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Sat, 18 Apr 2020 14:35:10 +0200 |
parents | 7ec8fea061b9 |
children |
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 | |
1270
2d8ab34c8c91
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
732
diff
changeset
|
5 * Copyright (C) 2017-2020 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" |
732
c35e98d22764
move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
726
diff
changeset
|
25 #include "../Framework/Deprecated/Viewport/WidgetViewport.h" |
c35e98d22764
move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
726
diff
changeset
|
26 |
0 | 27 #include <boost/program_options.hpp> |
732
c35e98d22764
move Deprecated classes to a separate folder
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
726
diff
changeset
|
28 #include <json/json.h> |
319
daa04d15192c
new SimpleViewer sample that has been split in multiple files to be able to scale it
am@osimis.io
parents:
307
diff
changeset
|
29 |
0 | 30 namespace OrthancStone |
31 { | |
319
daa04d15192c
new SimpleViewer sample that has been split in multiple files to be able to scale it
am@osimis.io
parents:
307
diff
changeset
|
32 #if ORTHANC_ENABLE_QT==1 |
daa04d15192c
new SimpleViewer sample that has been split in multiple files to be able to scale it
am@osimis.io
parents:
307
diff
changeset
|
33 class QStoneMainWindow; |
daa04d15192c
new SimpleViewer sample that has been split in multiple files to be able to scale it
am@osimis.io
parents:
307
diff
changeset
|
34 #endif |
daa04d15192c
new SimpleViewer sample that has been split in multiple files to be able to scale it
am@osimis.io
parents:
307
diff
changeset
|
35 |
288 | 36 // a StoneApplication is an application that can actually be executed |
37 // in multiple environments. i.e: it can run natively integrated in a QtApplication | |
38 // or it can be executed as part of a WebPage when compiled into WebAssembly. | |
39 class IStoneApplication : public boost::noncopyable | |
0 | 40 { |
242 | 41 protected: |
288 | 42 StoneApplicationContext* context_; |
242 | 43 |
0 | 44 public: |
288 | 45 virtual ~IStoneApplication() |
0 | 46 { |
47 } | |
48 | |
221
d7b2590744f8
wip: building applications reusable in SDL and WASM
am@osimis.io
parents:
134
diff
changeset
|
49 virtual void DeclareStartupOptions(boost::program_options::options_description& options) = 0; |
288 | 50 virtual void Initialize(StoneApplicationContext* context, |
726
4f2416d519b4
moving layers, widgets and loaders to Deprecated namespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
535
diff
changeset
|
51 Deprecated::IStatusBar& statusBar, |
221
d7b2590744f8
wip: building applications reusable in SDL and WASM
am@osimis.io
parents:
134
diff
changeset
|
52 const boost::program_options::variables_map& parameters) = 0; |
535
79bb0a02d1cc
- Added ORTHANC_OVERRIDE to several methods (translates to "override" in C++ 11 compilers)
Benjamin Golinvaux <bgo@osimis.io>
parents:
527
diff
changeset
|
53 |
79bb0a02d1cc
- Added ORTHANC_OVERRIDE to several methods (translates to "override" in C++ 11 compilers)
Benjamin Golinvaux <bgo@osimis.io>
parents:
527
diff
changeset
|
54 /** |
79bb0a02d1cc
- Added ORTHANC_OVERRIDE to several methods (translates to "override" in C++ 11 compilers)
Benjamin Golinvaux <bgo@osimis.io>
parents:
527
diff
changeset
|
55 This method is meant to process messages received from the outside world (i.e. GUI) |
79bb0a02d1cc
- Added ORTHANC_OVERRIDE to several methods (translates to "override" in C++ 11 compilers)
Benjamin Golinvaux <bgo@osimis.io>
parents:
527
diff
changeset
|
56 */ |
79bb0a02d1cc
- Added ORTHANC_OVERRIDE to several methods (translates to "override" in C++ 11 compilers)
Benjamin Golinvaux <bgo@osimis.io>
parents:
527
diff
changeset
|
57 virtual void HandleSerializedMessage(const char* data) = 0; |
79bb0a02d1cc
- Added ORTHANC_OVERRIDE to several methods (translates to "override" in C++ 11 compilers)
Benjamin Golinvaux <bgo@osimis.io>
parents:
527
diff
changeset
|
58 |
274
dc1beee33134
split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents:
242
diff
changeset
|
59 #if ORTHANC_ENABLE_WASM==1 |
242 | 60 virtual void InitializeWasm() {} // specific initialization when the app is running in WebAssembly. This is called after the other Initialize() |
222 | 61 #endif |
319
daa04d15192c
new SimpleViewer sample that has been split in multiple files to be able to scale it
am@osimis.io
parents:
307
diff
changeset
|
62 #if ORTHANC_ENABLE_QT==1 |
daa04d15192c
new SimpleViewer sample that has been split in multiple files to be able to scale it
am@osimis.io
parents:
307
diff
changeset
|
63 virtual QStoneMainWindow* CreateQtMainWindow() = 0; |
daa04d15192c
new SimpleViewer sample that has been split in multiple files to be able to scale it
am@osimis.io
parents:
307
diff
changeset
|
64 #endif |
0 | 65 |
66 virtual std::string GetTitle() const = 0; | |
1069 | 67 |
68 virtual void SetCentralWidget(boost::shared_ptr<Deprecated::IWidget> widget) = 0; | |
69 | |
70 virtual boost::shared_ptr<Deprecated::IWidget> GetCentralWidget() = 0; | |
71 | |
0 | 72 virtual void Finalize() = 0; |
73 }; | |
74 } |