1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <sal/types.h>
23 #include <o3tl/typed_flags_set.hxx>
25 /// defines the type of a registry handle used in the C API.
26 typedef void* RegHandle
;
28 /// defines the type of a registry key handle used in the C API.
29 typedef void* RegKeyHandle
;
31 /// defines the type of a registry key value handle used in the C API.
32 typedef void* RegValue
;
34 /** defines the open/access mode of the registry.
37 -READONLY allows readonly access
38 -READWRITE allows read and write access
40 enum class RegAccessMode
42 READONLY
= 0x0001, /// This mode allows readonly access.
43 READWRITE
= 0x0002 /// This mode allows read and write access.
47 template <> struct typed_flags
<RegAccessMode
> : is_typed_flags
<RegAccessMode
, 0x03>
52 /** defines the type of a key value.
54 A registry key can contain a value which has one of seven different types.
55 Three simple types (long, ascii and unicode string) and a list type of
56 these simple types. Furthermore a binary type which provides the possibility
57 to define own data structures and store these types in the registry. The UNO
58 core reflection data is stored as a binary blob in the type registry.
60 enum class SAL_DLLPUBLIC_RTTI RegValueType
62 /// The key has no value or the value type is unknown.
64 /// The key has a value of type long
66 /// The key has a value of type ascii string
68 /// The key has a value of type unicode string
70 /// The key has a value of type binary
72 /// The key has a value of type long list
74 /// The key has a value of type ascii string list
76 /// The key has a value of type unicode string list
80 /// specifies the possible error codes which can occur using the registry API.
81 enum class SAL_DLLPUBLIC_RTTI RegError
86 /// registry is not open.
88 /// registry does not exists.
90 /// registry is open with readonly access rights.
92 /// destroy a registry failed. There are may be any open keys.
93 DESTROY_REGISTRY_FAILED
,
94 /** registry cannot be opened with readwrite access because the registry is already
95 open with readwrite access anywhere.
97 CANNOT_OPEN_FOR_READWRITE
,
98 /** registry is in an invalid state or the registry does not point to
99 a valid registry data file.
103 /// the key or key handle points to an invalid key or closed key.
105 /// the specified keyname points to a nonexisting key.
107 /// the key with the specified keyname cannot be created.
109 /// the specified key cannot be deleted. Maybe an open key handle exists to this key.
111 /** the keyname is invalid. This error will return if the keyname
112 is NULL but should not be NULL in the context of a called function.
115 /// the key is not in a valid state.
118 /// the key has no value
120 /// setting the specified value of a key failed.
122 /// deleting of the key value failed.
124 /// the key has an invalid value or the value type is unknown.
127 /// merging a key, the value and all subkeys failed.
129 /** conflicts exists during the merge process of a key. This could happen if
130 the value of a key already exists and the merge process will replace it.
135 /// specify the calling convention for the registry API
136 #define REGISTRY_CALLTYPE SAL_CALL
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */