bump product version to 4.1.6.2
[LibreOffice.git] / extensions / source / propctrlr / formbrowsertools.hxx
blob2df90d5ab6bd661ab97420ca21665e1d998a3227
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _EXTENSIONS_FORMSCTRLR_FORMBROWSERTOOLS_HXX_
21 #define _EXTENSIONS_FORMSCTRLR_FORMBROWSERTOOLS_HXX_
23 #include <com/sun/star/uno/Any.hxx>
24 #include <com/sun/star/beans/Property.hpp>
25 #include <rtl/ustring.hxx>
27 #include <functional>
28 #include <set>
30 //............................................................................
31 namespace pcr
33 //............................................................................
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 );
38 //========================================================================
39 struct FindPropertyByHandle : public ::std::unary_function< ::com::sun::star::beans::Property, bool >
41 private:
42 sal_Int32 m_nId;
44 public:
45 FindPropertyByHandle( sal_Int32 _nId ) : m_nId ( _nId ) { }
46 bool operator()( const ::com::sun::star::beans::Property& _rProp ) const
48 return m_nId == _rProp.Handle;
52 //========================================================================
53 struct FindPropertyByName : public ::std::unary_function< ::com::sun::star::beans::Property, bool >
55 private:
56 OUString m_sName;
58 public:
59 FindPropertyByName( const OUString& _rName ) : m_sName( _rName ) { }
60 bool operator()( const ::com::sun::star::beans::Property& _rProp ) const
62 return m_sName == _rProp.Name;
66 //========================================================================
67 struct PropertyLessByName
68 :public ::std::binary_function < ::com::sun::star::beans::Property,
69 ::com::sun::star::beans::Property,
70 bool
73 bool operator() (::com::sun::star::beans::Property _rLhs, ::com::sun::star::beans::Property _rRhs) const
75 return _rLhs.Name < _rRhs.Name ? true : false;
79 //========================================================================
80 struct TypeLessByName
81 :public ::std::binary_function < ::com::sun::star::uno::Type,
82 ::com::sun::star::uno::Type,
83 bool
86 bool operator() (::com::sun::star::uno::Type _rLhs, ::com::sun::star::uno::Type _rRhs) const
88 return _rLhs.getTypeName() < _rRhs.getTypeName() ? true : false;
92 //========================================================================
93 typedef ::std::set< ::com::sun::star::beans::Property, PropertyLessByName > PropertyBag;
95 //............................................................................
96 } // namespace pcr
97 //............................................................................
99 #endif // _EXTENSIONS_FORMSCTRLR_FORMBROWSERTOOLS_HXX_
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */