25#include <rtl/ustrbuf.hxx>
34#include <splitwin.hxx>
51 class DeactivateUpdateMode
55 : mrSplitWindow( rSplitWindow )
60 mrSplitWindow.SetUpdateMode(
false );
64 ~DeactivateUpdateMode()
68 mrSplitWindow.SetUpdateMode(
true );
74 const bool mbUpdateMode;
105 ,
aTimer(
"sfx2 SfxEmptySplitWin_Impl aTimer")
125 virtual void FadeIn()
override;
132 switch (
pOwner->GetAlign() )
134 case WindowAlign::Left:
135 case WindowAlign::Right:
138 case WindowAlign::Top:
139 case WindowAlign::Bottom:
151 pOwner->SetFadeIn_Impl(
true );
161 pOwner->SaveConfig_Impl();
199 eTbxAlign = WindowAlign::Left;
202 eTbxAlign = WindowAlign::Right;
205 eTbxAlign = WindowAlign::Top;
208 eTbxAlign = WindowAlign::Bottom;
212 eTbxAlign = WindowAlign::Top;
227 const OUString aWindowId{
"SplitWindow" + OUString::number(
static_cast<sal_Int32
>(eTbxAlign)) };
232 if ( aUserItem >>= aTemp )
234 if ( aWinData.startsWith(
"V") )
246 pDock->pWin =
nullptr;
247 pDock->bNewLine =
false;
260 pDock->bNewLine =
true;
301 OUStringBuffer aWinData =
303 + OUString::number(
static_cast<sal_Int32
>(
VERSION))
305 + OUString::number(
static_cast<sal_Int32
>(
pEmptyWin->nState))
311 if ( rDock->bHide || rDock->pWin )
315 aWinData.append(
static_cast<sal_Int32
>(
nCount));
319 if ( !rDock->bHide && !rDock->pWin )
321 if ( rDock->bNewLine )
322 aWinData.append(
",0");
323 aWinData.append(
"," + OUString::number(
static_cast<sal_Int32
>(rDock->nType)));
326 const OUString aWindowId{
"SplitWindow" + OUString::number(
static_cast<sal_Int32
>(
GetAlign())) };
346 case WindowAlign::Left:
347 case WindowAlign::Right:
350 case WindowAlign::Top:
351 case WindowAlign::Bottom:
379 std::vector< std::pair< sal_uInt16, tools::Long > > aNewOrgSizes;
403 rD.
pWin->SetItemSize_Impl( aSize );
405 aNewOrgSizes.emplace_back(
nId, nSize );
412 DeactivateUpdateMode aDeactivateUpdateMode( *
this );
413 for (
const std::pair< sal_uInt16, tools::Long > & rNewOrgSize : aNewOrgSizes)
415 SetItemSize( rNewOrgSize.first, rNewOrgSize.second );
434 bool bNewLine =
true;
435 bool bSaveConfig =
false;
456 if ( bNewLine && !pFoundDock )
460 nLine =
static_cast<short>(nL);
477 DBG_ASSERT( !pFoundDock && !rDock.
pWin,
"Window already exists!");
496 pFoundDock->
bHide =
true;
497 maDockArr.push_back( std::unique_ptr<SfxDock_Impl>(pFoundDock) );
506 pFoundDock->
pWin = pDockWin;
507 pFoundDock->
bHide =
false;
538 sal_uInt16 nLine, sal_uInt16
nPos,
bool bNewLine)
561 sal_uInt16 nLine, sal_uInt16
nPos,
bool bNewLine)
571 pDock->
bHide =
false;
574 pDock->
pWin = pDockWin;
583 sal_uInt16 nLastWindowIdx(0);
586 sal_uInt16 nInsertPos = 0;
598 sal_uInt16 nL=0, nP=0;
601 if ( (nL == nLine && nP ==
nPos) || nL > nLine )
603 DBG_ASSERT( nL == nLine || bNewLine ||
nPos > 0,
"Wrong Parameter!" );
604 if ( nL == nLine &&
nPos == 0 && !bNewLine )
613 nInsertPos =
n != 0 ? nLastWindowIdx + 1 : 0;
620 nInsertPos = nLastWindowIdx + 1;
623 maDockArr.insert(
maDockArr.begin() + nInsertPos, std::unique_ptr<SfxDock_Impl>(pDock));
631 sal_uInt16 nLine, sal_uInt16
nPos,
bool bNewLine)
647 nWinSize = rSize.
Width();
648 nSetSize = rSize.
Height();
652 nSetSize = rSize.
Width();
653 nWinSize = rSize.
Height();
656 std::unique_ptr<DeactivateUpdateMode> pDeactivateUpdateMode(
new DeactivateUpdateMode( *
this ));
673 nBits |= SplitWindowItemFlags::ColSet;
681 nItemBits |= SplitWindowItemFlags::PercentSize;
694 bool bFadeIn = (
pEmptyWin->nState & 2 ) != 0;
698 SAL_INFO(
"sfx",
"SfxSplitWindow::InsertWindow_Impl - registering empty Splitwindow" );
709 bool bFadeIn = (
pEmptyWin->nState & 2 ) != 0;
714 SAL_INFO(
"sfx",
"SfxSplitWindow::InsertWindow_Impl - registering empty Splitwindow" );
718 SAL_INFO(
"sfx",
"SfxSplitWindow::InsertWindow_Impl - registering real Splitwindow" );
732 pDeactivateUpdateMode.reset();
737 std::vector< std::pair< sal_uInt16, tools::Long > > aNewOrgSizes;
747 aNewOrgSizes.emplace_back(
nId, nSize );
751 DeactivateUpdateMode aDeactivateUpdateMode( *
this );
752 for (
const std::pair< sal_uInt16, tools::Long > & rNewOrgSize : aNewOrgSizes)
754 SetItemSize( rNewOrgSize.first, rNewOrgSize.second );
777 sal_uInt16 nRealState =
pEmptyWin->nState;
783 SAL_INFO(
"sfx",
"SfxSplitWindow::RemoveWindow - releasing empty Splitwindow" );
787 SAL_INFO(
"sfx",
"SfxSplitWindow::RemoveWindow - releasing real Splitwindow" );
801 rDock.
pWin =
nullptr;
809 DeactivateUpdateMode aDeactivateUpdateMode( *
this );
819 sal_uInt16& rLine, sal_uInt16& rPos )
const
827 sal_uInt16 nSet =
GetSet ( pWindow->GetType() );
831 rPos =
GetItemPos( pWindow->GetType(), nSet );
838 sal_uInt16& rLine, sal_uInt16& rPos )
const
1036 SAL_INFO(
"sfx",
"SfxSplitWindow::SetPinned_Impl - releasing real Splitwindow" );
1040 SAL_INFO(
"sfx",
"SfxSplitWindow::SetPinned_Impl - registering empty Splitwindow" );
1062 SAL_INFO(
"sfx",
"SfxSplitWindow::SetPinned_Impl - releasing empty Splitwindow" );
1065 SAL_INFO(
"sfx",
"SfxSplitWindow::SetPinned_Impl - registering real Splitwindow" );
1091 SAL_INFO(
"sfx",
"SfxSplitWindow::SetFadeIn_Impl - releasing empty Splitwindow" );
1094 SAL_INFO(
"sfx",
"SfxSplitWindow::SetFadeIn_Impl - registering real Splitwindow" );
1107 SAL_INFO(
"sfx",
"SfxSplitWindow::SetFadeIn_Impl - releasing real Splitwindow" );
1111 SAL_INFO(
"sfx",
"SfxSplitWindow::SetFadeIn_Impl - registering empty Splitwindow" );
static bool IsInModalMode()
void SetOutputSizePixel(const Size &rNewSize) override
Point GetPosPixel() const override
bool IsFloatingMode() const
void SetFloatingMode(bool bFloatMode)
Size GetSizePixel() const override
Size GetOutputSizePixel() const
SystemWindow * GetFloatingWindow() const
void SetFloatingPos(const Point &rNewPos)
sal_uInt16 GetClicks() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
sal_uInt16 GetType() const
virtual void FadeIn() override
virtual void dispose() override
VclPtr< SfxSplitWindow > pOwner
virtual ~SfxEmptySplitWin_Impl() override
SfxEmptySplitWin_Impl(SfxSplitWindow *pParent)
std::vector< std::unique_ptr< SfxDock_Impl > > maDockArr
VclPtr< SfxEmptySplitWin_Impl > pEmptyWin
bool CursorIsOverRect() const
sal_uInt16 GetWindowCount() const
VclPtr< SfxDockingWindow > pActive
sal_uInt16 GetLineCount() const
void InsertWindow_Impl(SfxDock_Impl const *pDockWin, const Size &rSize, sal_uInt16 nLine, sal_uInt16 nPos, bool bNewLine)
SplitWindow * GetSplitWindow()
void InsertWindow(SfxDockingWindow *pDockWin, const Size &rSize)
virtual void dispose() override
void SetActiveWindow_Impl(SfxDockingWindow *pWin)
bool GetWindowPos(const SfxDockingWindow *pWindow, sal_uInt16 &rLine, sal_uInt16 &rPos) const
bool IsAutoHide(bool bSelf) const
SfxSplitWindow(vcl::Window *pParent, SfxChildAlignment eAl, SfxWorkWindow *pW, bool bWithButtons)
virtual ~SfxSplitWindow() override
virtual void Split() override
void MoveWindow(SfxDockingWindow *pDockWin, const Size &rSize, sal_uInt16 nLine, sal_uInt16 nPos, bool bNewLine)
void ReleaseWindow_Impl(SfxDockingWindow const *pWin, bool bSaveConfig=true)
void SetPinned_Impl(bool)
virtual void FadeOut() override
tools::Long GetLineSize(sal_uInt16) const
virtual void MouseButtonDown(const MouseEvent &) override
void SetFadeIn_Impl(bool)
void RemoveWindow(SfxDockingWindow const *pDockWin, bool bHide=true)
virtual void StartSplit() override
virtual void FadeIn() override
virtual void SplitResize() override
void ArrangeChildren_Impl(bool bForce=true)
void SetActiveChild_Impl(vcl::Window *pChild)
void ReleaseChild_Impl(vcl::Window &rWindow)
SfxChild_Impl * RegisterChild_Impl(vcl::Window &rWindow, SfxChildAlignment eAlign)
bool IsAutoHideMode(const SfxSplitWindow *pSplit)
tools::Rectangle GetFreeArea(bool bAutoHide) const
void ArrangeAutoHideWindows(SfxSplitWindow *pSplit)
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
WindowAlign GetAlign() const
sal_uInt16 GetItemPos(sal_uInt16 nId, sal_uInt16 nSetId=0) const
sal_uInt16 GetItemId(vcl::Window *pWindow) const
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
void SetAlign(WindowAlign eNewAlign)
void ShowFadeInHideButton()
tools::Long GetItemSize(sal_uInt16 nId) const
bool IsHorizontal() const
tools::Long GetFadeInSize() const
bool IsFadeNoButtonMode() const
virtual void dispose() override
sal_uInt16 GetItemCount(sal_uInt16 nSetId=0) const
sal_uInt16 GetSet(sal_uInt16 nId) const
void InsertItem(sal_uInt16 nId, vcl::Window *pWindow, tools::Long nSize, sal_uInt16 nPos, sal_uInt16 nIntoSetId, SplitWindowItemFlags nBits)
void RemoveItem(sal_uInt16 nId)
void SetItemSize(sal_uInt16 nId, tools::Long nNewSize)
void SetMaxSizePixel(tools::Long nNewMaxSize)
css::uno::Any GetUserItem(const OUString &sName) const
void SetUserItem(const OUString &sName, const css::uno::Any &aValue)
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
static VclPtr< reference_type > Create(Arg &&... arg)
Point OutputToScreenPixel(const Point &rPos) const
vcl::Window * GetParent() const
bool HasChildPathFocus(bool bSystemWindow=false) const
virtual void SetSizePixel(const Size &rNewSize)
bool IsUpdateMode() const
virtual void SetOutputSizePixel(const Size &rNewSize)
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Point GetPointerPosPixel()
#define DBG_ASSERT(sCon, aError)
#define LINK(Instance, Class, Member)
#define SAL_INFO(area, stream)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
bool IsInPopupMenuExecute()
IMPL_LINK(SfxSplitWindow, TimerHdl, Timer *, pTimer, void)
constexpr OUStringLiteral USERITEM_NAME
#define SPLITWINDOW_ITEM_NOTFOUND
SfxChildVisibility nVisible
VclPtr< SfxDockingWindow > pWin
WinBits const WB_SIZEABLE