Mantid
Loading...
Searching...
No Matches
IPropertySettings.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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#include "MantidKernel/DllConfig.h"
10#include <string>
11#include <vector>
12
13namespace Mantid {
14namespace Kernel {
15//----------------------------------------------------------------------
16// Forward Declaration
17//----------------------------------------------------------------------
18class IPropertyManager;
19class Property;
20
28class MANTID_KERNEL_DLL IPropertySettings {
29public:
31 IPropertySettings() = default;
32
34 virtual ~IPropertySettings() = default;
35
37 virtual bool isEnabled(const IPropertyManager *algo) const {
38 UNUSED_ARG(algo);
39 return true;
40 }
41
43 virtual bool isVisible(const IPropertyManager *algo) const {
44 UNUSED_ARG(algo);
45 return true;
46 }
47
50 virtual bool isConditionChanged(const IPropertyManager *algo, const std::string &changedPropName = "") const {
51 UNUSED_ARG(algo);
52 UNUSED_ARG(changedPropName);
53 return false;
54 }
55
61 virtual bool applyChanges(const IPropertyManager *algo, const std::string &currentPropName) {
62 UNUSED_ARG(algo);
63 UNUSED_ARG(currentPropName);
64 return false;
65 }
66
68 virtual std::vector<std::string> dependsOn(const std::string & /* unused */) const {
69 return std::vector<std::string>();
70 }
71
72 //--------------------------------------------------------------------------------------------
74 virtual IPropertySettings *clone() const = 0;
75
76protected:
77 // non-copyable directly
79};
80
81} // namespace Kernel
82} // namespace Mantid
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Definition System.h:48
Interface to PropertyManager.
Interface for modifiers to Property's that specify if they should be enabled or visible in a GUI.
virtual std::vector< std::string > dependsOn(const std::string &) const
Other properties that this property depends on.
virtual ~IPropertySettings()=default
Destructor.
virtual bool isEnabled(const IPropertyManager *algo) const
Is the property to be shown as "enabled" in the GUI.
IPropertySettings()=default
Constructor.
virtual bool applyChanges(const IPropertyManager *algo, const std::string &currentPropName)
Overload this virtual function in order to modify the current property based on changes to other prop...
virtual bool isConditionChanged(const IPropertyManager *algo, const std::string &changedPropName="") const
to verify if the properties, this one depends on have changed or other special condition occurs which...
IPropertySettings(const IPropertySettings &)=default
virtual bool isVisible(const IPropertyManager *algo) const
Is the property to be shown in the GUI? Default true.
virtual IPropertySettings * clone() const =0
Make a copy of the present type of IPropertySettings.
Helper class which provides the Collimation Length for SANS instruments.