1*5900e8ecSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*5900e8ecSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*5900e8ecSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*5900e8ecSAndrew Rist  * distributed with this work for additional information
6*5900e8ecSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*5900e8ecSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*5900e8ecSAndrew Rist  * "License"); you may not use this file except in compliance
9*5900e8ecSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*5900e8ecSAndrew Rist  *
11*5900e8ecSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*5900e8ecSAndrew Rist  *
13*5900e8ecSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*5900e8ecSAndrew Rist  * software distributed under the License is distributed on an
15*5900e8ecSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*5900e8ecSAndrew Rist  * KIND, either express or implied.  See the License for the
17*5900e8ecSAndrew Rist  * specific language governing permissions and limitations
18*5900e8ecSAndrew Rist  * under the License.
19*5900e8ecSAndrew Rist  *
20*5900e8ecSAndrew Rist  *************************************************************/
21*5900e8ecSAndrew Rist 
22*5900e8ecSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "precompiled_svtools.hxx"
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "paneltabbarpeer.hxx"
27cdf0e10cSrcweir #include "svtools/toolpanel/paneltabbar.hxx"
28cdf0e10cSrcweir 
29cdf0e10cSrcweir /** === begin UNO includes === **/
30cdf0e10cSrcweir #include <com/sun/star/lang/DisposedException.hpp>
31cdf0e10cSrcweir /** === end UNO includes === **/
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <tools/diagnose_ex.h>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir //........................................................................
36cdf0e10cSrcweir namespace svt
37cdf0e10cSrcweir {
38cdf0e10cSrcweir //........................................................................
39cdf0e10cSrcweir 
40cdf0e10cSrcweir 	/** === begin UNO using === **/
41cdf0e10cSrcweir 	using ::com::sun::star::uno::Reference;
42cdf0e10cSrcweir 	using ::com::sun::star::uno::XInterface;
43cdf0e10cSrcweir 	using ::com::sun::star::uno::UNO_QUERY;
44cdf0e10cSrcweir 	using ::com::sun::star::uno::UNO_QUERY_THROW;
45cdf0e10cSrcweir 	using ::com::sun::star::uno::UNO_SET_THROW;
46cdf0e10cSrcweir 	using ::com::sun::star::uno::Exception;
47cdf0e10cSrcweir 	using ::com::sun::star::uno::RuntimeException;
48cdf0e10cSrcweir 	using ::com::sun::star::uno::Any;
49cdf0e10cSrcweir 	using ::com::sun::star::uno::makeAny;
50cdf0e10cSrcweir 	using ::com::sun::star::uno::Sequence;
51cdf0e10cSrcweir 	using ::com::sun::star::uno::Type;
52cdf0e10cSrcweir     using ::com::sun::star::accessibility::XAccessibleContext;
53cdf0e10cSrcweir     using ::com::sun::star::lang::DisposedException;
54cdf0e10cSrcweir 	/** === end UNO using === **/
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	//==================================================================================================================
57cdf0e10cSrcweir 	//= PanelTabBarPeer
58cdf0e10cSrcweir 	//==================================================================================================================
59cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
PanelTabBarPeer(PanelTabBar & i_rTabBar)60cdf0e10cSrcweir     PanelTabBarPeer::PanelTabBarPeer( PanelTabBar& i_rTabBar )
61cdf0e10cSrcweir         :VCLXWindow()
62cdf0e10cSrcweir         ,m_pTabBar( &i_rTabBar )
63cdf0e10cSrcweir     {
64cdf0e10cSrcweir     }
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
~PanelTabBarPeer()67cdf0e10cSrcweir     PanelTabBarPeer::~PanelTabBarPeer()
68cdf0e10cSrcweir     {
69cdf0e10cSrcweir     }
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
CreateAccessibleContext()72cdf0e10cSrcweir     Reference< XAccessibleContext > PanelTabBarPeer::CreateAccessibleContext()
73cdf0e10cSrcweir     {
74cdf0e10cSrcweir         ::vos::OGuard aSolarGuard( GetMutex() );
75cdf0e10cSrcweir         if ( m_pTabBar == NULL )
76cdf0e10cSrcweir             throw DisposedException( ::rtl::OUString(), *this );
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 
80cdf0e10cSrcweir         Window* pAccessibleParent( m_pTabBar->GetAccessibleParentWindow() );
81cdf0e10cSrcweir         ENSURE_OR_RETURN( pAccessibleParent != NULL, "no accessible parent => no accessible context", NULL );
82cdf0e10cSrcweir         Reference< XAccessible > xAccessibleParent( pAccessibleParent->GetAccessible(), UNO_SET_THROW );
83cdf0e10cSrcweir         return m_aAccessibleFactory.getFactory().createAccessibleToolPanelTabBar( xAccessibleParent, m_pTabBar->GetPanelDeck(), *m_pTabBar );
84cdf0e10cSrcweir     }
85cdf0e10cSrcweir 
86cdf0e10cSrcweir 	//------------------------------------------------------------------------------------------------------------------
dispose()87cdf0e10cSrcweir     void SAL_CALL PanelTabBarPeer::dispose() throw(RuntimeException)
88cdf0e10cSrcweir     {
89cdf0e10cSrcweir         {
90cdf0e10cSrcweir             ::vos::OGuard aSolarGuard( GetMutex() );
91cdf0e10cSrcweir             m_pTabBar = NULL;
92cdf0e10cSrcweir         }
93cdf0e10cSrcweir         VCLXWindow::dispose();
94cdf0e10cSrcweir     }
95cdf0e10cSrcweir 
96cdf0e10cSrcweir //........................................................................
97cdf0e10cSrcweir } // namespace svt
98cdf0e10cSrcweir //........................................................................
99