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_INTERNALS_H_ 29 #define _LIBCMIS_INTERNALS_H_ 30 31 #include <vector> 32 33 #include <libcmis/allowable-actions.hxx> 34 #include <libcmis/document.hxx> 35 #include <libcmis/exception.hxx> 36 #include <libcmis/folder.hxx> 37 #include <libcmis/object.hxx> 38 #include <libcmis/property.hxx> 39 #include <libcmis/repository.hxx> 40 #include <libcmis/session.hxx> 41 #include <libcmis/session-factory.hxx> 42 43 std::string createString( char* str ); 44 45 struct libcmis_error 46 { 47 char* message; 48 char* type; 49 bool badAlloc; 50 libcmis_errorlibcmis_error51 libcmis_error( ) : message( NULL ), type( NULL ), badAlloc( false ) { } 52 }; 53 54 struct libcmis_session 55 { 56 libcmis::Session* handle; 57 libcmis::AuthProviderPtr provider; 58 59 // Constructors 60 libcmis_sessionlibcmis_session61 libcmis_session( ) : 62 handle( NULL ), 63 provider( ) 64 { 65 } 66 libcmis_sessionlibcmis_session67 libcmis_session( const libcmis_session& copy ) : 68 handle( copy.handle ), 69 provider( copy.provider ) 70 { 71 } 72 operator =libcmis_session73 libcmis_session& operator=( const libcmis_session& copy ) 74 { 75 if ( this != © ) 76 { 77 handle = copy.handle; 78 provider = copy.provider; 79 } 80 return *this; 81 } 82 }; 83 84 struct libcmis_repository 85 { 86 libcmis::RepositoryPtr handle; 87 libcmis_repositorylibcmis_repository88 libcmis_repository( ) : handle( ) { } 89 }; 90 91 struct libcmis_object 92 { 93 libcmis::ObjectPtr handle; 94 libcmis_objectlibcmis_object95 libcmis_object( ) : handle( ) { } ~libcmis_objectlibcmis_object96 virtual ~libcmis_object( ) { } 97 }; 98 99 struct libcmis_object_type 100 { 101 libcmis::ObjectTypePtr handle; 102 libcmis_object_typelibcmis_object_type103 libcmis_object_type( ) : handle( ) { } 104 }; 105 106 struct libcmis_allowable_actions 107 { 108 libcmis::AllowableActionsPtr handle; 109 libcmis_allowable_actionslibcmis_allowable_actions110 libcmis_allowable_actions( ) : handle ( ) { } 111 }; 112 113 struct libcmis_property_type 114 { 115 libcmis::PropertyTypePtr handle; 116 libcmis_property_typelibcmis_property_type117 libcmis_property_type( ) : handle( ) { } 118 }; 119 120 struct libcmis_property 121 { 122 libcmis::PropertyPtr handle; 123 libcmis_propertylibcmis_property124 libcmis_property( ) : handle( ) { } 125 }; 126 127 struct libcmis_folder : public libcmis_object 128 { libcmis_folderlibcmis_folder129 libcmis_folder( ) : libcmis_object( ) { } 130 }; 131 132 struct libcmis_document : public libcmis_object 133 { libcmis_documentlibcmis_document134 libcmis_document( ) : libcmis_object( ) { } 135 }; 136 137 struct libcmis_oauth2data 138 { 139 libcmis::OAuth2DataPtr handle; 140 libcmis_oauth2datalibcmis_oauth2data141 libcmis_oauth2data( ) : handle( ) { } 142 }; 143 144 struct libcmis_rendition 145 { 146 libcmis::RenditionPtr handle; 147 libcmis_renditionlibcmis_rendition148 libcmis_rendition( ) : handle( ) { } 149 }; 150 151 struct libcmis_vector_bool 152 { 153 std::vector< bool > handle; 154 libcmis_vector_boollibcmis_vector_bool155 libcmis_vector_bool( ) : handle( ) { } 156 }; 157 158 struct libcmis_vector_string 159 { 160 std::vector< std::string > handle; 161 libcmis_vector_stringlibcmis_vector_string162 libcmis_vector_string( ) : handle( ) { } 163 }; 164 165 struct libcmis_vector_long 166 { 167 std::vector< long > handle; 168 libcmis_vector_longlibcmis_vector_long169 libcmis_vector_long( ) : handle( ) { } 170 }; 171 172 struct libcmis_vector_double 173 { 174 std::vector< double > handle; 175 libcmis_vector_doublelibcmis_vector_double176 libcmis_vector_double( ) : handle( ) { } 177 }; 178 179 struct libcmis_vector_time 180 { 181 std::vector< boost::posix_time::ptime > handle; 182 libcmis_vector_timelibcmis_vector_time183 libcmis_vector_time( ) : handle( ) { } 184 }; 185 186 struct libcmis_vector_object_type 187 { 188 std::vector< libcmis::ObjectTypePtr > handle; 189 libcmis_vector_object_typelibcmis_vector_object_type190 libcmis_vector_object_type( ) : handle( ) { } 191 }; 192 193 struct libcmis_vector_property_type 194 { 195 std::vector< libcmis::PropertyTypePtr > handle; 196 libcmis_vector_property_typelibcmis_vector_property_type197 libcmis_vector_property_type( ) : handle( ) { } 198 }; 199 200 struct libcmis_vector_property 201 { 202 std::vector< libcmis::PropertyPtr > handle; 203 libcmis_vector_propertylibcmis_vector_property204 libcmis_vector_property( ) : handle( ) { } 205 }; 206 207 struct libcmis_vector_object 208 { 209 std::vector< libcmis::ObjectPtr > handle; 210 libcmis_vector_objectlibcmis_vector_object211 libcmis_vector_object( ) : handle( ) { } 212 }; 213 214 struct libcmis_vector_folder 215 { 216 std::vector< libcmis::FolderPtr > handle; 217 libcmis_vector_folderlibcmis_vector_folder218 libcmis_vector_folder( ) : handle( ) { } 219 }; 220 221 struct libcmis_vector_document 222 { 223 std::vector< libcmis::DocumentPtr > handle; 224 libcmis_vector_documentlibcmis_vector_document225 libcmis_vector_document( ) : handle( ) { } 226 }; 227 228 struct libcmis_vector_repository 229 { 230 std::vector< libcmis::RepositoryPtr > handle; 231 libcmis_vector_repositorylibcmis_vector_repository232 libcmis_vector_repository( ) : handle( ) { } 233 }; 234 235 struct libcmis_vector_rendition 236 { 237 std::vector< libcmis::RenditionPtr > handle; 238 libcmis_vector_renditionlibcmis_vector_rendition239 libcmis_vector_rendition( ) : handle( ) { } 240 }; 241 242 #endif 243