bump product version to 5.0.4.1
[LibreOffice.git] / include / registry / regtype.h
blobf36edecc962e990f88dafc35610d65d865b4084d
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_REGISTRY_REGTYPE_H
21 #define INCLUDED_REGISTRY_REGTYPE_H
23 #include <sal/types.h>
24 #include <o3tl/typed_flags_set.hxx>
26 /// defines the type of a registry handle used in the C API.
27 typedef void* RegHandle;
29 /// defines the type of a registry key handle used in the C API.
30 typedef void* RegKeyHandle;
32 /// defines the type of a registry key value handle used in the C API.
33 typedef void* RegValue;
35 /** defines the open/access mode of the registry.
37 Two modes are valid:
38 -READONLY allows readonly access
39 -READWRITE allows read and write access
41 enum class RegAccessMode
43 READONLY = 0x0001, /// This mode allows readonly access.
44 READWRITE = 0x0002 /// This mode allows read and write access.
46 namespace o3tl
48 template<> struct typed_flags<RegAccessMode> : is_typed_flags<RegAccessMode, 0x07> {};
51 /** defines the type of a key value.
53 A registry key can contain a value which has one of seven different types.
54 Three simple types (long, ascii and unicode string) and a list type of
55 these simple types. Furthermore a binary type which provides the possibility
56 to define own data structures and store these types in the registry. The UNO
57 core reflection data is stored as a binary blob in the type registry.
59 enum class SAL_DLLPUBLIC_RTTI RegValueType
61 /// The key has no value or the value type is unknown.
62 NOT_DEFINED,
63 /// The key has a value of type long
64 LONG,
65 /// The key has a value of type ascii string
66 STRING,
67 /// The key has a value of type unicode string
68 UNICODE,
69 /// The key has a value of type binary
70 BINARY,
71 /// The key has a value of type long list
72 LONGLIST,
73 /// The key has a value of type ascii string list
74 STRINGLIST,
75 /// The key has a value of type unicode string list
76 UNICODELIST
79 /// specifies the possible error codes which can occur using the registry API.
80 enum class SAL_DLLPUBLIC_RTTI RegError
82 /// no error.
83 NO_ERROR,
84 /// internal registry error.
85 INTERNAL_ERROR,
87 /// registry is not open.
88 REGISTRY_NOT_OPEN,
89 /// registry does not exists.
90 REGISTRY_NOT_EXISTS,
91 /// registry is open with readonly access rights.
92 REGISTRY_READONLY,
93 /// destroy a registry failed. There are may be any open keys.
94 DESTROY_REGISTRY_FAILED,
95 /** registry cannot be opened with readwrite access because the registry is already
96 open with readwrite access anywhere.
98 CANNOT_OPEN_FOR_READWRITE,
99 /** registry is in an invalid state or the registry does not point to
100 a valid registry data file.
102 INVALID_REGISTRY,
104 /// the key or key handle points to an invalid key or closed key.
105 KEY_NOT_OPEN,
106 /// the specified keyname points to a nonexisting key.
107 KEY_NOT_EXISTS,
108 /// the key with the specified keyname cannot be created.
109 CREATE_KEY_FAILED,
110 /// the specified key cannot be deleted. Maybe an open key handle exists to this key.
111 DELETE_KEY_FAILED,
112 /** the keyname is invalid. This error will return if the keyname
113 is NULL but should not be NULL in the context of a called function.
115 INVALID_KEYNAME,
116 /// the key is not in a valid state.
117 INVALID_KEY,
119 /// the key has no value
120 VALUE_NOT_EXISTS,
121 /// setting the specified value of a key failed.
122 SET_VALUE_FAILED,
123 /// deleting of the key value failed.
124 DELETE_VALUE_FAILED,
125 /// the key has a invalid value or the value type is unknown.
126 INVALID_VALUE,
128 /// merging a key, the value and all subkeys failed.
129 MERGE_ERROR,
130 /** conflicts exists during the merge process of a key. This could happen if
131 the value of a key already exists and the merge process will replace it.
133 MERGE_CONFLICT,
135 /** a recursion was detected resolving different link targets (no longer
136 used).
138 DETECT_RECURSION,
139 /** the link is invalid and can not be resolved (now used by all
140 link-related operations, as links are no longer supported).
142 INVALID_LINK,
143 /// the specified linkname is not valid (no longer used).
144 INVALID_LINKNAME,
145 /// the linknane is not valid (no longer used).
146 INVALID_LINKTARGET,
147 /// the link target points to a nonexisting key (no longer used).
148 LINKTARGET_NOT_EXIST,
149 /// the reserved buffer for the resolved keyname is to small.
150 BUFFERSIZE_TOSMALL
153 /// specify the calling convention for the registry API
154 #define REGISTRY_CALLTYPE SAL_CALL
156 #endif
158 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */