annotate Applications/IStoneApplication.h @ 483:29fc066b6f65 am-touch-events

Export now accepts Json::Value
author am@osimis.io
date Fri, 15 Feb 2019 10:39:23 +0100
parents b70e9be013e4
children 7105a0bad250
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
439
b70e9be013e4 preparing for 2019
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 319
diff changeset
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
10 * the License, or (at your option) any later version.
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
15 * Affero General Public License for more details.
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
16 *
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
288
8c8da145fefa renamings and doc
am@osimis.io
parents: 287
diff changeset
24 #include "StoneApplicationContext.h"
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include <boost/program_options.hpp>
222
84844649a8fd continued: reusable applications
am@osimis.io
parents: 221
diff changeset
26 #include "../Framework/Viewport/WidgetViewport.h"
287
2038d76bf13f interaction with HTML/JS
am@osimis.io
parents: 274
diff changeset
27 #include "json/json.h"
307
be2660b6e40a wip: commands + status update
am@osimis.io
parents: 288
diff changeset
28 #include "Commands/ICommand.h"
be2660b6e40a wip: commands + status update
am@osimis.io
parents: 288
diff changeset
29 #include "Commands/BaseCommandBuilder.h"
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
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
31
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 namespace OrthancStone
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
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
34 #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
35 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
36 #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
37
288
8c8da145fefa renamings and doc
am@osimis.io
parents: 287
diff changeset
38 // a StoneApplication is an application that can actually be executed
8c8da145fefa renamings and doc
am@osimis.io
parents: 287
diff changeset
39 // in multiple environments. i.e: it can run natively integrated in a QtApplication
8c8da145fefa renamings and doc
am@osimis.io
parents: 287
diff changeset
40 // or it can be executed as part of a WebPage when compiled into WebAssembly.
8c8da145fefa renamings and doc
am@osimis.io
parents: 287
diff changeset
41 class IStoneApplication : public boost::noncopyable
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 {
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 235
diff changeset
43 protected:
288
8c8da145fefa renamings and doc
am@osimis.io
parents: 287
diff changeset
44 StoneApplicationContext* context_;
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 235
diff changeset
45
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 public:
288
8c8da145fefa renamings and doc
am@osimis.io
parents: 287
diff changeset
47 virtual ~IStoneApplication()
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50
221
d7b2590744f8 wip: building applications reusable in SDL and WASM
am@osimis.io
parents: 134
diff changeset
51 virtual void DeclareStartupOptions(boost::program_options::options_description& options) = 0;
288
8c8da145fefa renamings and doc
am@osimis.io
parents: 287
diff changeset
52 virtual void Initialize(StoneApplicationContext* context,
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 235
diff changeset
53 IStatusBar& statusBar,
221
d7b2590744f8 wip: building applications reusable in SDL and WASM
am@osimis.io
parents: 134
diff changeset
54 const boost::program_options::variables_map& parameters) = 0;
274
dc1beee33134 split SdlApplication into NativeApplication and SdlApplication
am@osimis.io
parents: 242
diff changeset
55 #if ORTHANC_ENABLE_WASM==1
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 235
diff changeset
56 virtual void InitializeWasm() {} // specific initialization when the app is running in WebAssembly. This is called after the other Initialize()
222
84844649a8fd continued: reusable applications
am@osimis.io
parents: 221
diff changeset
57 #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
58 #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
59 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
60 #endif
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 virtual std::string GetTitle() const = 0;
242
092db46c6291 improved SDL/Wasm unification
am@osimis.io
parents: 235
diff changeset
63 virtual IWidget* GetCentralWidget() = 0;
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 virtual void Finalize() = 0;
307
be2660b6e40a wip: commands + status update
am@osimis.io
parents: 288
diff changeset
66
be2660b6e40a wip: commands + status update
am@osimis.io
parents: 288
diff changeset
67 virtual BaseCommandBuilder& GetCommandBuilder() = 0;
be2660b6e40a wip: commands + status update
am@osimis.io
parents: 288
diff changeset
68
be2660b6e40a wip: commands + status update
am@osimis.io
parents: 288
diff changeset
69 virtual void ExecuteCommand(ICommand& command)
be2660b6e40a wip: commands + status update
am@osimis.io
parents: 288
diff changeset
70 {
be2660b6e40a wip: commands + status update
am@osimis.io
parents: 288
diff changeset
71 }
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 };
221
d7b2590744f8 wip: building applications reusable in SDL and WASM
am@osimis.io
parents: 134
diff changeset
73
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 }