LibreOffice Module forms (master) 1
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
23namespace xforms
24{
25
27{
32 mbHasCalculate = false;
34}
35
36void MIP::inherit( const MIP& rMip )
37{
38 if( ! mbHasReadonly )
39 {
41 mbReadonly = rMip.isReadonly();
42 }
43 if( ! mbHasRequired )
44 {
46 mbRequired = rMip.isRequired();
47 }
48 if( ! mbHasRelevant )
49 {
51 mbRelevant = rMip.isRelevant();
52 }
53 if( ! mbHasConstraint )
54 {
58 }
59 if( ! mbHasCalculate )
60 {
62 }
63 if( ! mbHasTypeName )
64 {
66 msTypeName = rMip.getTypeName();
67 }
68}
69
70void MIP::join( const MIP& rMip )
71{
72 // TODO: inherit only inheritable MIPs...
73 inherit( rMip );
74}
75
77void MIP::setReadonly( bool b ) { mbHasReadonly = true; mbReadonly = b; }
78void MIP::resetReadonly() { mbHasReadonly = false; mbReadonly = false; }
79
80void MIP::setRequired( bool b ) { mbHasRequired = true; mbRequired = b; }
81void MIP::resetRequired() { mbHasRequired = false; mbRequired = false; }
82
83void MIP::setRelevant( bool b ) { mbHasRelevant = true; mbRelevant = b; }
84void MIP::resetRelevant() { mbHasRelevant = false; mbRelevant = true; }
85
88
90
91void MIP::setHasCalculate( bool b ) { mbHasCalculate = b; }
92
93void MIP::setTypeName( const OUString& s ) { msTypeName = s; mbHasTypeName = true; }
94void MIP::resetTypeName() { msTypeName.clear(); mbHasTypeName = false; }
95
96} // namespace xforms
97
98/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
represents the XForms *m*odel *i*tem *p*roperties (MIPs) for a given XNode in the instance data at a ...
Definition: mip.hxx:31
OUString msTypeName
Definition: mip.hxx:47
bool mbReadonly
Definition: mip.hxx:33
void resetRelevant()
Definition: mip.cxx:84
void setConstraintExplanation(const OUString &)
Definition: mip.cxx:89
OUString msConstraintExplanation
Definition: mip.hxx:49
const OUString & getConstraintExplanation() const
Definition: mip.hxx:88
bool isRelevant() const
Definition: mip.hxx:77
bool mbHasReadonly
Definition: mip.hxx:32
const OUString & getTypeName() const
Definition: mip.hxx:62
void resetRequired()
Definition: mip.cxx:81
void inherit(const MIP &)
inherit from upper-level MIPs
Definition: mip.cxx:36
bool isRequired() const
Definition: mip.hxx:72
void setTypeName(const OUString &)
Definition: mip.cxx:93
bool mbHasRequired
Definition: mip.hxx:35
void setRelevant(bool)
Definition: mip.cxx:83
bool mbHasRelevant
Definition: mip.hxx:38
bool mbHasTypeName
Definition: mip.hxx:46
void setConstraint(bool)
Definition: mip.cxx:86
bool mbHasCalculate
Definition: mip.hxx:44
void setHasCalculate(bool)
Definition: mip.cxx:91
void setRequired(bool)
Definition: mip.cxx:80
bool mbRelevant
Definition: mip.hxx:39
void resetConstraint()
Definition: mip.cxx:87
bool mbConstraint
Definition: mip.hxx:42
bool isConstraint() const
Definition: mip.hxx:82
void join(const MIP &)
join with same-level MIPs
Definition: mip.cxx:70
bool isReadonly() const
Definition: mip.cxx:76
void resetTypeName()
Definition: mip.cxx:94
bool mbRequired
Definition: mip.hxx:36
void resetReadonly()
Definition: mip.cxx:78
void setReadonly(bool)
Definition: mip.cxx:77
bool mbHasConstraint
Definition: mip.hxx:41