bump product version to 7.6.3.2-android
[LibreOffice.git] / vcl / source / window / impldockingwrapper.hxx
blob671510e3c5866dda8e762ea1e1a6964274f3695d
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 #pragma once
22 #include <vcl/dockwin.hxx>
23 #include <memory>
24 #include <vector>
26 /** ImplDockingWindowWrapper
28 * ImplDockingWindowWrapper obsoletes the DockingWindow class.
29 * It is better because it can make a "normal window" dockable.
30 * All DockingWindows should be converted the new class.
33 class ImplDockingWindowWrapper final
35 friend class ::vcl::Window;
36 friend class DockingManager;
37 friend class DockingWindow;
39 private:
41 // the original 'Docking'window
42 VclPtr<vcl::Window> mpDockingWindow;
44 // the original DockingWindow members
45 VclPtr<FloatingWindow> mpFloatWin;
46 VclPtr<vcl::Window> mpOldBorderWin;
47 VclPtr<vcl::Window> mpParent;
48 Link<FloatingWindow*,void> maPopupModeEndHdl;
49 Point maFloatPos;
50 Point maDockPos;
51 Point maMouseOff;
52 Size maMinOutSize;
53 Size maMaxOutSize;
54 tools::Rectangle maDragArea;
55 tools::Long mnTrackX;
56 tools::Long mnTrackY;
57 tools::Long mnTrackWidth;
58 tools::Long mnTrackHeight;
59 sal_Int32 mnDockLeft;
60 sal_Int32 mnDockTop;
61 sal_Int32 mnDockRight;
62 sal_Int32 mnDockBottom;
63 WinBits mnFloatBits;
64 bool mbDockCanceled:1,
65 mbDocking:1,
66 mbLastFloatMode:1,
67 mbDockBtn:1,
68 mbHideBtn:1,
69 mbStartDockingEnabled:1,
70 mbLocked:1;
72 DECL_LINK( PopupModeEnd, FloatingWindow*, void );
73 void ImplEnableStartDocking() { mbStartDockingEnabled = true; }
74 bool ImplStartDockingEnabled() const { return mbStartDockingEnabled; }
75 void ImplPreparePopupMode();
77 public:
78 ImplDockingWindowWrapper( const vcl::Window *pWindow );
79 ~ImplDockingWindowWrapper();
81 vcl::Window* GetWindow() { return mpDockingWindow; }
82 void ImplStartDocking( const Point& rPos );
84 // those methods actually call the corresponding handlers
85 void StartDocking( const Point& rPos, tools::Rectangle const & rRect );
86 bool Docking( const Point& rPos, tools::Rectangle& rRect );
87 void EndDocking( const tools::Rectangle& rRect, bool bFloatMode );
88 bool PrepareToggleFloatingMode();
89 void ToggleFloatingMode();
91 void SetDragArea( const tools::Rectangle& rRect );
92 const tools::Rectangle& GetDragArea() const { return maDragArea;}
94 void Lock();
95 void Unlock();
96 bool IsLocked() const { return mbLocked;}
98 void StartPopupMode( const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags );
99 void StartPopupMode( ToolBox* pParentToolBox, FloatWinPopupFlags nPopupModeFlags );
100 bool IsInPopupMode() const;
102 void SetPopupModeEndHdl( const Link<FloatingWindow*,void>& rLink ) { maPopupModeEndHdl = rLink; }
104 void TitleButtonClick( TitleButton nButton );
105 void Resizing( Size& rSize );
106 void Tracking( const TrackingEvent& rTEvt );
108 void ShowMenuTitleButton( bool bVisible );
110 void SetMinOutputSizePixel( const Size& rSize );
112 void SetMaxOutputSizePixel( const Size& rSize );
114 bool IsDocking() const { return mbDocking; }
115 bool IsDockingCanceled() const { return mbDockCanceled; }
117 void SetFloatingMode( bool bFloatMode );
118 bool IsFloatingMode() const;
119 SystemWindow* GetFloatingWindow() const;
121 void SetFloatStyle( WinBits nWinStyle );
122 WinBits GetFloatStyle() const { return mnFloatBits;}
124 void setPosSizePixel( tools::Long nX, tools::Long nY,
125 tools::Long nWidth, tools::Long nHeight,
126 PosSizeFlags nFlags );
127 Point GetPosPixel() const;
128 Size GetSizePixel() const;
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */