Newer
Older
#ifndef MANTID_KERNEL_VISIBLEWHENPROPERTY_H_
#define MANTID_KERNEL_VISIBLEWHENPROPERTY_H_
#include "MantidKernel/System.h"
#include "MantidKernel/EnabledWhenProperty.h"
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
namespace Mantid {
namespace Kernel {
/** Same as EnabledWhenProperty, but returns the value for the
* isVisible() property intead of the isEnabled() property.
@author Janik Zikovsky
@date 2011-08-26
Copyright © 2011 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport VisibleWhenProperty : public EnabledWhenProperty {
public:
//--------------------------------------------------------------------------------------------
/** Constructor
* @param otherPropName :: Name of the OTHER property that we will check.
* @param when :: Criterion to evaluate
* @param value :: For the IS_EQUAL_TO or IS_NOT_EQUAL_TO condition, the value
* (as string) to check for
*/
VisibleWhenProperty(std::string otherPropName, ePropertyCriterion when,
/** Multiple conditions constructor - takes two unique pointers to
* VisibleWhenProperty objects and returns the product of them
* with the specified logic operator.
* Note: With Unique pointers you will need to use std::move
* to transfer ownership of those objects to this one.
*
* @param conditionOne :: First VisibleWhenProperty object to use
* @param conditionTwo :: Second VisibleWhenProperty object to use
* @param localOperator :: The logic operator to apply across both
*conditions
*
*/
VisibleWhenProperty(std::unique_ptr<VisibleWhenProperty> &&conditionOne,
std::unique_ptr<VisibleWhenProperty> &&conditionTwo,
eLogicOperator logicalOperator);
/**
* Checks if the user specified combination of visible criterion
* returns a true or false value
*
* @return true if user specified combination was true.
* @throw If any problems was found
*/
virtual bool checkComparison(const IPropertyManager *algo) const;
//--------------------------------------------------------------------------------------------
/// Return true always
bool isEnabled(const IPropertyManager *) const override;
//--------------------------------------------------------------------------------------------
/// Return true/false based on whether the other property satisfies the
/// criterion
bool isVisible(const IPropertyManager *algo) const override;
//--------------------------------------------------------------------------------------------
/// Make a copy of the present type of validator
IPropertySettings *clone() override;
} // namespace Kernel
} // namespace Mantid
#endif /* MANTID_KERNEL_VISIBLEWHENPROPERTY_H_ */