1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_forms.hxx"
50 void MIP::inherit( const MIP
& rMip
)
54 mbHasReadonly
= rMip
.hasReadonly();
55 mbReadonly
= rMip
.isReadonly();
59 mbHasRequired
= rMip
.hasRequired();
60 mbRequired
= rMip
.isRequired();
64 mbHasRelevant
= rMip
.hasRelevant();
65 mbRelevant
= rMip
.isRelevant();
67 if( ! mbHasConstraint
)
69 mbHasConstraint
= rMip
.hasConstraint();
70 mbConstraint
= rMip
.isConstraint();
71 msConstraintExplanation
= rMip
.getConstraintExplanation();
73 if( ! mbHasCalculate
)
75 mbHasCalculate
= rMip
.hasCalculate();
79 mbHasTypeName
= rMip
.hasTypeName();
80 msTypeName
= rMip
.getTypeName();
84 void MIP::join( const MIP
& rMip
)
86 // TODO: inherit only inheritable MIPs...
90 bool MIP::hasReadonly() const { return mbHasReadonly
; }
91 bool MIP::isReadonly() const { return mbHasReadonly
? mbReadonly
: mbHasCalculate
; }
92 void MIP::setReadonly( bool b
) { mbHasReadonly
= true; mbReadonly
= b
; }
93 void MIP::resetReadonly() { mbHasReadonly
= false; mbReadonly
= false; }
95 bool MIP::hasRequired() const { return mbHasRequired
; }
96 bool MIP::isRequired() const { return mbRequired
; }
97 void MIP::setRequired( bool b
) { mbHasRequired
= true; mbRequired
= b
; }
98 void MIP::resetRequired() { mbHasRequired
= false; mbRequired
= false; }
100 bool MIP::hasRelevant() const { return mbHasRelevant
; }
101 bool MIP::isRelevant() const { return mbRelevant
; }
102 void MIP::setRelevant( bool b
) { mbHasRelevant
= true; mbRelevant
= b
; }
103 void MIP::resetRelevant() { mbHasRelevant
= false; mbRelevant
= true; }
105 bool MIP::hasConstraint() const { return mbHasConstraint
; }
106 bool MIP::isConstraint() const { return mbConstraint
; }
107 void MIP::setConstraint( bool b
) { mbHasConstraint
= true; mbConstraint
= b
; msConstraintExplanation
= rtl::OUString(); }
108 void MIP::resetConstraint() { mbHasConstraint
= false; mbConstraint
= true; msConstraintExplanation
= rtl::OUString(); }
110 void MIP::setConstraintExplanation( const rtl::OUString
& s
) { msConstraintExplanation
= s
; }
111 rtl::OUString
MIP::getConstraintExplanation() const { return msConstraintExplanation
; }
114 bool MIP::hasCalculate() const { return mbHasCalculate
; }
115 void MIP::setHasCalculate( bool b
) { mbHasCalculate
= b
; }
116 void MIP::resetCalculate() { mbHasCalculate
= false; }
118 bool MIP::hasTypeName() const { return mbHasTypeName
; }
119 rtl::OUString
MIP::getTypeName() const { return msTypeName
; }
120 void MIP::setTypeName( const rtl::OUString
& s
) { msTypeName
= s
; mbHasTypeName
= true; }
121 void MIP::resetTypeName() { msTypeName
= rtl::OUString(); mbHasTypeName
= false; }
126 } // namespace xforms