Debian Codegraph @

avogadro/qtgui/viewfactory.h

raw
1 /******************************************************************************
2 This source file is part of the Avogadro project.
3 This source code is released under the 3-Clause BSD License, (see "LICENSE").
4 ******************************************************************************/
5
6 #ifndef AVOGADRO_QTGUI_VIEWFACTORY_H
7 #define AVOGADRO_QTGUI_VIEWFACTORY_H
8
9 #include "avogadroqtguiexport.h"
10
11 #include <QtWidgets/QWidget>
12
13 namespace Avogadro {
14 namespace QtGui {
15
16 /**
17 * @class ViewFactory viewfactory.h <avogadro/qtgui/viewfactory.h>
18 * @brief The ViewFactory class is a pure virtual that provides a method of
19 * dynamically adding views to the MultiViewWidget class.
20 * @author Marcus D. Hanwell
21 */
22
23 class AVOGADROQTGUI_EXPORT ViewFactory
24 {
25 public:
26 ViewFactory();
27 virtual ~ViewFactory();
28
29 /**
30 * @brief Get the list of views the factory provides.
31 * @return A list of supported views.
32 */
33 virtual QStringList views() const = 0;
34
35 /**
36 * @brief Create a named view, the caller assumes ownership of the widget.
37 * @param view The name of the view.
38 * @return A new widget of the requested type, nullptr if none exists.
39 */
40 virtual QWidget* createView(const QString& view) = 0;
41 };
42
43 } // namespace QtGui
44 } // namespace Avogadro
45
46 #endif // AVOGADRO_QTGUI_VIEWFACTORY_H