Mantid
Loading...
Searching...
No Matches
InterfaceManager.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------
10// Includes
11//----------------------------------
12#include "DllOption.h"
13// #include "MantidKernel/SingletonHolder.h"
15
16#include <QHash>
17#include <QList>
18#include <QPointer>
19#include <QString>
20#include <QStringList>
21
22//----------------------------------
23// Qt Forward declarations
24//----------------------------------
25class QWidget;
26
27//----------------------------------
28// Mantid forward declarations
29//----------------------------------
30namespace Mantid {
31namespace API {
32class IAlgorithm;
33}
34} // namespace Mantid
35
36// Top level namespace for this library
37namespace MantidQt {
38
39namespace API {
40
41//----------------------------------
42// Forward declarations
43//----------------------------------
44class AlgorithmDialog;
45class UserSubWindow;
46class MantidHelpInterface;
47
58
59public:
61 AlgorithmDialog *createDialog(const std::shared_ptr<Mantid::API::IAlgorithm> &alg, QWidget *parent = nullptr,
62 bool forScript = false,
63 const QHash<QString, QString> &presetValues = (QHash<QString, QString>()),
64 const QString &optional_msg = QString(), const QStringList &enabled = QStringList(),
65 const QStringList &disabled = QStringList());
66
68 AlgorithmDialog *createDialogFromName(const QString &algorithmName, const int version = -1, QWidget *parent = nullptr,
69 bool forScript = false,
70 const QHash<QString, QString> &presetValues = (QHash<QString, QString>()),
71 const QString &optionalMsg = QString(),
72 const QStringList &enabled = QStringList(),
73 const QStringList &disabled = QStringList());
74
76 UserSubWindow *createSubWindow(const QString &interface_name, QWidget *parent = nullptr, bool isWindow = true);
77
82 MantidHelpInterface *createHelpWindow() const;
83
85 void showHelpPage(const QString &url = QString());
86
89 void showAlgorithmHelp(const QString &name, const int version = -1);
90
92 void showConceptHelp(const QString &name);
93
95 void showFitFunctionHelp(const QString &name = QString());
96
102 void showCustomInterfaceHelp(const QString &name, const QString &area = QString(),
103 const QString &section = QString());
104
106 void showWebPage(const QString &url);
107
108 void closeHelpWindow();
109
114 static void registerHelpWindowFactory(Mantid::Kernel::AbstractInstantiator<MantidHelpInterface> *factory);
115
117 static QList<QPointer<UserSubWindow>> &existingInterfaces();
118
120 QStringList getUserSubWindowKeys() const;
121
126
127 void showHomeHelpPage();
128 void cleanup();
129
130private:
131 void notifyExistingInterfaces(UserSubWindow *newWindow);
132
135};
136} // namespace API
137} // namespace MantidQt
138
140#define REGISTER_HELPWINDOW(TYPE) \
141 namespace { \
142 Mantid::Kernel::RegistrationHelper \
143 register_helpviewer(((MantidQt::API::InterfaceManager::registerHelpWindowFactory( \
144 new Mantid::Kernel::Instantiator<TYPE, MantidQt::API::MantidHelpInterface>())), \
145 0)); \
146 }
std::string name
Definition Run.cpp:60
#define EXPORT_OPT_MANTIDQT_COMMON
Definition DllOption.h:15
This class should be the basis for all customised algorithm dialogs.
This class is responsible for creating the correct dialog for an algorithm.
static Mantid::Kernel::AbstractInstantiator< MantidHelpInterface > * m_helpViewer
Handle to the help window factory.
virtual ~InterfaceManager()
Destructor.
This is the base class all customised user interfaces that do not wish to be tied to a specific Manti...
The base class for instantiators.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
Helper class which provides the Collimation Length for SANS instruments.