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_SOURCE_SIDEBAR_PARAGRAPH_PARAPROPERTYPANEL_HXX
20 #define INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARAPROPERTYPANEL_HXX
22 #include <sfx2/sidebar/ControllerItem.hxx>
23 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
24 #include <editeng/lspcitem.hxx>
25 #include <svx/sidebar/PanelLayout.hxx>
26 #include <svx/relfld.hxx>
27 #include <editeng/svxenum.hxx>
29 #include <com/sun/star/frame/XFrame.hpp>
30 #include <com/sun/star/ui/XSidebar.hpp>
32 #include <vcl/vclenum.hxx>
33 #include <svl/poolitem.hxx>
34 #include <tools/fldunit.hxx>
38 namespace svx
{ namespace sidebar
{
40 class ParaPropertyPanel
42 public ::sfx2::sidebar::IContextChangeReceiver
,
43 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
46 virtual ~ParaPropertyPanel();
47 virtual void dispose() SAL_OVERRIDE
;
49 static VclPtr
<vcl::Window
> Create (
51 const css::uno::Reference
<css::frame::XFrame
>& rxFrame
,
52 SfxBindings
* pBindings
,
53 const css::uno::Reference
<css::ui::XSidebar
>& rxSidebar
);
55 virtual void DataChanged (const DataChangedEvent
& rEvent
) SAL_OVERRIDE
;
56 SfxBindings
* GetBindings() { return mpBindings
;}
58 virtual void HandleContextChange (
59 const ::sfx2::sidebar::EnumContext
& rContext
) SAL_OVERRIDE
;
61 virtual void NotifyItemUpdate(
62 const sal_uInt16 nSId
,
63 const SfxItemState eState
,
64 const SfxPoolItem
* pState
,
65 const bool bIsEnabled
) SAL_OVERRIDE
;
67 static FieldUnit
GetCurrentUnit( SfxItemState eState
, const SfxPoolItem
* pState
);
71 const css::uno::Reference
<css::frame::XFrame
>& rxFrame
,
72 SfxBindings
* pBindings
,
73 const css::uno::Reference
<css::ui::XSidebar
>& rxSidebar
);
78 VclPtr
<ToolBox
> mpTBxVertAlign
;
80 VclPtr
<ToolBox
> mpTBxNumBullet
;
81 VclPtr
<ToolBox
> mpTBxOutline
;
82 VclPtr
<ToolBox
> mpTBxBackColor
;
84 VclPtr
<SvxRelativeField
> mpTopDist
;
85 VclPtr
<SvxRelativeField
> mpBottomDist
;
86 VclPtr
<ToolBox
> mpTbxIndent_IncDec
;
87 VclPtr
<SvxRelativeField
> mpLeftIndent
;
88 VclPtr
<SvxRelativeField
> mpRightIndent
;
89 VclPtr
<SvxRelativeField
> mpFLineIndent
;
100 FieldUnit m_eMetricUnit
;
101 FieldUnit m_last_eMetricUnit
;
102 SfxMapUnit m_eLRSpaceUnit
;
103 SfxMapUnit m_eULSpaceUnit
;
105 ::sfx2::sidebar::ControllerItem maLRSpaceControl
;
106 ::sfx2::sidebar::ControllerItem maULSpaceControl
;
107 ::sfx2::sidebar::ControllerItem maDecIndentControl
;
108 ::sfx2::sidebar::ControllerItem maIncIndentControl
;
109 ::sfx2::sidebar::ControllerItem m_aMetricCtl
;
111 css::uno::Reference
<css::frame::XFrame
> mxFrame
;
112 ::sfx2::sidebar::EnumContext maContext
;
113 SfxBindings
* mpBindings
;
114 css::uno::Reference
<css::ui::XSidebar
> mxSidebar
;
116 DECL_LINK(ModifyIndentHdl_Impl
, void*);
117 DECL_LINK_TYPED(ClickIndent_IncDec_Hdl_Impl
, ToolBox
*, void);
118 DECL_LINK(ULSpaceHdl_Impl
, void*);
120 void StateChangedIndentImpl( sal_uInt16 nSID
, SfxItemState eState
, const SfxPoolItem
* pState
);
121 void StateChangedULImpl( sal_uInt16 nSID
, SfxItemState eState
, const SfxPoolItem
* pState
);
122 void StateChangeIncDecImpl( sal_uInt16 nSID
, SfxItemState eState
, const SfxPoolItem
* pState
);
125 void ReSize(bool bSize
);
126 void InitToolBoxIndent();
127 void InitToolBoxSpacing();
130 } } // end of namespace svx::sidebar
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */