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) 2014 Mihai Varga <mihai.mv13@gmail.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 29 #ifndef _ONEDRIVE_DOCUMENT_HXX_ 30 #define _ONEDRIVE_DOCUMENT_HXX_ 31 32 #include <libcmis/document.hxx> 33 #include <libcmis/folder.hxx> 34 #include <libcmis/rendition.hxx> 35 36 #include "onedrive-object.hxx" 37 #include "json-utils.hxx" 38 39 class OneDriveDocument : public libcmis::Document, public OneDriveObject 40 { 41 public: 42 OneDriveDocument( OneDriveSession* session ); 43 44 OneDriveDocument( OneDriveSession* session, Json json, 45 std::string id = std::string( ), 46 std::string name = std::string( ) ); 47 ~OneDriveDocument( ); 48 getType()49 std::string getType( ) { return std::string( "cmis:document" );} getBaseType()50 std::string getBaseType( ) { return std::string( "cmis:document" );} 51 52 virtual std::vector< libcmis::FolderPtr > getParents( ); 53 54 virtual boost::shared_ptr< std::istream > getContentStream( std::string streamId = std::string( ) ); 55 56 virtual void setContentStream( boost::shared_ptr< std::ostream > os, 57 std::string contentType, 58 std::string fileName, 59 bool overwrite = true ); 60 61 virtual libcmis::DocumentPtr checkOut( ); 62 virtual void cancelCheckout( ); 63 64 virtual libcmis::DocumentPtr checkIn( bool isMajor, 65 std::string comment, 66 const std::map< std::string,libcmis::PropertyPtr >& 67 properties, 68 boost::shared_ptr< std::ostream > stream, 69 std::string contentType, 70 std::string fileName ); 71 72 virtual std::vector< libcmis::DocumentPtr > getAllVersions( ); 73 }; 74 75 #endif 76