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 <QString>
18#include <QStringList>
19
20//----------------------------------
21// Qt Forward declarations
22//----------------------------------
23class QWidget;
24
25//----------------------------------
26// Mantid forward declarations
27//----------------------------------
28namespace Mantid {
29namespace API {
30class IAlgorithm;
31}
32} // namespace Mantid
33
34// Top level namespace for this library
35namespace MantidQt {
36
37namespace API {
38
39//----------------------------------
40// Forward declarations
41//----------------------------------
42class AlgorithmDialog;
43class UserSubWindow;
44class MantidHelpInterface;
45
56
57public:
59 AlgorithmDialog *createDialog(const std::shared_ptr<Mantid::API::IAlgorithm> &alg, QWidget *parent = nullptr,
60 bool forScript = false,
61 const QHash<QString, QString> &presetValues = (QHash<QString, QString>()),
62 const QString &optional_msg = QString(), const QStringList &enabled = QStringList(),
63 const QStringList &disabled = QStringList());
64
66 AlgorithmDialog *createDialogFromName(const QString &algorithmName, const int version = -1, QWidget *parent = nullptr,
67 bool forScript = false,
68 const QHash<QString, QString> &presetValues = (QHash<QString, QString>()),
69 const QString &optionalMsg = QString(),
70 const QStringList &enabled = QStringList(),
71 const QStringList &disabled = QStringList());
72
74 UserSubWindow *createSubWindow(const QString &interface_name, QWidget *parent = nullptr, bool isWindow = true);
75
80 MantidHelpInterface *createHelpWindow() const;
81
83 void showHelpPage(const QString &url = QString());
84
86 void showWikiPage(const QString &page = QString());
87
90 void showAlgorithmHelp(const QString &name, const int version = -1);
91
93 void showConceptHelp(const QString &name);
94
96 void showFitFunctionHelp(const QString &name = QString());
97
103 void showCustomInterfaceHelp(const QString &name, const QString &area = QString(),
104 const QString &section = QString());
105
107 void showWebPage(const QString &url);
108
109 void closeHelpWindow();
110
115 static void registerHelpWindowFactory(Mantid::Kernel::AbstractInstantiator<MantidHelpInterface> *factory);
116
118 QStringList getUserSubWindowKeys() const;
119
124
125private:
126 void notifyExistingInterfaces(UserSubWindow *newWindow);
127
130};
131} // namespace API
132} // namespace MantidQt
133
135#define REGISTER_HELPWINDOW(TYPE) \
136 namespace { \
137 Mantid::Kernel::RegistrationHelper \
138 register_helpviewer(((MantidQt::API::InterfaceManager::registerHelpWindowFactory( \
139 new Mantid::Kernel::Instantiator<TYPE, MantidHelpInterface>())), \
140 0)); \
141 }
#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...
Definition: UserSubWindow.h:70
The base class for instantiators.
Definition: Instantiator.h:25
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
Helper class which provides the Collimation Length for SANS instruments.