Branch data 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 _OBJECT_HXX_
29 : : #define _OBJECT_HXX_
30 : :
31 : : #include <ctime>
32 : : #include <map>
33 : : #include <string>
34 : :
35 : : #include <boost/date_time.hpp>
36 : : #include <boost/shared_ptr.hpp>
37 : :
38 : : #include "allowable-actions.hxx"
39 : : #include "exception.hxx"
40 : : #include "object-type.hxx"
41 : : #include "property.hxx"
42 : : #include "xmlserializable.hxx"
43 : :
44 : : // for compatibility with libcmis in LO tree
45 : : #define CmisObject Object
46 : : #define CmisObjectPtr ObjectPtr
47 : :
48 : : namespace libcmis
49 : : {
50 : : /** Class representing any CMIS object.
51 : : */
52 : : class Object : public XmlSerializable
53 : : {
54 : : public:
55 : 0 : virtual ~Object( ) { }
56 : :
57 : : virtual std::string getId( ) = 0;
58 : : virtual std::string getName( ) = 0;
59 : :
60 : : /** Computes the paths for the objects.
61 : :
62 : : Note that folders will have only path, documents may have
63 : : several ones and there may be cases where there is no path
64 : : at all (unfiled objects);
65 : : */
66 : : virtual std::vector< std::string > getPaths( ) = 0;
67 : :
68 : : virtual std::string getBaseType( ) = 0;
69 : : virtual std::string getType( ) = 0;
70 : :
71 : : virtual std::string getCreatedBy( ) = 0;
72 : : virtual boost::posix_time::ptime getCreationDate( ) = 0;
73 : : virtual std::string getLastModifiedBy( ) = 0;
74 : : virtual boost::posix_time::ptime getLastModificationDate( ) = 0;
75 : :
76 : : virtual std::string getChangeToken( ) = 0;
77 : : virtual bool isImmutable( ) = 0;
78 : :
79 : : virtual std::map< std::string, PropertyPtr >& getProperties( ) = 0;
80 : : virtual void updateProperties( ) throw ( Exception ) = 0;
81 : :
82 : : virtual ObjectTypePtr getTypeDescription( ) = 0;
83 : : virtual boost::shared_ptr< AllowableActions > getAllowableActions( ) = 0;
84 : :
85 : : /** Reload the data from the server.
86 : : */
87 : : virtual void refresh( ) throw ( Exception ) = 0;
88 : : virtual time_t getRefreshTimestamp( ) = 0;
89 : :
90 : : virtual void remove( bool allVersions = true ) throw ( Exception ) = 0;
91 : :
92 : : /** Dump the object as a string for debugging or display purpose.
93 : : */
94 : : virtual std::string toString( ) = 0;
95 : : };
96 : :
97 : : typedef ::boost::shared_ptr< Object > ObjectPtr;
98 : : }
99 : :
100 : : #endif
|