tdf#149529 crash on deref deleted ScDocument*
[LibreOffice.git] / include / registry / regtype.h
blob89fdcc940aaf58ba8b53b32b3ef884511cf6fd7b
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, 0x03>
53 /** defines the type of a key value.
55 A registry key can contain a value which has one of seven different types.
56 Three simple types (long, ascii and unicode string) and a list type of
57 these simple types. Furthermore a binary type which provides the possibility
58 to define own data structures and store these types in the registry. The UNO
59 core reflection data is stored as a binary blob in the type registry.
61 enum class SAL_DLLPUBLIC_RTTI RegValueType
63 /// The key has no value or the value type is unknown.
64 NOT_DEFINED,
65 /// The key has a value of type long
66 LONG,
67 /// The key has a value of type ascii string
68 STRING,
69 /// The key has a value of type unicode string
70 UNICODE,
71 /// The key has a value of type binary
72 BINARY,
73 /// The key has a value of type long list
74 LONGLIST,
75 /// The key has a value of type ascii string list
76 STRINGLIST,
77 /// The key has a value of type unicode string list
78 UNICODELIST
81 /// specifies the possible error codes which can occur using the registry API.
82 enum class SAL_DLLPUBLIC_RTTI RegError
84 /// no error.
85 NO_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 an 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,
136 /// specify the calling convention for the registry API
137 #define REGISTRY_CALLTYPE SAL_CALL
139 #endif
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */