Update git submodules
[LibreOffice.git] / forms / source / xforms / mip.hxx
blob97b98d04ec52fc2dbe42bccb9e1ae0d429435472
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 .
20 #pragma once
22 #include <rtl/ustring.hxx>
24 namespace xforms
26 /** represents the XForms *m*odel *i*tem *p*roperties (MIPs) for a
27 * given XNode in the instance data at a given point in time. The
28 * values will not be updated; for updated values new MIP objects have
29 * to be created/queried. */
30 class MIP
32 bool mbHasReadonly;
33 bool mbReadonly;
35 bool mbHasRequired;
36 bool mbRequired;
38 bool mbHasRelevant;
39 bool mbRelevant;
41 bool mbHasConstraint;
42 bool mbConstraint;
44 bool mbHasCalculate;
46 bool mbHasTypeName;
47 OUString msTypeName;
49 OUString msConstraintExplanation;
51 public:
52 MIP();
54 /// inherit from upper-level MIPs
55 void inherit(const MIP&);
57 /// join with same-level MIPs
58 void join(const MIP&);
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();
66 // - readonly (computed XPath; default: false; true if calculate exists)
67 bool isReadonly() const;
68 void setReadonly(bool);
69 void resetReadonly();
71 // - required (computed XPath; default: false)
72 bool isRequired() const { return mbRequired; }
73 void setRequired(bool);
74 void resetRequired();
76 // - relevant (computed XPath; default: true)
77 bool isRelevant() const { return mbRelevant; }
78 void setRelevant(bool);
79 void resetRelevant();
81 // - constraint (computed XPath; default: true)
82 bool isConstraint() const { return mbConstraint; }
83 void setConstraint(bool);
84 void resetConstraint();
86 // explain _why_ a constraint failed
87 void setConstraintExplanation(const OUString&);
88 const OUString& getConstraintExplanation() const { return msConstraintExplanation; }
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);
96 // - minOccurs/maxOccurs (computed XPath; default: 0/inf)
97 // - p3ptype (static; no default)
100 } // namespace xforms
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */