1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SVT_TABLAYOUTER_HXX
25 #define SVT_TABLAYOUTER_HXX
26 
27 #include "svtools/svtdllapi.h"
28 #include "svtools/toolpanel/decklayouter.hxx"
29 #include "svtools/toolpanel/tabalignment.hxx"
30 #include "svtools/toolpanel/tabitemcontent.hxx"
31 #include "svtools/toolpanel/refbase.hxx"
32 
33 #include <memory>
34 
35 #include <boost/noncopyable.hpp>
36 
37 class Window;
38 
39 //........................................................................
40 namespace svt
41 {
42 //........................................................................
43 
44     class IToolPanelDeck;
45 
46     struct TabDeckLayouter_Data;
47 
48 	//====================================================================
49 	//= TabDeckLayouter
50 	//====================================================================
51     class SVT_DLLPUBLIC TabDeckLayouter :public RefBase
52                                         ,public IDeckLayouter
53                                         ,public ::boost::noncopyable
54 	{
55     public:
56         /** creates a new layouter
57             @param i_rParent
58                 is the parent window for any VCL windows the layouter needs to create.
59             @param i_rPanels
60                 is the panel deck which the layouter is responsible for.
61             @param i_eAlignment
62                 specifies the alignment of the panel selector
63             @param TabItemContent
64                 specifies the content to show on the tab items
65         */
66         TabDeckLayouter(
67             Window& i_rParent,
68             IToolPanelDeck& i_rPanels,
69             const TabAlignment i_eAlignment,
70             const TabItemContent i_eItemContent
71         );
72         ~TabDeckLayouter();
73 
74         // attribute access
75         TabItemContent  GetTabItemContent() const;
76         void            SetTabItemContent( const TabItemContent& i_eItemContent );
77         TabAlignment    GetTabAlignment() const;
78 
79         // helpers for the A11Y implementation
80         ::boost::optional< size_t >
81                         GetFocusedPanelItem() const;
82         void            FocusPanelItem( const size_t i_nItemPos );
83         bool            IsPanelSelectorEnabled() const;
84         bool            IsPanelSelectorVisible() const;
85         Rectangle       GetItemScreenRect( const size_t i_nItemPos ) const;
86 
87         // IDeckLayouter
88         virtual Rectangle   Layout( const Rectangle& i_rDeckPlayground );
89         virtual void        Destroy();
90         virtual void        SetFocusToPanelSelector();
91         virtual size_t      GetAccessibleChildCount() const;
92         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
93                             GetAccessibleChild(
94                                 const size_t i_nChildIndex,
95                                 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
96                             );
97 
98         // IReference
99         DECLARE_IREFERENCE()
100 
101     private:
102         ::std::auto_ptr< TabDeckLayouter_Data > m_pData;
103 	};
104 
105 //........................................................................
106 } // namespace svt
107 //........................................................................
108 
109 #endif // SVT_TABLAYOUTER_HXX
110