Branch libreoffice-5-0-4
[LibreOffice.git] / include / toolkit / controls / stdtabcontroller.hxx
blob39dd1173e5dfad9b9e94b5bc292012f4c6dca507
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_TOOLKIT_CONTROLS_STDTABCONTROLLER_HXX
21 #define INCLUDED_TOOLKIT_CONTROLS_STDTABCONTROLLER_HXX
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/awt/XTabController.hpp>
26 #include <com/sun/star/awt/XControl.hpp>
27 #include <com/sun/star/awt/XControlContainer.hpp>
28 #include <com/sun/star/lang/XTypeProvider.hpp>
29 #include <cppuhelper/weakagg.hxx>
30 #include <osl/mutex.hxx>
31 #include <toolkit/helper/macros.hxx>
32 #include <toolkit/helper/servicenames.hxx>
35 class StdTabController : public ::com::sun::star::awt::XTabController,
36 public ::com::sun::star::lang::XServiceInfo,
37 public ::com::sun::star::lang::XTypeProvider,
38 public ::cppu::OWeakAggObject
40 private:
41 ::osl::Mutex maMutex;
42 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel > mxModel;
43 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > mxControlContainer;
45 protected:
46 ::osl::Mutex& GetMutex() { return maMutex; }
47 static bool ImplCreateComponentSequence( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > >& rControls, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& rModels, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > >& rComponents, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>* pTabStops, bool bPeerComponent );
48 // if sequence length of rModels is less than rControls, return only the matching elements in rModels sequence and remove corresponding elements from rControls
49 void ImplActivateControl( bool bFirst ) const;
51 public:
52 StdTabController();
53 virtual ~StdTabController();
55 static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > FindControl( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > >& rCtrls, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & rxCtrlModel );
57 // ::com::sun::star::uno::XInterface
58 ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE { return OWeakAggObject::queryInterface(rType); }
59 void SAL_CALL acquire() throw() SAL_OVERRIDE { OWeakAggObject::acquire(); }
60 void SAL_CALL release() throw() SAL_OVERRIDE { OWeakAggObject::release(); }
62 ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
64 // ::com::sun::star::lang::XTypeProvider
65 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
66 ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
68 // XTabController
69 void SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel >& Model ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
70 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel > SAL_CALL getModel( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
71 void SAL_CALL setContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& Container ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
72 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > SAL_CALL getContainer( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
73 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > SAL_CALL getControls( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
74 void SAL_CALL autoTabOrder( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
75 void SAL_CALL activateTabOrder( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 void SAL_CALL activateFirst( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
77 void SAL_CALL activateLast( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
79 // XServiceInfo
80 OUString SAL_CALL getImplementationName()
81 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
83 sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
84 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
86 css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
87 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
92 #endif // _TOOLKIT_AWT_STDTABCONTROLLER_HXX_
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */