/src/libreoffice/vcl/source/window/impldockingwrapper.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #pragma once |
21 | | |
22 | | #include <vcl/dockwin.hxx> |
23 | | #include <memory> |
24 | | #include <vector> |
25 | | |
26 | | /** ImplDockingWindowWrapper |
27 | | * |
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. |
31 | | */ |
32 | | |
33 | | class ImplDockingWindowWrapper final |
34 | | { |
35 | | friend class ::vcl::Window; |
36 | | friend class DockingManager; |
37 | | friend class DockingWindow; |
38 | | |
39 | | private: |
40 | | |
41 | | // the original 'Docking'window |
42 | | VclPtr<vcl::Window> mpDockingWindow; |
43 | | |
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; |
71 | | |
72 | | DECL_LINK( PopupModeEnd, FloatingWindow*, void ); |
73 | 0 | void ImplEnableStartDocking() { mbStartDockingEnabled = true; } |
74 | 0 | bool ImplStartDockingEnabled() const { return mbStartDockingEnabled; } |
75 | | void ImplPreparePopupMode(); |
76 | | |
77 | | public: |
78 | | ImplDockingWindowWrapper( const vcl::Window *pWindow ); |
79 | | ~ImplDockingWindowWrapper(); |
80 | | |
81 | 0 | vcl::Window* GetWindow() { return mpDockingWindow; } |
82 | | void ImplStartDocking( const Point& rPos ); |
83 | | |
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(); |
90 | | |
91 | | void SetDragArea( const tools::Rectangle& rRect ); |
92 | 0 | const tools::Rectangle& GetDragArea() const { return maDragArea;} |
93 | | |
94 | | void Lock(); |
95 | | void Unlock(); |
96 | 0 | bool IsLocked() const { return mbLocked;} |
97 | | |
98 | | void StartPopupMode( const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags ); |
99 | | void StartPopupMode( ToolBox* pParentToolBox, FloatWinPopupFlags nPopupModeFlags ); |
100 | | bool IsInPopupMode() const; |
101 | | |
102 | 0 | void SetPopupModeEndHdl( const Link<FloatingWindow*,void>& rLink ) { maPopupModeEndHdl = rLink; } |
103 | | |
104 | | void TitleButtonClick( TitleButton nButton ); |
105 | | void Resizing( Size& rSize ); |
106 | | void Tracking( const TrackingEvent& rTEvt ); |
107 | | |
108 | | void ShowMenuTitleButton( bool bVisible ); |
109 | | |
110 | | void SetMinOutputSizePixel( const Size& rSize ); |
111 | | |
112 | | void SetMaxOutputSizePixel( const Size& rSize ); |
113 | | |
114 | 0 | bool IsDocking() const { return mbDocking; } |
115 | 0 | bool IsDockingCanceled() const { return mbDockCanceled; } |
116 | | |
117 | | void SetFloatingMode( bool bFloatMode ); |
118 | | bool IsFloatingMode() const; |
119 | | SystemWindow* GetFloatingWindow() const; |
120 | | |
121 | | void SetFloatStyle( WinBits nWinStyle ); |
122 | 0 | WinBits GetFloatStyle() const { return mnFloatBits;} |
123 | | |
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; |
129 | | }; |
130 | | |
131 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |