Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / svx / colrctrl.hxx
blob752bdd1065aafaeed62107b9c52a7f5d4555116b
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 .
19 #ifndef INCLUDED_SVX_COLRCTRL_HXX
20 #define INCLUDED_SVX_COLRCTRL_HXX
22 #include <sal/types.h>
23 #include <sfx2/dockwin.hxx>
24 #include <svl/lstner.hxx>
25 #include <svtools/transfer.hxx>
26 #include <svtools/valueset.hxx>
27 #include <svx/SvxColorValueSet.hxx>
28 #include <svx/xtable.hxx>
29 #include <tools/gen.hxx>
30 #include <tools/link.hxx>
31 #include <tools/wintypes.hxx>
32 #include <vcl/event.hxx>
33 #include <vcl/vclptr.hxx>
35 namespace vcl { class Window; }
37 class CommandEvent;
38 class SfxBindings;
39 class SfxBroadcaster;
40 class SfxChildWindow;
41 class SfxHint;
43 /*************************************************************************
45 |* SvxColorValueSet_docking
47 \************************************************************************/
49 class SAL_WARN_UNUSED SvxColorValueSet_docking : public SvxColorValueSet, public DragSourceHelper
51 private:
52 using SvxColorValueSet::StartDrag;
54 bool mbLeftButton;
55 Point aDragPosPixel;
57 protected:
59 void DoDrag();
61 // ValueSet
62 virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
63 virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
65 // DragSourceHelper
66 virtual void StartDrag( sal_Int8 nAction, const Point& rPtPixel ) override;
68 DECL_LINK(ExecDragHdl, void*, void);
70 public:
71 SvxColorValueSet_docking( vcl::Window* pParent );
73 bool IsLeftButton() const { return mbLeftButton; }
76 /*************************************************************************
78 |* SvxColorDockingWindow
80 \************************************************************************/
82 class SAL_WARN_UNUSED SvxColorDockingWindow : public SfxDockingWindow, public SfxListener
84 friend class SvxColorChildWindow;
86 private:
87 XColorListRef pColorList;
88 VclPtr<SvxColorValueSet_docking> aColorSet;
89 sal_uInt16 nLeftSlot;
90 sal_uInt16 nRightSlot;
91 sal_uInt16 nCols;
92 sal_uInt16 nLines;
93 long nCount;
94 Size aItemSize;
96 void FillValueSet();
97 void SetSize();
98 DECL_LINK( SelectHdl, ValueSet*, void );
100 /** This function is called when the window gets the focus. It grabs
101 the focus to the color value set so that it can be controlled with
102 the keyboard.
104 virtual void GetFocus() override;
106 protected:
107 virtual bool Close() override;
108 virtual void Resize() override;
109 virtual void Resizing( Size& rSize ) override;
111 public:
112 SvxColorDockingWindow(SfxBindings* pBindings,
113 SfxChildWindow *pCW,
114 vcl::Window* pParent);
115 virtual ~SvxColorDockingWindow() override;
116 virtual void dispose() override;
118 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
120 virtual bool EventNotify( NotifyEvent& rNEvt ) override;
123 #endif
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */