LibreOffice Module svx (master)  1
linectrl.hxx
Go to the documentation of this file.
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  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_SVX_LINECTRL_HXX
20 #define INCLUDED_SVX_LINECTRL_HXX
21 
22 #include <sfx2/tbxctrl.hxx>
24 #include <svx/svxdllapi.h>
25 #include <memory>
26 
27 namespace svx {
28  class ToolboxButtonLineStyleUpdater;
29 }
30 
31 class XLineStyleItem;
33 
34 typedef std::function<bool(const OUString&, const css::uno::Any&)> LineStyleSelectFunction;
35 typedef std::function<void(bool)> LineStyleIsNoneFunction;
36 
37 // SvxLineStyleController:
39 {
40 private:
41  std::unique_ptr<svx::ToolboxButtonLineStyleUpdater> m_xBtnUpdater;
42 
45 
46 public:
47  SvxLineStyleToolBoxControl( const css::uno::Reference<css::uno::XComponentContext>& rContext );
48 
49  // XInitialization
50  virtual void SAL_CALL initialize( const css::uno::Sequence<css::uno::Any>& rArguments ) override;
51 
52  // XServiceInfo
53  virtual OUString SAL_CALL getImplementationName() override;
54  virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
55 
56  virtual void SAL_CALL execute(sal_Int16 nKeyModifier) override;
57  virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent& rEvent) override;
58 
59  virtual ~SvxLineStyleToolBoxControl() override;
60 
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);
66 
67 private:
68  virtual std::unique_ptr<WeldToolbarPopup> weldPopupWindow() override;
69  virtual VclPtr<vcl::Window> createVclPopupWindow( vcl::Window* pParent ) override;
70 
71 };
72 
73 // SvxLineWidthController:
74 
76 {
77  static MapUnit GetCoreMetric();
78 
79 public:
81 
82  SvxLineWidthToolBoxControl( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx );
83  virtual ~SvxLineWidthToolBoxControl() override;
84 
85  virtual void StateChangedAtToolBoxControl( sal_uInt16 nSID, SfxItemState eState,
86  const SfxPoolItem* pState ) override;
87  virtual VclPtr<InterimItemWindow> CreateItemWindow( vcl::Window *pParent ) override;
88 };
89 
90 #endif
91 
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
LineStyleSelectFunction m_aLineStyleSelectFunction
Definition: linectrl.hxx:43
virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState)
virtual OUString SAL_CALL getImplementationName() override=0
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &Event) override
sal_Int16 nId
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
std::function< void(bool)> LineStyleIsNoneFunction
Definition: linectrl.hxx:35
std::unique_ptr< svx::ToolboxButtonLineStyleUpdater > m_xBtnUpdater
Definition: linectrl.hxx:41
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow()
LineStyleIsNoneFunction m_aLineStyleIsNoneFunction
Definition: linectrl.hxx:44
std::function< bool(const OUString &, const css::uno::Any &)> LineStyleSelectFunction
Definition: linectrl.hxx:32
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent)=0
virtual VclPtr< InterimItemWindow > CreateItemWindow(vcl::Window *pParent)
SfxItemState
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override=0
#define SVXCORE_DLLPUBLIC
Definition: svxdllapi.h:35
MapUnit