1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
30 //............................................................................
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 >
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 >
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
,
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 //========================================================================
81 :public ::std::binary_function
< ::com::sun::star::uno::Type
,
82 ::com::sun::star::uno::Type
,
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 //............................................................................
97 //............................................................................
99 #endif // _EXTENSIONS_FORMSCTRLR_FORMBROWSERTOOLS_HXX_
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */