1*6df1ea1fSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*6df1ea1fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*6df1ea1fSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*6df1ea1fSAndrew Rist * distributed with this work for additional information 6*6df1ea1fSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*6df1ea1fSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*6df1ea1fSAndrew Rist * "License"); you may not use this file except in compliance 9*6df1ea1fSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*6df1ea1fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*6df1ea1fSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*6df1ea1fSAndrew Rist * software distributed under the License is distributed on an 15*6df1ea1fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*6df1ea1fSAndrew Rist * KIND, either express or implied. See the License for the 17*6df1ea1fSAndrew Rist * specific language governing permissions and limitations 18*6df1ea1fSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*6df1ea1fSAndrew Rist *************************************************************/ 21*6df1ea1fSAndrew Rist 22*6df1ea1fSAndrew Rist 23cdf0e10cSrcweir #ifndef ODMA_CONTENTPROPS_HXX 24cdf0e10cSrcweir #define ODMA_CONTENTPROPS_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include "rtl/ref.hxx" 27cdf0e10cSrcweir #include "salhelper/simplereferenceobject.hxx" 28cdf0e10cSrcweir #include <rtl/ustring.hxx> 29cdf0e10cSrcweir #include <com/sun/star/util/DateTime.hpp> 30cdf0e10cSrcweir #include <functional> 31cdf0e10cSrcweir 32cdf0e10cSrcweir namespace odma 33cdf0e10cSrcweir { 34cdf0e10cSrcweir class ContentProperties : public salhelper::SimpleReferenceObject 35cdf0e10cSrcweir { 36cdf0e10cSrcweir public: 37cdf0e10cSrcweir com::sun::star::util::DateTime m_aDateCreated; // when was the document created 38cdf0e10cSrcweir com::sun::star::util::DateTime m_aDateModified; // when was the document last modified 39cdf0e10cSrcweir ::rtl::OUString m_sTitle; // Title 40cdf0e10cSrcweir ::rtl::OUString m_sContentType; // ContentType 41cdf0e10cSrcweir ::rtl::OString m_sDocumentId; // the document id given from the DMS 42cdf0e10cSrcweir ::rtl::OUString m_sDocumentName;// document name 43cdf0e10cSrcweir ::rtl::OUString m_sFileURL; // the temporary file location 44cdf0e10cSrcweir ::rtl::OUString m_sAuthor; // the Author of the document 45cdf0e10cSrcweir ::rtl::OUString m_sSubject; // the subject of the document 46cdf0e10cSrcweir ::rtl::OUString m_sKeywords; // the keywords of the document 47cdf0e10cSrcweir ::rtl::OUString m_sSavedAsName; // the name which was used to save it 48cdf0e10cSrcweir sal_Bool m_bIsDocument; // IsDocument 49cdf0e10cSrcweir sal_Bool m_bIsFolder; // IsFolder 50cdf0e10cSrcweir sal_Bool m_bIsOpen; // is true when OpenDoc was called 51cdf0e10cSrcweir sal_Bool m_bIsReadOnly; // true when the document is read-only 52cdf0e10cSrcweir 53cdf0e10cSrcweir // @@@ Add other properties supported by your content. 54cdf0e10cSrcweir ContentProperties()55cdf0e10cSrcweir ContentProperties() 56cdf0e10cSrcweir :m_bIsDocument( sal_True ) 57cdf0e10cSrcweir ,m_bIsFolder( sal_False ) 58cdf0e10cSrcweir ,m_bIsOpen( sal_False ) 59cdf0e10cSrcweir ,m_bIsReadOnly( sal_False ) 60cdf0e10cSrcweir {} 61cdf0e10cSrcweir getTitle() const62cdf0e10cSrcweir inline ::rtl::OUString getTitle() const { return m_sTitle; } getSavedAsName() const63cdf0e10cSrcweir inline ::rtl::OUString getSavedAsName() const { return m_sSavedAsName; } 64cdf0e10cSrcweir }; 65cdf0e10cSrcweir typedef ::std::binary_function< ::rtl::Reference<ContentProperties>, ::rtl::OUString,bool> TContentPropertiesFunctorBase; 66cdf0e10cSrcweir /// binary_function Functor object for class ContentProperties return type is bool 67cdf0e10cSrcweir class ContentPropertiesMemberFunctor : public TContentPropertiesFunctorBase 68cdf0e10cSrcweir { 69cdf0e10cSrcweir ::std::const_mem_fun_t< ::rtl::OUString,ContentProperties> m_aFunction; 70cdf0e10cSrcweir public: ContentPropertiesMemberFunctor(const::std::const_mem_fun_t<::rtl::OUString,ContentProperties> & _rFunc)71cdf0e10cSrcweir ContentPropertiesMemberFunctor(const ::std::const_mem_fun_t< ::rtl::OUString,ContentProperties>& _rFunc) 72cdf0e10cSrcweir : m_aFunction(_rFunc){} 73cdf0e10cSrcweir operator ()(const::rtl::Reference<ContentProperties> & lhs,const::rtl::OUString & rhs) const74cdf0e10cSrcweir inline bool operator()(const ::rtl::Reference<ContentProperties>& lhs,const ::rtl::OUString& rhs) const 75cdf0e10cSrcweir { 76cdf0e10cSrcweir return !!(m_aFunction(lhs.get()) == rhs); 77cdf0e10cSrcweir } 78cdf0e10cSrcweir }; 79cdf0e10cSrcweir } 80cdf0e10cSrcweir #endif // ODMA_CONTENTPROPS_HXX 81cdf0e10cSrcweir 82