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 .
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/awt/XTabController.hpp>
25 #include <com/sun/star/lang/XTypeProvider.hpp>
26 #include <cppuhelper/weakagg.hxx>
27 #include <osl/mutex.hxx>
30 namespace com::sun::star::awt
{ class XWindow
; }
31 namespace com::sun::star::awt
{ class XControl
; }
32 namespace com::sun::star::awt
{ class XControlContainer
; }
34 class StdTabController final
: public css::awt::XTabController
,
35 public css::lang::XServiceInfo
,
36 public css::lang::XTypeProvider
,
37 public ::cppu::OWeakAggObject
41 css::uno::Reference
< css::awt::XTabControllerModel
> mxModel
;
42 css::uno::Reference
< css::awt::XControlContainer
> mxControlContainer
;
44 ::osl::Mutex
& GetMutex() { return maMutex
; }
45 static bool ImplCreateComponentSequence( css::uno::Sequence
< css::uno::Reference
< css::awt::XControl
> >& rControls
, const css::uno::Sequence
< css::uno::Reference
< css::awt::XControlModel
> >& rModels
, css::uno::Sequence
< css::uno::Reference
< css::awt::XWindow
> >& rComponents
, css::uno::Sequence
< css::uno::Any
>* pTabStops
, bool bPeerComponent
);
46 // if sequence length of rModels is less than rControls, return only the matching elements in rModels sequence and remove corresponding elements from rControls
47 void ImplActivateControl( bool bFirst
) const;
51 virtual ~StdTabController() override
;
53 static css::uno::Reference
< css::awt::XControl
> FindControl( css::uno::Sequence
< css::uno::Reference
< css::awt::XControl
> >& rCtrls
, const css::uno::Reference
< css::awt::XControlModel
> & rxCtrlModel
);
55 // css::uno::XInterface
56 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
{ return OWeakAggObject::queryInterface(rType
); }
57 void SAL_CALL
acquire() noexcept override
{ OWeakAggObject::acquire(); }
58 void SAL_CALL
release() noexcept override
{ OWeakAggObject::release(); }
60 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
62 // css::lang::XTypeProvider
63 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
64 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
67 void SAL_CALL
setModel( const css::uno::Reference
< css::awt::XTabControllerModel
>& Model
) override
;
68 css::uno::Reference
< css::awt::XTabControllerModel
> SAL_CALL
getModel( ) override
;
69 void SAL_CALL
setContainer( const css::uno::Reference
< css::awt::XControlContainer
>& Container
) override
;
70 css::uno::Reference
< css::awt::XControlContainer
> SAL_CALL
getContainer( ) override
;
71 css::uno::Sequence
< css::uno::Reference
< css::awt::XControl
> > SAL_CALL
getControls( ) override
;
72 void SAL_CALL
autoTabOrder( ) override
;
73 void SAL_CALL
activateTabOrder( ) override
;
74 void SAL_CALL
activateFirst( ) override
;
75 void SAL_CALL
activateLast( ) override
;
78 OUString SAL_CALL
getImplementationName() override
;
80 sal_Bool SAL_CALL
supportsService(OUString
const & ServiceName
) override
;
82 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */