LibreOffice Module forms (master) 1
mip.hxx
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#pragma once
21
22#include <rtl/ustring.hxx>
23
24namespace xforms
25{
30class MIP
31{
34
37
40
43
45
47 OUString msTypeName;
48
50
51public:
52 MIP();
53
55 void inherit(const MIP&);
56
58 void join(const MIP&);
59
60 // - type (static; default: xsd:string)
61 // (currently default implemented as empty string)
62 const OUString& getTypeName() const { return msTypeName; }
63 void setTypeName(const OUString&);
64 void resetTypeName();
65
66 // - readonly (computed XPath; default: false; true if calculate exists)
67 bool isReadonly() const;
68 void setReadonly(bool);
69 void resetReadonly();
70
71 // - required (computed XPath; default: false)
72 bool isRequired() const { return mbRequired; }
73 void setRequired(bool);
74 void resetRequired();
75
76 // - relevant (computed XPath; default: true)
77 bool isRelevant() const { return mbRelevant; }
78 void setRelevant(bool);
79 void resetRelevant();
80
81 // - constraint (computed XPath; default: true)
82 bool isConstraint() const { return mbConstraint; }
83 void setConstraint(bool);
84 void resetConstraint();
85
86 // explain _why_ a constraint failed
87 void setConstraintExplanation(const OUString&);
88 const OUString& getConstraintExplanation() const { return msConstraintExplanation; }
89
90 // - calculate (computed XPath; default: has none (false))
91 // (for calculate, we only store whether a calculate MIP is present;
92 // the actual calculate value is handled my changing the instance
93 // directly)
94 void setHasCalculate(bool);
95
96 // - minOccurs/maxOccurs (computed XPath; default: 0/inf)
97 // - p3ptype (static; no default)
98};
99
100} // namespace xforms
101
102/* 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