fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / svtools / toolpanel / drawerlayouter.hxx
blob0ee0560a887385aca616f918eae4e86a56ee96b4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 //......................................................................................................................
31 namespace svt
33 //......................................................................................................................
35 class ToolPanelViewShell;
36 class ToolPanelDrawer;
37 typedef ::boost::shared_ptr< ToolPanelDrawer > PToolPanelDrawer;
39 //==================================================================================================================
40 //= ToolPanelDrawer
41 //==================================================================================================================
42 /** a class which implements a tool panel selector in the form of the classical drawers
44 class SVT_DLLPUBLIC DrawerDeckLayouter :public RefBase
45 ,public IDeckLayouter
46 ,public IToolPanelDeckListener
48 public:
49 DrawerDeckLayouter(
50 ::Window& i_rParentWindow,
51 IToolPanelDeck& i_rPanels
53 ~DrawerDeckLayouter();
55 // IReference
56 DECLARE_IREFERENCE()
58 // IDeckLayouter
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 >
64 GetAccessibleChild(
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 );
74 virtual void Dying();
76 private:
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* );
84 private:
85 Window& m_rParentWindow;
86 IToolPanelDeck& m_rPanelDeck;
87 ::std::vector< PToolPanelDrawer > m_aDrawers;
88 ::boost::optional< size_t > m_aLastKnownActivePanel;
91 //......................................................................................................................
92 } // namespace svt
93 //......................................................................................................................
95 #endif // SVT_DRAWERLAYOUTER_HXX
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */