nss: upgrade to release 3.73
[LibreOffice.git] / forms / source / xforms / mip.hxx
bloba2247b45342decf04609f2af83d4382a8d0ec0f2
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 #ifndef INCLUDED_FORMS_SOURCE_XFORMS_MIP_HXX
21 #define INCLUDED_FORMS_SOURCE_XFORMS_MIP_HXX
23 #include <rtl/ustring.hxx>
25 namespace xforms
27 /** represents the XForms *m*odel *i*tem *p*roperties (MIPs) for a
28 * given XNode in the instance data at a given point in time. The
29 * values will not be updated; for updated values new MIP objects have
30 * to be created/queried. */
31 class MIP
33 bool mbHasReadonly;
34 bool mbReadonly;
36 bool mbHasRequired;
37 bool mbRequired;
39 bool mbHasRelevant;
40 bool mbRelevant;
42 bool mbHasConstraint;
43 bool mbConstraint;
45 bool mbHasCalculate;
47 bool mbHasTypeName;
48 OUString msTypeName;
50 OUString msConstraintExplanation;
52 public:
53 MIP();
55 /// inherit from upper-level MIPs
56 void inherit(const MIP&);
58 /// join with same-level MIPs
59 void join(const MIP&);
61 // - type (static; default: xsd:string)
62 // (currently default implemented as empty string)
63 const OUString& getTypeName() const { return msTypeName; }
64 void setTypeName(const OUString&);
65 void resetTypeName();
67 // - readonly (computed XPath; default: false; true if calculate exists)
68 bool isReadonly() const;
69 void setReadonly(bool);
70 void resetReadonly();
72 // - required (computed XPath; default: false)
73 bool isRequired() const { return mbRequired; }
74 void setRequired(bool);
75 void resetRequired();
77 // - relevant (computed XPath; default: true)
78 bool isRelevant() const { return mbRelevant; }
79 void setRelevant(bool);
80 void resetRelevant();
82 // - constraint (computed XPath; default: true)
83 bool isConstraint() const { return mbConstraint; }
84 void setConstraint(bool);
85 void resetConstraint();
87 // explain _why_ a constraint failed
88 void setConstraintExplanation(const OUString&);
89 const OUString& getConstraintExplanation() const { return msConstraintExplanation; }
91 // - calculate (computed XPath; default: has none (false))
92 // (for calculate, we only store whether a calculate MIP is present;
93 // the actual calculate value is handled my changing the instance
94 // directly)
95 void setHasCalculate(bool);
97 // - minOccurs/maxOccurs (computed XPath; default: 0/inf)
98 // - p3ptype (static; no default)
101 } // namespace xforms
103 #endif
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */