xref: /trunk/main/sal/inc/osl/profile.h (revision fc9fd3f14a55d77b35643a64034752a178b2a5b0)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _OSL_PROFILE_H_
29 #define _OSL_PROFILE_H_
30 
31 #include <sal/types.h>
32 #include <rtl/ustring.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 typedef sal_uInt32 oslProfileOption;
39 
40 #define osl_Profile_DEFAULT     0x0000
41 #define osl_Profile_SYSTEM      0x0001    /* use system depended functinality */
42 #define osl_Profile_READLOCK    0x0002    /* lock file for reading            */
43 #define osl_Profile_WRITELOCK   0x0004    /* lock file for writing            */
44 #define osl_Profile_FLUSHWRITE  0x0010    /* writing only with flush          */
45 
46 
47 typedef void* oslProfile;
48 
49 /** Deprecated API.
50     Open or create a configuration profile.
51     @return 0 if the profile could not be created, otherwise a handle to the profile.
52     @deprecated
53 */
54 oslProfile SAL_CALL osl_openProfile(rtl_uString *strProfileName, oslProfileOption Options);
55 
56 /** Deprecated API.
57     Close the opened profile an flush all data to the disk.
58     @param Profile handle to a opened profile.
59     @deprecated
60 */
61 sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile);
62 
63 
64 /** Deprecated API.
65     @deprecated
66 */
67 sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile);
68 /** Deprecated API.
69     @deprecated
70 */
71 sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile,
72                               const sal_Char* pszSection, const sal_Char* pszEntry,
73                               sal_Char* pszString, sal_uInt32 MaxLen,
74                               const sal_Char* pszDefault);
75 /** Deprecated API.
76     @deprecated
77 */
78 sal_Bool SAL_CALL osl_readProfileBool(oslProfile Profile,
79                             const sal_Char* pszSection, const sal_Char* pszEntry,
80                             sal_Bool Default);
81 /** Deprecated API.
82     @deprecated
83 */
84 sal_uInt32 SAL_CALL osl_readProfileIdent(oslProfile Profile,
85                               const sal_Char* pszSection, const sal_Char* pszEntry,
86                               sal_uInt32 FirstId, const sal_Char* Strings[],
87                               sal_uInt32 Default);
88 
89 /** Deprecated API.
90     @deprecated
91 */
92 sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile,
93                                const sal_Char* pszSection, const sal_Char* pszEntry,
94                                const sal_Char* pszString);
95 /** Deprecated API.
96     @deprecated
97 */
98 sal_Bool SAL_CALL osl_writeProfileBool(oslProfile Profile,
99                              const sal_Char* pszSection, const sal_Char* pszEntry,
100                              sal_Bool Value);
101 /** Deprecated API.
102     @deprecated
103 */
104 sal_Bool SAL_CALL osl_writeProfileIdent(oslProfile Profile,
105                               const sal_Char* pszSection, const sal_Char* pszEntry,
106                               sal_uInt32 FirstId, const sal_Char* Strings[],
107                               sal_uInt32 Value);
108 
109 /** Deprecated API.
110     Acquire the mutex, block if already acquired by another thread.
111     @param Profile handle to a opened profile.
112     @return False if section or entry could not be found.
113     @deprecated
114 */
115 sal_Bool SAL_CALL osl_removeProfileEntry(oslProfile Profile,
116                                const sal_Char *pszSection, const sal_Char *pszEntry);
117 
118 /** Deprecated API.
119     Get all entries belonging to the specified section.
120     @param Profile handle to a opened profile.
121     @return Pointer to a array of pointers.
122     @deprecated
123 */
124 sal_uInt32 SAL_CALL osl_getProfileSectionEntries(oslProfile Profile, const sal_Char *pszSection,
125                                     sal_Char* pszBuffer, sal_uInt32 MaxLen);
126 
127 /** Deprecated API.
128     Get all section entries
129     @param Profile handle to a opened profile.
130     @return Pointer to a array of pointers.
131     @deprecated
132 */
133 sal_uInt32 SAL_CALL osl_getProfileSections(oslProfile Profile, sal_Char* pszBuffer, sal_uInt32 MaxLen);
134 
135 #ifdef __cplusplus
136 }
137 #endif
138 
139 #endif  /* _OSL_PROFILE_H_ */
140 
141