LibreOffice Module sfx2 (master) 1
splitwin.hxx
Go to the documentation of this file.
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#ifndef INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
20#define INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
21
22#include <vcl/splitwin.hxx>
23#include <sfx2/childwin.hxx>
24#include <sfx2/dockwin.hxx>
25
26#include <vector>
27#include <memory>
28
29class SfxWorkWindow;
32
34{
35 sal_uInt16 nType;
36 VclPtr<SfxDockingWindow> pWin; // SplitWindow has this window
38 bool bHide; // SplitWindow had this window
39};
40
41class SfxSplitWindow final : public SplitWindow
42{
44
45private:
48 std::vector<std::unique_ptr<SfxDock_Impl> >
50 bool bPinned;
53
54 void InsertWindow_Impl( SfxDock_Impl const * pDockWin,
55 const Size& rSize,
56 sal_uInt16 nLine,
57 sal_uInt16 nPos,
58 bool bNewLine );
59
60 DECL_LINK( TimerHdl, Timer*, void );
61 bool CursorIsOverRect() const;
62 void SetPinned_Impl( bool );
63 void SetFadeIn_Impl( bool );
64 void SaveConfig_Impl();
65 void FadeOut_Impl();
66
67 virtual void StartSplit() override;
68 virtual void SplitResize() override;
69 virtual void Split() override;
70 virtual void MouseButtonDown ( const MouseEvent& ) override;
71
72public:
74 SfxWorkWindow *pW, bool bWithButtons );
75
76 virtual ~SfxSplitWindow() override;
77 virtual void dispose() override;
78
79 void ReleaseWindow_Impl(SfxDockingWindow const *pWin, bool bSaveConfig=true);
80
81 void InsertWindow( SfxDockingWindow* pDockWin,
82 const Size& rSize);
83
84 void InsertWindow( SfxDockingWindow* pDockWin,
85 const Size& rSize,
86 sal_uInt16 nLine,
87 sal_uInt16 nPos,
88 bool bNewLine );
89
90 void MoveWindow( SfxDockingWindow* pDockWin,
91 const Size& rSize,
92 sal_uInt16 nLine,
93 sal_uInt16 nPos,
94 bool bNewLine );
95
96 void RemoveWindow( SfxDockingWindow const * pDockWin, bool bHide=true);
97
98 void Lock( bool bLock=true )
99 {
100 SetUpdateMode( !bLock );
101 }
102
103 bool GetWindowPos( const SfxDockingWindow* pWindow,
104 sal_uInt16& rLine, sal_uInt16& rPos ) const;
105 bool GetWindowPos( const Point& rTestPos,
106 sal_uInt16& rLine, sal_uInt16& rPos ) const;
107 sal_uInt16 GetLineCount() const;
108 tools::Long GetLineSize( sal_uInt16 ) const;
109 sal_uInt16 GetWindowCount(sal_uInt16 nLine) const;
110 sal_uInt16 GetWindowCount() const;
111
112 bool IsPinned() const { return bPinned; }
113 bool IsFadeIn() const;
114 bool IsAutoHide( bool bSelf ) const;
116
117 virtual void FadeOut() override;
118 virtual void FadeIn() override;
120};
121
122#endif // INCLUDED_SFX2_SOURCE_INC_SPLITWIN_HXX
123
124
125/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxChildAlignment
Definition: chalign.hxx:27
std::vector< std::unique_ptr< SfxDock_Impl > > maDockArr
Definition: splitwin.hxx:49
VclPtr< SfxEmptySplitWin_Impl > pEmptyWin
Definition: splitwin.hxx:51
bool CursorIsOverRect() const
Definition: splitwin.cxx:973
sal_uInt16 GetWindowCount() const
Definition: splitwin.cxx:892
VclPtr< SfxDockingWindow > pActive
Definition: splitwin.hxx:52
sal_uInt16 GetLineCount() const
Definition: splitwin.cxx:857
void InsertWindow_Impl(SfxDock_Impl const *pDockWin, const Size &rSize, sal_uInt16 nLine, sal_uInt16 nPos, bool bNewLine)
Definition: splitwin.cxx:629
SplitWindow * GetSplitWindow()
Definition: splitwin.cxx:1002
SfxChildAlignment eAlign
Definition: splitwin.hxx:46
void InsertWindow(SfxDockingWindow *pDockWin, const Size &rSize)
Definition: splitwin.cxx:423
virtual void dispose() override
Definition: splitwin.cxx:281
void SetActiveWindow_Impl(SfxDockingWindow *pWin)
Definition: splitwin.cxx:1147
bool GetWindowPos(const SfxDockingWindow *pWindow, sal_uInt16 &rLine, sal_uInt16 &rPos) const
Definition: splitwin.cxx:818
bool IsAutoHide(bool bSelf) const
Definition: splitwin.cxx:1015
SfxSplitWindow(vcl::Window *pParent, SfxChildAlignment eAl, SfxWorkWindow *pW, bool bWithButtons)
Definition: splitwin.cxx:171
virtual ~SfxSplitWindow() override
Definition: splitwin.cxx:276
virtual void Split() override
Definition: splitwin.cxx:372
void MoveWindow(SfxDockingWindow *pDockWin, const Size &rSize, sal_uInt16 nLine, sal_uInt16 nPos, bool bNewLine)
Definition: splitwin.cxx:537
void FadeOut_Impl()
Definition: splitwin.cxx:1125
SfxWorkWindow * pWorkWin
Definition: splitwin.hxx:47
void ReleaseWindow_Impl(SfxDockingWindow const *pWin, bool bSaveConfig=true)
Definition: splitwin.cxx:514
void SetPinned_Impl(bool)
Definition: splitwin.cxx:1021
void Lock(bool bLock=true)
Definition: splitwin.hxx:98
virtual void FadeOut() override
Definition: splitwin.cxx:1136
bool IsFadeIn() const
Definition: splitwin.cxx:1010
tools::Long GetLineSize(sal_uInt16) const
Definition: splitwin.cxx:868
void SaveConfig_Impl()
Definition: splitwin.cxx:298
virtual void MouseButtonDown(const MouseEvent &) override
Definition: splitwin.cxx:165
void SetFadeIn_Impl(bool)
Definition: splitwin.cxx:1071
void RemoveWindow(SfxDockingWindow const *pDockWin, bool bHide=true)
Definition: splitwin.cxx:760
virtual void StartSplit() override
Definition: splitwin.cxx:332
DECL_LINK(TimerHdl, Timer *, void)
virtual void FadeIn() override
Definition: splitwin.cxx:1142
bool IsPinned() const
Definition: splitwin.hxx:112
virtual void SplitResize() override
Definition: splitwin.cxx:360
void SetUpdateMode(bool bUpdate)
sal_uInt16 nPos
Definition: linksrc.cxx:118
long Long
bool bNewLine
Definition: splitwin.hxx:37
sal_uInt16 nType
Definition: splitwin.hxx:35
VclPtr< SfxDockingWindow > pWin
Definition: splitwin.hxx:36