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