1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
; }
43 /*************************************************************************
45 |* SvxColorValueSet_docking
47 \************************************************************************/
49 class SAL_WARN_UNUSED SvxColorValueSet_docking
: public SvxColorValueSet
, public DragSourceHelper
52 using SvxColorValueSet::StartDrag
;
62 virtual void MouseButtonDown( const MouseEvent
& rMEvt
) override
;
63 virtual void MouseButtonUp( const MouseEvent
& rMEvt
) override
;
66 virtual void StartDrag( sal_Int8 nAction
, const Point
& rPtPixel
) override
;
68 DECL_LINK(ExecDragHdl
, void*, void);
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
;
87 XColorListRef pColorList
;
88 VclPtr
<SvxColorValueSet_docking
> aColorSet
;
90 sal_uInt16 nRightSlot
;
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
104 virtual void GetFocus() override
;
107 virtual bool Close() override
;
108 virtual void Resize() override
;
109 virtual void Resizing( Size
& rSize
) override
;
112 SvxColorDockingWindow(SfxBindings
* pBindings
,
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
;
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */