1 /*************************************************************************
2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3  *
4  * Copyright 2000, 2010 Oracle and/or its affiliates.
5  *
6  * OpenOffice.org - a multi-platform office productivity suite
7  *
8  * This file is part of OpenOffice.org.
9  *
10  * OpenOffice.org is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License version 3
12  * only, as published by the Free Software Foundation.
13  *
14  * OpenOffice.org is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Lesser General Public License version 3 for more details
18  * (a copy is included in the LICENSE file that accompanied this code).
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with OpenOffice.org.  If not, see
22  * <http://www.openoffice.org/license.html>
23  * for a copy of the LGPLv3 License.
24  *
25 ************************************************************************/
26 
27 #ifndef SVT_TABLAYOUTER_HXX
28 #define SVT_TABLAYOUTER_HXX
29 
30 #include "svtools/svtdllapi.h"
31 #include "svtools/toolpanel/decklayouter.hxx"
32 #include "svtools/toolpanel/tabalignment.hxx"
33 #include "svtools/toolpanel/tabitemcontent.hxx"
34 #include "svtools/toolpanel/refbase.hxx"
35 
36 #include <memory>
37 
38 #include <boost/noncopyable.hpp>
39 
40 class Window;
41 
42 //........................................................................
43 namespace svt
44 {
45 //........................................................................
46 
47     class IToolPanelDeck;
48 
49     struct TabDeckLayouter_Data;
50 
51 	//====================================================================
52 	//= TabDeckLayouter
53 	//====================================================================
54     class SVT_DLLPUBLIC TabDeckLayouter :public RefBase
55                                         ,public IDeckLayouter
56                                         ,public ::boost::noncopyable
57 	{
58     public:
59         /** creates a new layouter
60             @param i_rParent
61                 is the parent window for any VCL windows the layouter needs to create.
62             @param i_rPanels
63                 is the panel deck which the layouter is responsible for.
64             @param i_eAlignment
65                 specifies the alignment of the panel selector
66             @param TabItemContent
67                 specifies the content to show on the tab items
68         */
69         TabDeckLayouter(
70             Window& i_rParent,
71             IToolPanelDeck& i_rPanels,
72             const TabAlignment i_eAlignment,
73             const TabItemContent i_eItemContent
74         );
75         ~TabDeckLayouter();
76 
77         // attribute access
78         TabItemContent  GetTabItemContent() const;
79         void            SetTabItemContent( const TabItemContent& i_eItemContent );
80         TabAlignment    GetTabAlignment() const;
81 
82         // helpers for the A11Y implementation
83         ::boost::optional< size_t >
84                         GetFocusedPanelItem() const;
85         void            FocusPanelItem( const size_t i_nItemPos );
86         bool            IsPanelSelectorEnabled() const;
87         bool            IsPanelSelectorVisible() const;
88         Rectangle       GetItemScreenRect( const size_t i_nItemPos ) const;
89 
90         // IDeckLayouter
91         virtual Rectangle   Layout( const Rectangle& i_rDeckPlayground );
92         virtual void        Destroy();
93         virtual void        SetFocusToPanelSelector();
94         virtual size_t      GetAccessibleChildCount() const;
95         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
96                             GetAccessibleChild(
97                                 const size_t i_nChildIndex,
98                                 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
99                             );
100 
101         // IReference
102         DECLARE_IREFERENCE()
103 
104     private:
105         ::std::auto_ptr< TabDeckLayouter_Data > m_pData;
106 	};
107 
108 //........................................................................
109 } // namespace svt
110 //........................................................................
111 
112 #endif // SVT_TABLAYOUTER_HXX
113