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