bump product version to 6.3.0.0.beta1
[LibreOffice.git] / extensions / source / propctrlr / pcrcommon.hxx
blobe200396a6c7e8846a605c136da3ded052ca5cbc1
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 INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_PCRCOMMON_HXX
21 #define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_PCRCOMMON_HXX
23 #define EDITOR_LIST_APPEND (SAL_MAX_UINT16)
24 #define EDITOR_LIST_ENTRY_NOTFOUND (SAL_MAX_UINT16)
26 #include <com/sun/star/uno/Sequence.hxx>
27 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
28 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
30 #include <comphelper/listenernotification.hxx>
33 namespace pcr
37 #define OWN_PROPERTY_ID_INTROSPECTEDOBJECT 0x0010
38 #define OWN_PROPERTY_ID_CURRENTPAGE 0x0011
39 #define OWN_PROPERTY_ID_CONTROLCONTEXT 0x0012
40 #define OWN_PROPERTY_ID_TABBINGMODEL 0x0013
43 //= types
45 typedef ::comphelper::OSimpleListenerContainer < css::beans::XPropertyChangeListener
46 , css::beans::PropertyChangeEvent
47 > PropertyChangeListeners;
50 //= helper
52 // small helper to make the "swap" call on an STL container a single-line call, which
53 // in its canonic form "aFoo.swap( Container() )" doesn't compile with GCC
54 template< class CONTAINER >
55 void clearContainer( CONTAINER& _rContainer )
57 CONTAINER aEmpty;
58 _rContainer.swap( aEmpty );
62 //= HelpIdUrl
64 /// small helper to translate help ids into help urls
65 class HelpIdUrl
67 public:
68 static OString getHelpId( const OUString& _rHelpURL );
69 static OUString getHelpURL( const OString& );
73 //= StlSyntaxSequence
75 template< class ELEMENT >
76 class StlSyntaxSequence : public css::uno::Sequence< ELEMENT >
78 private:
79 typedef css::uno::Sequence< ELEMENT > UnoBase;
81 public:
82 StlSyntaxSequence() : UnoBase() { }
83 explicit StlSyntaxSequence( const UnoBase& rSeq ) : UnoBase( rSeq ) { }
84 explicit StlSyntaxSequence( sal_Int32 len ) : UnoBase( len ) { }
86 typedef const ELEMENT* const_iterator;
87 typedef ELEMENT* iterator;
89 const_iterator begin() const { return UnoBase::getConstArray(); }
90 const_iterator end() const { return UnoBase::getConstArray() + UnoBase::getLength(); }
92 iterator begin() { return UnoBase::getArray(); }
93 iterator end() { return UnoBase::getArray() + UnoBase::getLength(); }
95 sal_Int32 size() const { return UnoBase::getLength(); }
96 bool empty() const { return !UnoBase::hasElements(); }
100 //= UNO helpers
102 #define DECLARE_XCOMPONENT() \
103 virtual void SAL_CALL dispose( ) override; \
104 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; \
105 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
107 #define IMPLEMENT_FORWARD_XCOMPONENT( classname, baseclass ) \
108 void SAL_CALL classname::dispose( ) \
110 baseclass::WeakComponentImplHelperBase::dispose(); \
112 void SAL_CALL classname::addEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener ) \
114 baseclass::WeakComponentImplHelperBase::addEventListener( Listener ); \
116 void SAL_CALL classname::removeEventListener( const css::uno::Reference< css::lang::XEventListener >& Listener ) \
118 baseclass::WeakComponentImplHelperBase::removeEventListener( Listener ); \
122 } // namespace pcr
125 #endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_PCRCOMMON_HXX
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */