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
12namespace Mantid {
13namespace Kernel {
14//----------------------------------------------------------------------
15// Forward Declaration
16//----------------------------------------------------------------------
17class IPropertyManager;
18class Property;
19
27class MANTID_KERNEL_DLL IPropertySettings {
28public:
30 IPropertySettings() = default;
31
33 virtual ~IPropertySettings() = default;
34
36 virtual bool isEnabled(const IPropertyManager *algo) const {
37 UNUSED_ARG(algo);
38 return true;
39 }
40
42 virtual bool isVisible(const IPropertyManager *algo) const {
43 UNUSED_ARG(algo);
44 return true;
45 }
48 virtual bool isConditionChanged(const IPropertyManager *algo, const std::string &changedPropName = "") const {
49 UNUSED_ARG(algo);
50 UNUSED_ARG(changedPropName);
51 return false;
52 }
53
71 virtual void applyChanges(const IPropertyManager *, Property *const) {}
72
73 //--------------------------------------------------------------------------------------------
75 virtual IPropertySettings *clone() const = 0;
76
77protected:
78 // non-copyable directly
80};
81
82} // namespace Kernel
83} // namespace Mantid
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Definition: System.h:64
Interface to PropertyManager.
Interface for modifiers to Property's that specify if they should be enabled or visible in a GUI.
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 void applyChanges(const IPropertyManager *, Property *const)
The function user have to overload it in their custom code to modify the property according to the ch...
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.
Base class for properties.
Definition: Property.h:94
Helper class which provides the Collimation Length for SANS instruments.