]> vaikene.ee Git - evaf/blob - src/plugins/SdiWindow/isdiwindow.h
Warning fixes and copyright update.
[evaf] / src / plugins / SdiWindow / isdiwindow.h
1 /**
2 * @file SdiWindow/isdiwindow.h
3 * @brief eVaf SDI window interface
4 * @author Enar Vaikene
5 *
6 * Copyright (c) 2011-2019 Enar Vaikene
7 *
8 * This file is part of the eVaf C++ cross-platform application development framework.
9 *
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
15 *
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
18 */
19
20 #ifndef __SDIWINDOW_ISDIWINDOW_H
21 # define __SDIWINDOW_ISDIWINDOW_H
22
23 #include "libsdiwindow.h"
24
25 #include <QString>
26 #include <QtPlugin>
27
28 class QWidget;
29 class QLayout;
30
31 namespace eVaf {
32
33 namespace Gui {
34 class Panel;
35 } // namespace eVaf::Gui
36
37 namespace SdiWindow {
38
39 /**
40 * Single Document Interface window manager for eVaf applications.
41 *
42 * The iSdiWindow interface implements an SDI window manager.
43 */
44 struct SDIWINDOW_EXPORT iSdiWindow
45 {
46 /**
47 * Returns the iSdiWindow interface instance
48 * @return The iSdiWindow interface or zero if not available
49 *
50 * This function returns the global iSdiWindow interface instance. Using this function
51 * is not mandatory and modules can use the iRegistry interface instead. Using the iRegistry
52 * interface has the advantage that modules do not need to link against this library.
53 */
54 static iSdiWindow * instance();
55
56 /**
57 * Empty virtual destructor
58 */
59 virtual ~iSdiWindow() {}
60
61 /**
62 * Adds a panel to the SDI window manager
63 * @param name Name of the panel
64 * @param panel The panel
65 *
66 * This function adds a panel to the SDI window manager. The ownership of the panel
67 * is transferred to the window manager and it is the responsibility of the window
68 * manager to delete it.
69 */
70 virtual void addPanel(QString const & name, Gui::Panel * panel) = 0;
71
72 /**
73 * Returns a panel by the name
74 * @param name Name of the panel
75 * @return Pointer to the panel or 0 if failed
76 *
77 * This function returns a panel identified by the name.
78 */
79 virtual Gui::Panel * panel(QString const & name) const = 0;
80
81 /**
82 * Shows a panel
83 * @param name Name of the panel
84 * @return True if succeeded; false if not
85 *
86 * This function shows the panel.
87 */
88 virtual bool showPanel(QString const & name) = 0;
89
90 };
91
92 } // namespace eVaf::SdiWindow
93 } // namespace eVaf
94
95 Q_DECLARE_INTERFACE(eVaf::SdiWindow::iSdiWindow, "eVaf.SdiWindow.iSdiWindow/1.1")
96
97 #endif // isdiwindow.h