nss: upgrade to release 3.73
[LibreOffice.git] / include / svx / fillctrl.hxx
blob7155d261a0903c868a53a2d2e21cb7b3955e213e
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 .
20 #ifndef INCLUDED_SVX_FILLCTRL_HXX
21 #define INCLUDED_SVX_FILLCTRL_HXX
23 #include <memory>
24 #include <vcl/InterimItemWindow.hxx>
25 #include <sfx2/tbxctrl.hxx>
26 #include <sfx2/weldutils.hxx>
27 #include <svx/svxdllapi.h>
28 #include <com/sun/star/drawing/FillStyle.hpp>
30 class XFillStyleItem;
31 class XFillColorItem;
32 class XFillGradientItem;
33 class XFillHatchItem;
34 class XFillBitmapItem;
35 class FillControl;
37 /*************************************************************************
39 |* Class for surface attributes (controls and controller)
41 \************************************************************************/
43 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFillToolBoxControl final : public SfxToolBoxControl
45 private:
46 std::unique_ptr< XFillStyleItem > mpStyleItem;
47 std::unique_ptr< XFillColorItem > mpColorItem;
48 std::unique_ptr< XFillGradientItem > mpFillGradientItem;
49 std::unique_ptr< XFillHatchItem > mpHatchItem;
50 std::unique_ptr< XFillBitmapItem > mpBitmapItem;
52 VclPtr<FillControl> mxFillControl;
53 weld::ComboBox* mpLbFillType;
54 weld::Toolbar* mpToolBoxColor;
55 weld::ComboBox* mpLbFillAttr;
57 css::drawing::FillStyle meLastXFS;
58 sal_Int32 mnLastPosGradient;
59 sal_Int32 mnLastPosHatch;
60 sal_Int32 mnLastPosBitmap;
62 DECL_LINK(SelectFillTypeHdl, weld::ComboBox&, void);
63 DECL_LINK(SelectFillAttrHdl, weld::ComboBox&, void);
65 public:
66 SFX_DECL_TOOLBOX_CONTROL();
68 SvxFillToolBoxControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
69 virtual ~SvxFillToolBoxControl() override;
71 virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState) override;
72 void Update();
73 virtual VclPtr<InterimItemWindow> CreateItemWindow(vcl::Window* pParent) override;
76 class SAL_WARN_UNUSED FillControl final : public InterimItemWindow
78 private:
79 friend class SvxFillToolBoxControl;
81 std::unique_ptr<weld::ComboBox> mxLbFillType;
82 std::unique_ptr<weld::Toolbar> mxToolBoxColor;
83 std::unique_ptr<ToolbarUnoDispatcher> mxColorDispatch;
84 std::unique_ptr<weld::ComboBox> mxLbFillAttr;
85 int mnTypeCurPos;
86 int mnAttrCurPos;
88 DECL_LINK(AttrKeyInputHdl, const KeyEvent&, bool);
89 DECL_LINK(TypeKeyInputHdl, const KeyEvent&, bool);
90 DECL_LINK(ColorKeyInputHdl, const KeyEvent&, bool);
91 DECL_STATIC_LINK(FillControl, DumpAsPropertyTreeHdl, tools::JsonWriter&, void);
92 DECL_LINK(AttrFocusHdl, weld::Widget&, void);
93 DECL_LINK(TypeFocusHdl, weld::Widget&, void);
95 void SetOptimalSize();
97 virtual void DataChanged(const DataChangedEvent& rDCEvt) override;
99 static void ReleaseFocus_Impl();
101 public:
102 FillControl(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rFrame);
103 virtual void dispose() override;
104 virtual ~FillControl() override;
107 #endif // INCLUDED_SVX_FILLCTRL_HXX
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */