bump product version to 5.0.4.1
[LibreOffice.git] / forms / source / xforms / mip.hxx
blob729e408f8833acf5e0e02795664e6bdfbfdb93ac
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
28 /** represents the XForms *m*odel *i*tem *p*roperties (MIPs) for a
29 * given XNode in the instance data at a given point in time. The
30 * values will not be updated; for updated values new MIP objects have
31 * to be created/queried. */
32 class MIP
34 bool mbHasReadonly;
35 bool mbReadonly;
37 bool mbHasRequired;
38 bool mbRequired;
40 bool mbHasRelevant;
41 bool mbRelevant;
43 bool mbHasConstraint;
44 bool mbConstraint;
46 bool mbHasCalculate;
48 bool mbHasTypeName;
49 OUString msTypeName;
51 OUString msConstraintExplanation;
53 public:
54 MIP();
55 ~MIP();
57 /// inherit from upper-level MIPs
58 void inherit( const MIP& );
60 /// join with same-level MIPs
61 void join( const MIP& );
64 // - type (static; default: xsd:string)
65 // (currently default implemented as empty string)
66 bool hasTypeName() const { return mbHasTypeName; }
67 OUString getTypeName() const { return msTypeName; }
68 void setTypeName( const OUString& );
69 void resetTypeName();
71 // - readonly (computed XPath; default: false; true if calculate exists)
72 bool hasReadonly() const { return mbHasReadonly; }
73 bool isReadonly() const;
74 void setReadonly( bool );
75 void resetReadonly();
77 // - required (computed XPath; default: false)
78 bool hasRequired() const { return mbHasRequired; }
79 bool isRequired() const { return mbRequired; }
80 void setRequired( bool );
81 void resetRequired();
83 // - relevant (computed XPath; default: true)
84 bool hasRelevant() const { return mbHasRelevant; }
85 bool isRelevant() const { return mbRelevant; }
86 void setRelevant( bool );
87 void resetRelevant();
89 // - constraing (computed XPath; default: true)
90 bool hasConstraint() const { return mbHasConstraint; }
91 bool isConstraint() const { return mbConstraint; }
92 void setConstraint( bool );
93 void resetConstraint();
95 // explain _why_ a constraint failed
96 void setConstraintExplanation( const OUString& );
97 OUString getConstraintExplanation() const { return msConstraintExplanation; }
99 // - calculate (computed XPath; default: has none (false))
100 // (for calculate, we only store whether a calculate MIP is present;
101 // the actual calculate value is handled my changing the instance
102 // directly)
103 bool hasCalculate() const { return mbHasCalculate; }
104 void setHasCalculate( bool );
105 void resetCalculate();
107 // - minOccurs/maxOccurs (computed XPath; default: 0/inf)
108 // - p3ptype (static; no default)
112 } // namespace xforms
114 #endif
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */