LibreOffice Module forms (master)
1
forms
source
xforms
mip.cxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This file is part of the LibreOffice project.
4
*
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/.
8
*
9
* This file incorporates work covered by the following license notice:
10
*
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 .
18
*/
19
20
21
#include "
mip.hxx
"
22
23
namespace
xforms
24
{
25
26
MIP::MIP
()
27
{
28
resetReadonly
();
29
resetRequired
();
30
resetRelevant
();
31
resetConstraint
();
32
mbHasCalculate
=
false
;
33
resetTypeName
();
34
}
35
36
void
MIP::inherit
(
const
MIP
& rMip )
37
{
38
if
( !
mbHasReadonly
)
39
{
40
mbHasReadonly
= rMip.
mbHasReadonly
;
41
mbReadonly
= rMip.
isReadonly
();
42
}
43
if
( !
mbHasRequired
)
44
{
45
mbHasRequired
= rMip.
mbHasRequired
;
46
mbRequired
= rMip.
isRequired
();
47
}
48
if
( !
mbHasRelevant
)
49
{
50
mbHasRelevant
= rMip.
mbHasRelevant
;
51
mbRelevant
= rMip.
isRelevant
();
52
}
53
if
( !
mbHasConstraint
)
54
{
55
mbHasConstraint
= rMip.
mbHasConstraint
;
56
mbConstraint
= rMip.
isConstraint
();
57
msConstraintExplanation
= rMip.
getConstraintExplanation
();
58
}
59
if
( !
mbHasCalculate
)
60
{
61
mbHasCalculate
= rMip.
mbHasCalculate
;
62
}
63
if
( !
mbHasTypeName
)
64
{
65
mbHasTypeName
= rMip.
mbHasTypeName
;
66
msTypeName
= rMip.
getTypeName
();
67
}
68
}
69
70
void
MIP::join
(
const
MIP
& rMip )
71
{
72
// TODO: inherit only inheritable MIPs...
73
inherit
( rMip );
74
}
75
76
bool
MIP::isReadonly
()
const
{
return
mbHasReadonly
?
mbReadonly
:
mbHasCalculate
; }
77
void
MIP::setReadonly
(
bool
b ) {
mbHasReadonly
=
true
;
mbReadonly
= b; }
78
void
MIP::resetReadonly
() {
mbHasReadonly
=
false
;
mbReadonly
=
false
; }
79
80
void
MIP::setRequired
(
bool
b ) {
mbHasRequired
=
true
;
mbRequired
= b; }
81
void
MIP::resetRequired
() {
mbHasRequired
=
false
;
mbRequired
=
false
; }
82
83
void
MIP::setRelevant
(
bool
b ) {
mbHasRelevant
=
true
;
mbRelevant
= b; }
84
void
MIP::resetRelevant
() {
mbHasRelevant
=
false
;
mbRelevant
=
true
; }
85
86
void
MIP::setConstraint
(
bool
b ) {
mbHasConstraint
=
true
;
mbConstraint
= b;
msConstraintExplanation
.clear(); }
87
void
MIP::resetConstraint
() {
mbHasConstraint
=
false
;
mbConstraint
=
true
;
msConstraintExplanation
.clear(); }
88
89
void
MIP::setConstraintExplanation
(
const
OUString& s ) {
msConstraintExplanation
= s; }
90
91
void
MIP::setHasCalculate
(
bool
b ) {
mbHasCalculate
= b; }
92
93
void
MIP::setTypeName
(
const
OUString& s ) {
msTypeName
= s;
mbHasTypeName
=
true
; }
94
void
MIP::resetTypeName
() {
msTypeName
.clear();
mbHasTypeName
=
false
; }
95
96
}
// namespace xforms
97
98
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
xforms::MIP
represents the XForms *m*odel *i*tem *p*roperties (MIPs) for a given XNode in the instance data at a ...
Definition:
mip.hxx:31
xforms::MIP::msTypeName
OUString msTypeName
Definition:
mip.hxx:47
xforms::MIP::mbReadonly
bool mbReadonly
Definition:
mip.hxx:33
xforms::MIP::resetRelevant
void resetRelevant()
Definition:
mip.cxx:84
xforms::MIP::setConstraintExplanation
void setConstraintExplanation(const OUString &)
Definition:
mip.cxx:89
xforms::MIP::msConstraintExplanation
OUString msConstraintExplanation
Definition:
mip.hxx:49
xforms::MIP::getConstraintExplanation
const OUString & getConstraintExplanation() const
Definition:
mip.hxx:88
xforms::MIP::isRelevant
bool isRelevant() const
Definition:
mip.hxx:77
xforms::MIP::mbHasReadonly
bool mbHasReadonly
Definition:
mip.hxx:32
xforms::MIP::getTypeName
const OUString & getTypeName() const
Definition:
mip.hxx:62
xforms::MIP::resetRequired
void resetRequired()
Definition:
mip.cxx:81
xforms::MIP::inherit
void inherit(const MIP &)
inherit from upper-level MIPs
Definition:
mip.cxx:36
xforms::MIP::isRequired
bool isRequired() const
Definition:
mip.hxx:72
xforms::MIP::setTypeName
void setTypeName(const OUString &)
Definition:
mip.cxx:93
xforms::MIP::mbHasRequired
bool mbHasRequired
Definition:
mip.hxx:35
xforms::MIP::setRelevant
void setRelevant(bool)
Definition:
mip.cxx:83
xforms::MIP::mbHasRelevant
bool mbHasRelevant
Definition:
mip.hxx:38
xforms::MIP::mbHasTypeName
bool mbHasTypeName
Definition:
mip.hxx:46
xforms::MIP::setConstraint
void setConstraint(bool)
Definition:
mip.cxx:86
xforms::MIP::mbHasCalculate
bool mbHasCalculate
Definition:
mip.hxx:44
xforms::MIP::setHasCalculate
void setHasCalculate(bool)
Definition:
mip.cxx:91
xforms::MIP::MIP
MIP()
Definition:
mip.cxx:26
xforms::MIP::setRequired
void setRequired(bool)
Definition:
mip.cxx:80
xforms::MIP::mbRelevant
bool mbRelevant
Definition:
mip.hxx:39
xforms::MIP::resetConstraint
void resetConstraint()
Definition:
mip.cxx:87
xforms::MIP::mbConstraint
bool mbConstraint
Definition:
mip.hxx:42
xforms::MIP::isConstraint
bool isConstraint() const
Definition:
mip.hxx:82
xforms::MIP::join
void join(const MIP &)
join with same-level MIPs
Definition:
mip.cxx:70
xforms::MIP::isReadonly
bool isReadonly() const
Definition:
mip.cxx:76
xforms::MIP::resetTypeName
void resetTypeName()
Definition:
mip.cxx:94
xforms::MIP::mbRequired
bool mbRequired
Definition:
mip.hxx:36
xforms::MIP::resetReadonly
void resetReadonly()
Definition:
mip.cxx:78
xforms::MIP::setReadonly
void setReadonly(bool)
Definition:
mip.cxx:77
xforms::MIP::mbHasConstraint
bool mbHasConstraint
Definition:
mip.hxx:41
mip.hxx
xforms
Definition:
binding.hxx:42
Generated on Sun Jul 30 2023 04:36:32 for LibreOffice Module forms (master) by
1.9.3