1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
40 void MIP::inherit( const MIP
& rMip
)
44 mbHasReadonly
= rMip
.hasReadonly();
45 mbReadonly
= rMip
.isReadonly();
49 mbHasRequired
= rMip
.hasRequired();
50 mbRequired
= rMip
.isRequired();
54 mbHasRelevant
= rMip
.hasRelevant();
55 mbRelevant
= rMip
.isRelevant();
57 if( ! mbHasConstraint
)
59 mbHasConstraint
= rMip
.hasConstraint();
60 mbConstraint
= rMip
.isConstraint();
61 msConstraintExplanation
= rMip
.getConstraintExplanation();
63 if( ! mbHasCalculate
)
65 mbHasCalculate
= rMip
.hasCalculate();
69 mbHasTypeName
= rMip
.hasTypeName();
70 msTypeName
= rMip
.getTypeName();
74 void MIP::join( const MIP
& rMip
)
76 // TODO: inherit only inheritable MIPs...
80 bool MIP::isReadonly() const { return mbHasReadonly
? mbReadonly
: mbHasCalculate
; }
81 void MIP::setReadonly( bool b
) { mbHasReadonly
= true; mbReadonly
= b
; }
82 void MIP::resetReadonly() { mbHasReadonly
= false; mbReadonly
= false; }
84 void MIP::setRequired( bool b
) { mbHasRequired
= true; mbRequired
= b
; }
85 void MIP::resetRequired() { mbHasRequired
= false; mbRequired
= false; }
87 void MIP::setRelevant( bool b
) { mbHasRelevant
= true; mbRelevant
= b
; }
88 void MIP::resetRelevant() { mbHasRelevant
= false; mbRelevant
= true; }
90 void MIP::setConstraint( bool b
) { mbHasConstraint
= true; mbConstraint
= b
; msConstraintExplanation
.clear(); }
91 void MIP::resetConstraint() { mbHasConstraint
= false; mbConstraint
= true; msConstraintExplanation
.clear(); }
93 void MIP::setConstraintExplanation( const OUString
& s
) { msConstraintExplanation
= s
; }
96 void MIP::setHasCalculate( bool b
) { mbHasCalculate
= b
; }
97 void MIP::resetCalculate() { mbHasCalculate
= false; }
99 void MIP::setTypeName( const OUString
& s
) { msTypeName
= s
; mbHasTypeName
= true; }
100 void MIP::resetTypeName() { msTypeName
.clear(); mbHasTypeName
= false; }
105 } // namespace xforms
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */