1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef ODMA_CONTENTPROPS_HXX
28 #define ODMA_CONTENTPROPS_HXX
29 
30 #include "rtl/ref.hxx"
31 #include "salhelper/simplereferenceobject.hxx"
32 #include <rtl/ustring.hxx>
33 #include <com/sun/star/util/DateTime.hpp>
34 #include <functional>
35 
36 namespace odma
37 {
38 	class ContentProperties : public salhelper::SimpleReferenceObject
39 	{
40 	public:
41 		com::sun::star::util::DateTime	m_aDateCreated;	// when was the document created
42 		com::sun::star::util::DateTime	m_aDateModified;	// when was the document last modified
43 		::rtl::OUString					m_sTitle;    	// Title
44 		::rtl::OUString					m_sContentType;	// ContentType
45 		::rtl::OString					m_sDocumentId;	// the document id given from the DMS
46 		::rtl::OUString					m_sDocumentName;// document name
47 		::rtl::OUString					m_sFileURL;		// the temporary file location
48 		::rtl::OUString					m_sAuthor;		// the Author of the document
49 		::rtl::OUString					m_sSubject;		// the subject of the document
50 		::rtl::OUString					m_sKeywords;	// the keywords of the document
51 		::rtl::OUString					m_sSavedAsName;	// the name which was used to save it
52 		sal_Bool						m_bIsDocument;  // IsDocument
53 		sal_Bool						m_bIsFolder;    // IsFolder
54 		sal_Bool						m_bIsOpen;		// is true when OpenDoc was called
55 		sal_Bool						m_bIsReadOnly;	// true when the document is read-only
56 
57 		// @@@ Add other properties supported by your content.
58 
59 		ContentProperties()
60 		:m_bIsDocument( sal_True )
61 		,m_bIsFolder( sal_False )
62 		,m_bIsOpen( sal_False )
63 		,m_bIsReadOnly( sal_False )
64 		{}
65 
66 		inline ::rtl::OUString getTitle()		const { return m_sTitle;		}
67 		inline ::rtl::OUString getSavedAsName() const { return m_sSavedAsName;	}
68 	};
69 	typedef ::std::binary_function< ::rtl::Reference<ContentProperties>, ::rtl::OUString,bool> TContentPropertiesFunctorBase;
70 	/// binary_function Functor object for class ContentProperties return type is bool
71 	class ContentPropertiesMemberFunctor : public TContentPropertiesFunctorBase
72 	{
73 		::std::const_mem_fun_t< ::rtl::OUString,ContentProperties> m_aFunction;
74 	public:
75 		ContentPropertiesMemberFunctor(const ::std::const_mem_fun_t< ::rtl::OUString,ContentProperties>& _rFunc)
76 			: m_aFunction(_rFunc){}
77 
78 		inline bool operator()(const ::rtl::Reference<ContentProperties>& lhs,const ::rtl::OUString& rhs) const
79 		{
80 			return !!(m_aFunction(lhs.get()) == rhs);
81 		}
82 	};
83 }
84 #endif // ODMA_CONTENTPROPS_HXX
85 
86