bump product version to 4.1.6.2
[LibreOffice.git] / forms / source / xforms / mip.cxx
blobe8ccd35a282d16ebdaccdf47c10a3337a2080ec0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
21 #include "mip.hxx"
24 namespace xforms
28 MIP::MIP()
30 resetReadonly();
31 resetRequired();
32 resetRelevant();
33 resetConstraint();
34 resetCalculate();
35 resetTypeName();
38 MIP::~MIP() {}
40 void MIP::inherit( const MIP& rMip )
42 if( ! mbHasReadonly )
44 mbHasReadonly = rMip.hasReadonly();
45 mbReadonly = rMip.isReadonly();
47 if( ! mbHasRequired )
49 mbHasRequired = rMip.hasRequired();
50 mbRequired = rMip.isRequired();
52 if( ! mbHasRelevant )
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();
67 if( ! mbHasTypeName )
69 mbHasTypeName = rMip.hasTypeName();
70 msTypeName = rMip.getTypeName();
74 void MIP::join( const MIP& rMip )
76 // TODO: inherit only inheritable MIPs...
77 inherit( rMip );
80 bool MIP::hasReadonly() const { return mbHasReadonly; }
81 bool MIP::isReadonly() const { return mbHasReadonly ? mbReadonly : mbHasCalculate; }
82 void MIP::setReadonly( bool b ) { mbHasReadonly = true; mbReadonly = b; }
83 void MIP::resetReadonly() { mbHasReadonly = false; mbReadonly = false; }
85 bool MIP::hasRequired() const { return mbHasRequired; }
86 bool MIP::isRequired() const { return mbRequired; }
87 void MIP::setRequired( bool b ) { mbHasRequired = true; mbRequired = b; }
88 void MIP::resetRequired() { mbHasRequired = false; mbRequired = false; }
90 bool MIP::hasRelevant() const { return mbHasRelevant; }
91 bool MIP::isRelevant() const { return mbRelevant; }
92 void MIP::setRelevant( bool b ) { mbHasRelevant = true; mbRelevant = b; }
93 void MIP::resetRelevant() { mbHasRelevant = false; mbRelevant = true; }
95 bool MIP::hasConstraint() const { return mbHasConstraint; }
96 bool MIP::isConstraint() const { return mbConstraint; }
97 void MIP::setConstraint( bool b ) { mbHasConstraint = true; mbConstraint = b; msConstraintExplanation = OUString(); }
98 void MIP::resetConstraint() { mbHasConstraint = false; mbConstraint = true; msConstraintExplanation = OUString(); }
100 void MIP::setConstraintExplanation( const OUString& s ) { msConstraintExplanation = s; }
101 OUString MIP::getConstraintExplanation() const { return msConstraintExplanation; }
104 bool MIP::hasCalculate() const { return mbHasCalculate; }
105 void MIP::setHasCalculate( bool b ) { mbHasCalculate = b; }
106 void MIP::resetCalculate() { mbHasCalculate = false; }
108 bool MIP::hasTypeName() const { return mbHasTypeName; }
109 OUString MIP::getTypeName() const { return msTypeName; }
110 void MIP::setTypeName( const OUString& s ) { msTypeName = s; mbHasTypeName = true; }
111 void MIP::resetTypeName() { msTypeName = OUString(); mbHasTypeName = false; }
116 } // namespace xforms
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */