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 .
22 #define EDITOR_LIST_APPEND (SAL_MAX_UINT16)
23 #define EDITOR_LIST_ENTRY_NOTFOUND (SAL_MAX_UINT16)
25 #include <sal/config.h>
27 #include <com/sun/star/uno/Sequence.hxx>
28 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
29 #include <comphelper/interfacecontainer3.hxx>
34 enum class OwnPropertyId
36 INTROSPECTEDOBJECT
= 0x0010,
38 CONTROLCONTEXT
= 0x0012,
45 typedef ::comphelper::OInterfaceContainerHelper3
< css::beans::XPropertyChangeListener
46 > PropertyChangeListeners
;
51 // small helper to make the "swap" call on an STL container a single-line call, which
52 // in its canonic form "aFoo.swap( Container() )" doesn't compile with GCC
53 template< class CONTAINER
>
54 void clearContainer( CONTAINER
& _rContainer
)
56 CONTAINER().swap(_rContainer
);
62 /// small helper to translate help ids into help urls
66 static OUString
getHelpId( std::u16string_view _rHelpURL
);
67 static OUString
getHelpURL( std::u16string_view
);
73 template< class ELEMENT
>
74 class StlSyntaxSequence
: public css::uno::Sequence
< ELEMENT
>
77 typedef css::uno::Sequence
< ELEMENT
> UnoBase
;
80 StlSyntaxSequence() : UnoBase() { }
81 explicit StlSyntaxSequence( const UnoBase
& rSeq
) : UnoBase( rSeq
) { }
82 explicit StlSyntaxSequence( sal_Int32 len
) : UnoBase( len
) { }
84 typedef const ELEMENT
* const_iterator
;
85 typedef ELEMENT
* iterator
;
87 const_iterator
begin() const { return UnoBase::getConstArray(); }
88 const_iterator
end() const { return UnoBase::getConstArray() + UnoBase::getLength(); }
90 iterator
begin() { return UnoBase::getArray(); }
91 iterator
end() { return UnoBase::getArray() + UnoBase::getLength(); }
93 sal_Int32
size() const { return UnoBase::getLength(); }
94 bool empty() const { return !UnoBase::hasElements(); }
100 #define DECLARE_XCOMPONENT() \
101 virtual void SAL_CALL dispose( ) override; \
102 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; \
103 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
105 #define IMPLEMENT_FORWARD_XCOMPONENT( classname, baseclass ) \
106 void SAL_CALL classname::dispose( ) \
108 baseclass::WeakComponentImplHelperBase::dispose(); \
110 void SAL_CALL classname::addEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener ) \
112 baseclass::WeakComponentImplHelperBase::addEventListener( Listener ); \
114 void SAL_CALL classname::removeEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener ) \
116 baseclass::WeakComponentImplHelperBase::removeEventListener( Listener ); \
123 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */