Line data Source code
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 _FOLDER_HXX_
29 : #define _FOLDER_HXX_
30 :
31 : #include <map>
32 : #include <string>
33 : #include <vector>
34 :
35 : #include "exception.hxx"
36 : #include "object.hxx"
37 :
38 : namespace libcmis
39 : {
40 : class Document;
41 : class Session;
42 :
43 : struct UnfileObjects {
44 : enum Type
45 : {
46 : Unfile,
47 : DeleteSingleFiled,
48 : Delete
49 : };
50 : };
51 :
52 : /** Class representing a CMIS folder.
53 : */
54 : class Folder : public virtual Object
55 : {
56 : public:
57 : Folder( Session* session ) : Object( session ) { }
58 0 : virtual ~Folder() { }
59 :
60 : virtual std::vector< std::string > getPaths( );
61 :
62 : virtual ::boost::shared_ptr< Folder > getFolderParent( ) throw ( Exception );
63 : virtual std::vector< ObjectPtr > getChildren( ) throw ( Exception ) = 0;
64 : virtual std::string getParentId( );
65 : virtual std::string getPath( );
66 :
67 : virtual bool isRootFolder( );
68 :
69 : virtual ::boost::shared_ptr< Folder > createFolder( const std::map< std::string, PropertyPtr >& properties )
70 : throw ( libcmis::Exception ) = 0;
71 : virtual ::boost::shared_ptr< Document > createDocument( const std::map< std::string, PropertyPtr >& properties,
72 : boost::shared_ptr< std::ostream > os, std::string contentType, std::string fileName ) throw ( Exception ) = 0;
73 :
74 : virtual std::vector< std::string > removeTree( bool allVersion = true, UnfileObjects::Type unfile = UnfileObjects::Delete,
75 : bool continueOnError = false ) throw ( Exception ) = 0;
76 :
77 : virtual std::string toString( );
78 : };
79 : typedef ::boost::shared_ptr< Folder > FolderPtr;
80 :
81 : }
82 :
83 : #endif
|