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_DECKLAYOUTER_HXX
25 #define SVT_DECKLAYOUTER_HXX
26 
27 #include <com/sun/star/uno/Reference.hxx>
28 
29 #include <rtl/ref.hxx>
30 
31 #include <boost/optional.hpp>
32 
33 namespace com { namespace sun { namespace star { namespace accessibility {
34     class XAccessible;
35 } } } }
36 class Rectangle;
37 class Point;
38 
39 //........................................................................
40 namespace svt
41 {
42 //........................................................................
43 
44 	//====================================================================
45 	//= IDeckLayouter
46 	//====================================================================
47     class IDeckLayouter : public ::rtl::IReference
48 	{
49     public:
50         /** re-arranges the elements of the tool deck, taking into account the
51             available space for the complete deck.
52 
53             @param i_rDeckPlayground
54                 the playground for the complete tool panel deck
55             @return
56                 the content area for a single tool panel
57         */
58         virtual ::Rectangle Layout( const ::Rectangle& i_rDeckPlayground ) = 0;
59 
60         /** destroys the instance
61 
62             Since the layouter is ref-counted, but might keep references to non-ref-counted objects
63             (in particular, the ToolPanelDeck, which is a VCL-Window, and thus cannot be ref-counted),
64             Destroy is the definitive way to dispose the instance. Technically, it's still alive afterwards,
65             but non-functional.
66         */
67         virtual void        Destroy() = 0;
68 
69         /** assuming that a layouter neesds to provide some kind of panel selector control, this method
70             requests to set the focus to this control.
71         */
72         virtual void        SetFocusToPanelSelector() = 0;
73 
74         /** returns the number of components in the XAccessible hierarchy which are needed to represent all elements
75             the layouter is responsible form.
76 
77             Note that the implementation must guarantee that the count is fixed over the life time of the layouter.
78         */
79         virtual size_t      GetAccessibleChildCount() const = 0;
80 
81         /** retrieves the XAccessible implementation for the <code>i_nChildIndex</code>'th child in the XAccessible
82             hierarchy.
83         */
84         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
85                             GetAccessibleChild(
86                                 const size_t i_nChildIndex,
87                                 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
88                             ) = 0;
89 
~IDeckLayouter()90         virtual ~IDeckLayouter()
91         {
92         }
93 	};
94 
95     typedef ::rtl::Reference< IDeckLayouter >   PDeckLayouter;
96 
97 //........................................................................
98 } // namespace svt
99 //........................................................................
100 
101 #endif // SVT_DECKLAYOUTER_HXX
102