Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_FORMBROWSERTOOLS_HXX
21 : #define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_FORMBROWSERTOOLS_HXX
22 :
23 : #include <com/sun/star/uno/Any.hxx>
24 : #include <com/sun/star/beans/Property.hpp>
25 : #include <rtl/ustring.hxx>
26 :
27 : #include <functional>
28 : #include <set>
29 :
30 :
31 : namespace pcr
32 : {
33 :
34 :
35 : OUString GetUIHeadlineName(sal_Int16 _nClassId, const ::com::sun::star::uno::Any& _rUnoObject);
36 : sal_Int16 classifyComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent );
37 :
38 :
39 : struct FindPropertyByHandle : public ::std::unary_function< ::com::sun::star::beans::Property, bool >
40 : {
41 : private:
42 : sal_Int32 m_nId;
43 :
44 : public:
45 0 : FindPropertyByHandle( sal_Int32 _nId ) : m_nId ( _nId ) { }
46 0 : bool operator()( const ::com::sun::star::beans::Property& _rProp ) const
47 : {
48 0 : return m_nId == _rProp.Handle;
49 : }
50 : };
51 :
52 :
53 0 : struct FindPropertyByName : public ::std::unary_function< ::com::sun::star::beans::Property, bool >
54 : {
55 : private:
56 : OUString m_sName;
57 :
58 : public:
59 0 : FindPropertyByName( const OUString& _rName ) : m_sName( _rName ) { }
60 0 : bool operator()( const ::com::sun::star::beans::Property& _rProp ) const
61 : {
62 0 : return m_sName == _rProp.Name;
63 : }
64 : };
65 :
66 :
67 : struct PropertyLessByName
68 : :public ::std::binary_function < ::com::sun::star::beans::Property,
69 : ::com::sun::star::beans::Property,
70 : bool
71 : >
72 : {
73 0 : bool operator() (const css::beans::Property& _rLhs, const css::beans::Property& _rRhs) const
74 : {
75 0 : return _rLhs.Name < _rRhs.Name;
76 : }
77 : };
78 :
79 :
80 : struct TypeLessByName
81 : :public ::std::binary_function < ::com::sun::star::uno::Type,
82 : ::com::sun::star::uno::Type,
83 : bool
84 : >
85 : {
86 0 : bool operator() (const css::uno::Type& _rLhs, const css::uno::Type& _rRhs) const
87 : {
88 0 : return _rLhs.getTypeName() < _rRhs.getTypeName();
89 : }
90 : };
91 :
92 :
93 : typedef ::std::set< ::com::sun::star::beans::Property, PropertyLessByName > PropertyBag;
94 :
95 :
96 : } // namespace pcr
97 :
98 :
99 : #endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_FORMBROWSERTOOLS_HXX
100 :
101 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|