merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / inc / flags.hxx
blob1f39166d305afa5bb9d1348a1c2304b529826bb7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: flags.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_DATA_FLAGS_HXX
32 #define INCLUDED_DATA_FLAGS_HXX
34 #include <sal/types.h>
36 namespace configmgr
38 //-----------------------------------------------------------------------------
39 namespace data
41 //-----------------------------------------------------------------------------
42 // node type + value type selector - fits into a byte (bit 5 currently unassigned)
43 namespace Type
45 enum Type
47 // Primitive Data Type is stored in bits 0-4 (bit 3 currently unused)
48 // base data types
49 value_any, // = 0
50 value_string, // = 1
51 value_boolean, // = 2
52 value_short, // = 3
53 value_int, // = 4
54 value_long, // = 5
55 value_double, // = 6
56 value_binary, // = 7
58 mask_basetype = 0x0F,
60 // sequence data types
61 flag_sequence = 0x10,
63 value_invalid = value_any | flag_sequence,
65 value_string_list = value_string | flag_sequence,
66 value_boolean_list = value_boolean | flag_sequence,
67 value_short_list = value_short | flag_sequence,
68 value_int_list = value_int | flag_sequence,
69 value_long_list = value_long | flag_sequence,
70 value_double_list = value_double | flag_sequence,
71 value_binary_list = value_binary | flag_sequence,
73 mask_valuetype = mask_basetype | flag_sequence, // 0x1F
75 // Node Type is stored in bits 6+7
76 nodetype_shift_ = 6,
77 mask_nodetype = 0x03 << nodetype_shift_, // 0xC0
79 // maybe we should use 0 for node type 'value'
80 // to make the complete type be the valuetype ?
81 nodetype_invalid= 0x00,
83 nodetype_value = 0x01 << nodetype_shift_, // 0x40
84 nodetype_group = 0x02 << nodetype_shift_, // 0x80
85 nodetype_set = 0x03 << nodetype_shift_, // 0xC0
87 flag_innernode = 0x02 << nodetype_shift_, // 0x80
88 flag_setnode = 0x01 << nodetype_shift_ // 0x40
92 //-----------------------------------------------------------------------------
93 // node attributes
94 namespace Flags
96 enum Type
98 readonly = 0x01,
99 finalized = 0x02,
101 nullable = 0x04,
102 localized = 0x08,
104 valueAvailable = 0x10, // only used for value nodes
105 defaultAvailable = 0x20, // only used for value nodes
107 defaulted = 0x40, // somewhat redundant with State
108 defaultable = 0x80 // redundant with State (merged || defaulted)
111 //-----------------------------------------------------------------------------
112 // set element or tree state
113 namespace State
115 enum Type
117 merged, // = 0, - result of merging defaults + changes
118 defaulted, // = 1, - result of copying defaults unchanged
119 replaced, // = 2, - result of copying new layer unchanged
120 added, // = 3, - same as 'replaced', but it is known,
121 // that there is no corresponding default
123 mask_state = 0x0F, // leaves bits 3+4 reserved for states
125 flag_mandatory = 0x10, // marks this element as non-removable/replacable
126 flag_readonly = 0x20, // marks this element as read-only
127 flag_default_avail = 0x40, // marks this element as containing default values
128 flag_removable = 0x80 // marks this element as removable
131 //-----------------------------------------------------------------------------
133 //-----------------------------------------------------------------------------
136 #endif // INCLUDED_DATA_FLAGS_HXX