lok: avoid expensive fetching of a property.
[LibreOffice.git] / include / store / types.h
blob7abf012ea516ac47a28ffde3a2f1db689acecc11
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>
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
28 /** PageSize (recommended) default.
29 @see store_openFile()
31 constexpr sal_uInt16 STORE_DEFAULT_PAGESIZE = 0x0400;
34 /** PageSize (enforced) limits.
35 @see store_openFile()
37 constexpr sal_uInt16 STORE_MINIMUM_PAGESIZE = 0x0200;
38 constexpr sal_uInt16 STORE_MAXIMUM_PAGESIZE = 0x8000;
41 /** NameSize (enforced) limit.
42 @see any param pName
43 @see store_E_NameTooLong
45 constexpr auto STORE_MAXIMUM_NAMESIZE = 256;
48 /** Attributes (predefined).
49 @see store_attrib()
51 constexpr sal_uInt32 STORE_ATTRIB_ISLINK = 0x10000000;
52 constexpr sal_uInt32 STORE_ATTRIB_ISDIR = 0x20000000;
53 constexpr sal_uInt32 STORE_ATTRIB_ISFILE = 0x40000000;
56 /** Access Mode enumeration.
57 @see store_openFile()
58 @see store_openDirectory()
59 @see store_openStream()
61 enum class storeAccessMode
63 Create,
64 ReadWrite,
65 ReadOnly,
66 FORCE_EQUAL_SIZE = SAL_MAX_ENUM
70 /** Error Code enumeration.
72 typedef enum
74 store_E_None = 0,
75 store_E_AccessViolation,
76 store_E_LockingViolation,
77 store_E_CantSeek,
78 store_E_CantRead,
79 store_E_CantWrite,
80 store_E_InvalidAccess,
81 store_E_InvalidHandle,
82 store_E_InvalidParameter,
83 store_E_InvalidChecksum,
84 store_E_AlreadyExists,
85 store_E_NotExists,
86 store_E_NotDirectory,
87 store_E_NotFile,
88 store_E_NoMoreFiles,
89 store_E_NameTooLong,
90 store_E_OutOfMemory,
91 store_E_OutOfSpace,
92 store_E_Pending,
93 store_E_WrongFormat,
94 store_E_WrongVersion,
95 store_E_Unknown,
96 store_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
97 } storeError;
100 /** Find Data structure.
101 @see store_findFirst()
102 @see store_findNext()
104 typedef struct
106 /** Name.
107 @see m_nLength
109 sal_Unicode m_pszName[STORE_MAXIMUM_NAMESIZE];
111 /** Name Length.
112 @see m_pszName
114 sal_Int32 m_nLength;
116 /** Attributes.
117 @see store_attrib()
119 sal_uInt32 m_nAttrib;
121 /** Reserved for internal use.
123 sal_uInt32 m_nReserved;
124 } storeFindData;
126 #ifdef __cplusplus
128 #endif
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */