Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / include / registry / regtype.h
blob8b72931d384749bc9ee27b5e9a44d4696b3c8424
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 #pragma once
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.
36 Two modes are valid:
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.
45 namespace o3tl
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.
63 NOT_DEFINED,
64 /// The key has a value of type long
65 LONG,
66 /// The key has a value of type ascii string
67 STRING,
68 /// The key has a value of type unicode string
69 UNICODE,
70 /// The key has a value of type binary
71 BINARY,
72 /// The key has a value of type long list
73 LONGLIST,
74 /// The key has a value of type ascii string list
75 STRINGLIST,
76 /// The key has a value of type unicode string list
77 UNICODELIST
80 /// specifies the possible error codes which can occur using the registry API.
81 enum class SAL_DLLPUBLIC_RTTI RegError
83 /// no error.
84 NO_ERROR,
86 /// registry is not open.
87 REGISTRY_NOT_OPEN,
88 /// registry does not exists.
89 REGISTRY_NOT_EXISTS,
90 /// registry is open with readonly access rights.
91 REGISTRY_READONLY,
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.
101 INVALID_REGISTRY,
103 /// the key or key handle points to an invalid key or closed key.
104 KEY_NOT_OPEN,
105 /// the specified keyname points to a nonexisting key.
106 KEY_NOT_EXISTS,
107 /// the key with the specified keyname cannot be created.
108 CREATE_KEY_FAILED,
109 /// the specified key cannot be deleted. Maybe an open key handle exists to this key.
110 DELETE_KEY_FAILED,
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.
114 INVALID_KEYNAME,
115 /// the key is not in a valid state.
116 INVALID_KEY,
118 /// the key has no value
119 VALUE_NOT_EXISTS,
120 /// setting the specified value of a key failed.
121 SET_VALUE_FAILED,
122 /// deleting of the key value failed.
123 DELETE_VALUE_FAILED,
124 /// the key has an invalid value or the value type is unknown.
125 INVALID_VALUE,
127 /// merging a key, the value and all subkeys failed.
128 MERGE_ERROR,
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.
132 MERGE_CONFLICT,
135 /// specify the calling convention for the registry API
136 #define REGISTRY_CALLTYPE SAL_CALL
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */