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 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/lang/XTypeProvider.hpp>
27 #include <cppuhelper/weakagg.hxx>
28 #include <osl/mutex.hxx>
31 namespace com
{ namespace sun
{ namespace star
{ namespace awt
{ class XWindow
; } } } }
32 namespace com
{ namespace sun
{ namespace star
{ namespace awt
{ class XControl
; } } } }
33 namespace com
{ namespace sun
{ namespace star
{ namespace awt
{ class XControlContainer
; } } } }
35 class StdTabController final
: public css::awt::XTabController
,
36 public css::lang::XServiceInfo
,
37 public css::lang::XTypeProvider
,
38 public ::cppu::OWeakAggObject
42 css::uno::Reference
< css::awt::XTabControllerModel
> mxModel
;
43 css::uno::Reference
< css::awt::XControlContainer
> mxControlContainer
;
45 ::osl::Mutex
& GetMutex() { return maMutex
; }
46 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
);
47 // if sequence length of rModels is less than rControls, return only the matching elements in rModels sequence and remove corresponding elements from rControls
48 void ImplActivateControl( bool bFirst
) const;
52 virtual ~StdTabController() override
;
54 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
);
56 // css::uno::XInterface
57 css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
{ return OWeakAggObject::queryInterface(rType
); }
58 void SAL_CALL
acquire() throw() override
{ OWeakAggObject::acquire(); }
59 void SAL_CALL
release() throw() override
{ OWeakAggObject::release(); }
61 css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) override
;
63 // css::lang::XTypeProvider
64 css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
65 css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
68 void SAL_CALL
setModel( const css::uno::Reference
< css::awt::XTabControllerModel
>& Model
) override
;
69 css::uno::Reference
< css::awt::XTabControllerModel
> SAL_CALL
getModel( ) override
;
70 void SAL_CALL
setContainer( const css::uno::Reference
< css::awt::XControlContainer
>& Container
) override
;
71 css::uno::Reference
< css::awt::XControlContainer
> SAL_CALL
getContainer( ) override
;
72 css::uno::Sequence
< css::uno::Reference
< css::awt::XControl
> > SAL_CALL
getControls( ) override
;
73 void SAL_CALL
autoTabOrder( ) override
;
74 void SAL_CALL
activateTabOrder( ) override
;
75 void SAL_CALL
activateFirst( ) override
;
76 void SAL_CALL
activateLast( ) override
;
79 OUString SAL_CALL
getImplementationName() override
;
81 sal_Bool SAL_CALL
supportsService(OUString
const & ServiceName
) override
;
83 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
87 #endif // _TOOLKIT_AWT_STDTABCONTROLLER_HXX_
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */