1 /* libcmis
2  * Version: MPL 1.1 / GPLv2+ / LGPLv2+
3  *
4  * The contents of this file are subject to the Mozilla Public License Version
5  * 1.1 (the "License"); you may not use this file except in compliance with
6  * the License or as specified alternatively below. You may obtain a copy of
7  * the License at http://www.mozilla.org/MPL/
8  *
9  * Software distributed under the License is distributed on an "AS IS" basis,
10  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11  * for the specific language governing rights and limitations under the
12  * License.
13  *
14  * Major Contributor(s):
15  * Copyright (C) 2011 SUSE <cbosdonnat@suse.com>
16  *
17  *
18  * All Rights Reserved.
19  *
20  * For minor contributions see the git repository.
21  *
22  * Alternatively, the contents of this file may be used under the terms of
23  * either the GNU General Public License Version 2 or later (the "GPLv2+"), or
24  * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
25  * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
26  * instead of those above.
27  */
28 #ifndef _LIBCMIS_TYPES_H_
29 #define _LIBCMIS_TYPES_H_
30 
31 #ifndef __cplusplus
32 #include <stdbool.h>
33 #else
34 extern "C" {
35 #endif
36 
37 #include <stddef.h>
38 
39 
40 /* Vectors of simple types */
41 
42 
43 typedef struct libcmis_vector_bool* libcmis_vector_bool_Ptr;
44 
45 typedef struct libcmis_vector_string* libcmis_vector_string_Ptr;
46 
47 typedef struct libcmis_vector_long* libcmis_vector_long_Ptr;
48 
49 typedef struct libcmis_vector_double* libcmis_vector_double_Ptr;
50 
51 typedef struct libcmis_vector_time* libcmis_vector_time_Ptr;
52 
53 typedef struct libcmis_vector_repository* libcmis_vector_Repository_Ptr;
54 
55 
56 /* AllowableActions */
57 
58 
59 typedef struct libcmis_allowable_actions* libcmis_AllowableActionsPtr;
60 
61 typedef enum
62 {
63     libcmis_DeleteObject,
64     libcmis_UpdateProperties,
65     libcmis_GetFolderTree,
66     libcmis_GetProperties,
67     libcmis_GetObjectRelationships,
68     libcmis_GetObjectParents,
69     libcmis_GetFolderParent,
70     libcmis_GetDescendants,
71     libcmis_MoveObject,
72     libcmis_DeleteContentStream,
73     libcmis_CheckOut,
74     libcmis_CancelCheckOut,
75     libcmis_CheckIn,
76     libcmis_SetContentStream,
77     libcmis_GetAllVersions,
78     libcmis_AddObjectToFolder,
79     libcmis_RemoveObjectFromFolder,
80     libcmis_GetContentStream,
81     libcmis_ApplyPolicy,
82     libcmis_GetAppliedPolicies,
83     libcmis_RemovePolicy,
84     libcmis_GetChildren,
85     libcmis_CreateDocument,
86     libcmis_CreateFolder,
87     libcmis_CreateRelationship,
88     libcmis_DeleteTree,
89     libcmis_GetRenditions,
90     libcmis_GetACL,
91     libcmis_ApplyACL
92 } libcmis_allowable_actions_Type;
93 
94 
95 /* Document */
96 
97 
98 typedef struct libcmis_document* libcmis_DocumentPtr;
99 typedef size_t ( *libcmis_writeFn )( const void*, size_t, size_t, void* );
100 typedef size_t ( *libcmis_readFn )( void*, size_t, size_t, void* );
101 
102 typedef struct libcmis_vector_document* libcmis_vector_document_Ptr;
103 
104 /* Error */
105 
106 
107 typedef struct libcmis_error* libcmis_ErrorPtr;
108 
109 
110 /* Folder */
111 
112 
113 typedef struct libcmis_folder* libcmis_FolderPtr;
114 
115 
116 typedef struct libcmis_vector_folder* libcmis_vector_folder_Ptr;
117 
118 typedef enum
119 {
120     libcmis_Unfile,
121     libcmis_DeleteSingleFiled,
122     libcmis_Delete
123 } libcmis_folder_UnfileObjects;
124 
125 
126 /* ObjectType */
127 
128 
129 typedef struct libcmis_object_type* libcmis_ObjectTypePtr;
130 
131 typedef struct libcmis_vector_object_type* libcmis_vector_object_type_Ptr;
132 
133 typedef enum
134 {
135     libcmis_NotAllowed,
136     libcmis_Allowed,
137     libcmis_Required
138 } libcmis_object_type_ContentStreamAllowed;
139 
140 
141 /* Object */
142 
143 
144 typedef struct libcmis_object* libcmis_ObjectPtr;
145 
146 typedef struct libcmis_vector_object* libcmis_vector_object_Ptr;
147 
148 
149 /* Property */
150 
151 
152 typedef struct libcmis_property* libcmis_PropertyPtr;
153 
154 typedef struct libcmis_vector_property* libcmis_vector_property_Ptr;
155 
156 
157 /* PropertyType */
158 
159 
160 typedef struct libcmis_property_type* libcmis_PropertyTypePtr;
161 
162 typedef struct libcmis_vector_property_type* libcmis_vector_property_type_Ptr;
163 
164 typedef enum
165 {
166     libcmis_String,
167     libcmis_Integer,
168     libcmis_Decimal,
169     libcmis_Bool,
170     libcmis_DateTime
171 } libcmis_property_type_Type;
172 
173 
174 /* Repository */
175 
176 typedef enum
177 {
178     libcmis_capability_ACL,
179     libcmis_capability_AllVersionsSearchable,
180     libcmis_capability_Changes,
181     libcmis_capability_ContentStreamUpdatability,
182     libcmis_capability_GetDescendants,
183     libcmis_capability_GetFolderTree,
184     libcmis_capability_OrderBy,
185     libcmis_capability_Multifiling,
186     libcmis_capability_PWCSearchable,
187     libcmis_capability_PWCUpdatable,
188     libcmis_capability_Query,
189     libcmis_capability_Renditions,
190     libcmis_capability_Unfiling,
191     libcmis_capability_VersionSpecificFiling,
192     libcmis_capability_Join
193 } libcmis_repository_capability_Type;
194 
195 typedef struct libcmis_repository* libcmis_RepositoryPtr;
196 
197 
198 /* Session */
199 
200 
201 typedef struct libcmis_session* libcmis_SessionPtr;
202 
203 typedef bool ( *libcmis_authenticationCallback )( char* username, char* password );
204 typedef bool ( *libcmis_certValidationCallback )( libcmis_vector_string_Ptr certificatesChain );
205 typedef char * ( *libcmis_oauth2AuthCodeProvider ) ( const char* authUrl, const char* username, const char* password );
206 
207 
208 /* OAuth2Data */
209 
210 
211 typedef struct libcmis_oauth2data* libcmis_OAuth2DataPtr;
212 
213 typedef char* ( *libcmis_OAuth2AuthCodeProvider )( const char* authUrl,
214         const char* username, const char* password );
215 
216 
217 /* Rendition */
218 
219 
220 typedef struct libcmis_rendition* libcmis_RenditionPtr;
221 typedef struct libcmis_vector_rendition* libcmis_vector_rendition_Ptr;
222 
223 #ifdef __cplusplus
224 }
225 #endif
226 
227 #endif
228