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 SVT_DRAWERLAYOUTER_HXX
21 #define SVT_DRAWERLAYOUTER_HXX
23 #include "svtools/svtdllapi.h"
24 #include "svtools/toolpanel/refbase.hxx"
25 #include "svtools/toolpanel/toolpaneldeck.hxx"
26 #include "svtools/toolpanel/decklayouter.hxx"
28 #include <boost/shared_ptr.hpp>
30 //......................................................................................................................
33 //......................................................................................................................
35 class ToolPanelViewShell
;
36 class ToolPanelDrawer
;
37 typedef ::boost::shared_ptr
< ToolPanelDrawer
> PToolPanelDrawer
;
39 //==================================================================================================================
41 //==================================================================================================================
42 /** a class which implements a tool panel selector in the form of the classical drawers
44 class SVT_DLLPUBLIC DrawerDeckLayouter
:public RefBase
46 ,public IToolPanelDeckListener
50 ::Window
& i_rParentWindow
,
51 IToolPanelDeck
& i_rPanels
53 ~DrawerDeckLayouter();
59 virtual Rectangle
Layout( const Rectangle
& i_rDeckPlayground
);
60 virtual void Destroy();
61 virtual void SetFocusToPanelSelector();
62 virtual size_t GetAccessibleChildCount() const;
63 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
>
65 const size_t i_nChildIndex
,
66 const ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
>& i_rParentAccessible
69 // IToolPanelDeckListener
70 virtual void PanelInserted( const PToolPanel
& i_pPanel
, const size_t i_nPosition
);
71 virtual void PanelRemoved( const size_t i_nPosition
);
72 virtual void ActivePanelChanged( const ::boost::optional
< size_t >& i_rOldActive
, const ::boost::optional
< size_t >& i_rNewActive
);
73 virtual void LayouterChanged( const PDeckLayouter
& i_rNewLayouter
);
77 // triggers a re-arrance of the panel deck elements
78 void impl_triggerRearrange() const;
79 size_t impl_getPanelPositionFromWindow( const Window
* i_pDrawerWindow
) const;
80 void impl_removeDrawer( const size_t i_nPosition
);
82 DECL_LINK( OnWindowEvent
, VclSimpleEvent
* );
85 Window
& m_rParentWindow
;
86 IToolPanelDeck
& m_rPanelDeck
;
87 ::std::vector
< PToolPanelDrawer
> m_aDrawers
;
88 ::boost::optional
< size_t > m_aLastKnownActivePanel
;
91 //......................................................................................................................
93 //......................................................................................................................
95 #endif // SVT_DRAWERLAYOUTER_HXX
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */