/src/libreoffice/sw/source/uibase/inc/OutlineContentVisibilityWin.hxx
Line | Count | Source (jump to first uncovered line) |
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 | | #pragma once |
10 | | |
11 | | #include <vcl/InterimItemWindow.hxx> |
12 | | #include "edtwin.hxx" |
13 | | #include "FrameControl.hxx" |
14 | | |
15 | | enum class ButtonSymbol |
16 | | { |
17 | | SHOW, |
18 | | HIDE, |
19 | | NONE |
20 | | }; |
21 | | |
22 | | class SwOutlineContentVisibilityWin final : public InterimItemWindow, public ISwFrameControl |
23 | | { |
24 | | private: |
25 | | std::unique_ptr<weld::Button> m_xShowBtn; |
26 | | std::unique_ptr<weld::Button> m_xHideBtn; |
27 | | |
28 | | VclPtr<SwEditWin> m_pEditWin; |
29 | | const SwFrame* m_pFrame; |
30 | | int m_nDelayAppearing; ///< Before we show the control, wait a few timer ticks to avoid appearing with every mouse over. |
31 | | Timer m_aDelayTimer; |
32 | | bool m_bDestroyed; |
33 | | size_t m_nOutlinePos; |
34 | | |
35 | | public: |
36 | | SwOutlineContentVisibilityWin(SwEditWin* pEditWin, const SwFrame* pFrame); |
37 | 0 | virtual ~SwOutlineContentVisibilityWin() override { disposeOnce(); } |
38 | | virtual void dispose() override; |
39 | | |
40 | | virtual void ShowAll(bool bShow) override; |
41 | | virtual bool Contains(const Point& rDocPt) const override; |
42 | 0 | virtual void SetReadonly(bool /*bReadonly*/) override {} |
43 | 0 | virtual const SwFrame* GetFrame() override { return m_pFrame; } |
44 | 0 | virtual SwEditWin* GetEditWin() override { return m_pEditWin; } |
45 | | |
46 | | void Set(); |
47 | | |
48 | | void SetSymbol(ButtonSymbol eTyle); |
49 | | ButtonSymbol GetSymbol() const; |
50 | | |
51 | | private: |
52 | | DECL_LINK(DelayAppearHandler, Timer*, void); |
53 | | DECL_LINK(MousePressHdl, const MouseEvent&, bool); |
54 | | DECL_LINK(MouseMoveHdl, const MouseEvent&, bool); |
55 | | }; |
56 | | |
57 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |