GPU-Calc: remove Alloc_Host_Ptr for clmem of NAN vector
[LibreOffice.git] / svtools / source / toolpanel / toolpaneldrawer.hxx
blobf2dfea75b1ffa5fb4f6737145fc0c35bb2f3d327
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 .
21 #include <vcl/window.hxx>
22 #include <vcl/virdev.hxx>
24 //......................................................................................................................
25 namespace svt
27 //......................................................................................................................
29 class ToolPanelDrawer;
30 //==================================================================================================================
31 //= DrawerVisualization
32 //==================================================================================================================
33 /** serves a single purpose - let ZoomText read the drawers ...
35 Strange enough, ZoomText does not read the drawers when they get the focus (in none of the combinations
36 of AccessibleRoles I tried), except when it does have an AccessibleChild with the role LABEL. To "inject"
37 such a child into the A11Y hierarchy, we use this window here.
39 (We could also inject the A11Y component on the A11Y level only, but this would mean additional code. With
40 this approach here, VCL/toolkit will take care of creating and maintaining the A11Y component for us.)
42 class DrawerVisualization : public Window
44 public:
45 DrawerVisualization( ToolPanelDrawer& i_rParent );
46 ~DrawerVisualization();
48 protected:
49 // Window overridables
50 virtual void Paint( const Rectangle& i_rBoundingBox );
52 private:
53 ToolPanelDrawer& m_rDrawer;
56 //==================================================================================================================
57 //= ToolPanelDrawer
58 //==================================================================================================================
59 //------------------------------------------------------------------------------------------------------------------
60 class ToolPanelDrawer : public Window
62 public:
63 ToolPanelDrawer( Window& i_rParent, const OUString& i_rTitle );
64 ~ToolPanelDrawer();
66 long GetPreferredHeightPixel() const;
67 void SetExpanded( const bool i_bExpanded );
68 bool IsExpanded() const { return m_bExpanded; }
70 void Paint();
72 protected:
73 // Window overridables
74 virtual void GetFocus();
75 virtual void LoseFocus();
76 virtual void Resize();
77 virtual void DataChanged( const DataChangedEvent& i_rEvent );
78 virtual void MouseButtonDown( const MouseEvent& i_rMouseEvent );
80 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
81 GetComponentInterface( sal_Bool i_bCreate );
83 private:
84 Rectangle impl_calcTextBoundingBox() const;
85 Rectangle impl_calcTitleBarBox( const Rectangle& i_rTextBox ) const;
86 void impl_paintBackground( const Rectangle& i_rTitleBarBox );
87 sal_uInt16 impl_getTextStyle() const;
88 void impl_paintFocusIndicator( const Rectangle& i_rTextBox );
89 Rectangle impl_paintExpansionIndicator( const Rectangle& i_rTextBox );
90 Image impl_getExpansionIndicator() const;
92 // don't expose SetText. Our text is used as AccessibleName/Desc, and those are not expected to change.
93 using Window::SetText;
94 using Window::Paint;
96 private:
97 ::std::auto_ptr< VirtualDevice > m_pPaintDevice;
98 DrawerVisualization m_aVisualization;
99 bool m_bFocused;
100 bool m_bExpanded;
103 //......................................................................................................................
104 } // namespace svt
105 //......................................................................................................................
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */