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_LINECTRL_HXX
20 #define INCLUDED_SVX_LINECTRL_HXX
22 #include <sfx2/tbxctrl.hxx>
23 #include <svtools/popupwindowcontroller.hxx>
24 #include <svx/svxdllapi.h>
28 class ToolboxButtonLineStyleUpdater
;
34 typedef std::function
<bool(const OUString
&, const css::uno::Any
&)> LineStyleSelectFunction
;
35 typedef std::function
<void(bool)> LineStyleIsNoneFunction
;
37 // SvxLineStyleController:
38 class SVXCORE_DLLPUBLIC SvxLineStyleToolBoxControl final
: public svt::PopupWindowController
41 std::unique_ptr
<svx::ToolboxButtonLineStyleUpdater
> m_xBtnUpdater
;
43 LineStyleSelectFunction m_aLineStyleSelectFunction
;
44 LineStyleIsNoneFunction m_aLineStyleIsNoneFunction
;
47 SvxLineStyleToolBoxControl( const css::uno::Reference
<css::uno::XComponentContext
>& rContext
);
50 virtual void SAL_CALL
initialize( const css::uno::Sequence
<css::uno::Any
>& rArguments
) override
;
53 virtual OUString SAL_CALL
getImplementationName() override
;
54 virtual css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
56 virtual void SAL_CALL
execute(sal_Int16 nKeyModifier
) override
;
57 virtual void SAL_CALL
statusChanged(const css::frame::FeatureStateEvent
& rEvent
) override
;
59 virtual ~SvxLineStyleToolBoxControl() override
;
61 // called when the user selects a line style
62 void setLineStyleSelectFunction(const LineStyleSelectFunction
& aLineStyleSelectFunction
);
63 // called when the line style changes, can be used to trigger disabling the arrows if the none line style is selected
64 void setLineStyleIsNoneFunction(const LineStyleIsNoneFunction
& aLineStyleIsNoneFunction
);
65 void dispatchLineStyleCommand(const OUString
& rCommand
, const css::uno::Sequence
<css::beans::PropertyValue
>& rArgs
);
68 virtual std::unique_ptr
<WeldToolbarPopup
> weldPopupWindow() override
;
69 virtual VclPtr
<vcl::Window
> createVclPopupWindow( vcl::Window
* pParent
) override
;
73 // SvxLineWidthController:
75 class SVX_DLLPUBLIC SvxLineWidthToolBoxControl final
: public SfxToolBoxControl
77 static MapUnit
GetCoreMetric();
80 SFX_DECL_TOOLBOX_CONTROL();
82 SvxLineWidthToolBoxControl( sal_uInt16 nSlotId
, ToolBoxItemId nId
, ToolBox
& rTbx
);
83 virtual ~SvxLineWidthToolBoxControl() override
;
85 virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID
, SfxItemState eState
,
86 const SfxPoolItem
* pState
) override
;
87 virtual VclPtr
<InterimItemWindow
> CreateItemWindow( vcl::Window
*pParent
) override
;
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */