Line data Source code
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_SOURCE_SIDEBAR_PARAGRAPH_PARAPROPERTYPANEL_HXX
20 : #define INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARAPROPERTYPANEL_HXX
21 :
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>
28 :
29 : #include <com/sun/star/frame/XFrame.hpp>
30 : #include <com/sun/star/ui/XSidebar.hpp>
31 :
32 : #include <vcl/vclenum.hxx>
33 : #include <svl/poolitem.hxx>
34 : #include <tools/fldunit.hxx>
35 :
36 : class ToolBox;
37 :
38 : namespace svx { namespace sidebar {
39 :
40 : class ParaPropertyPanel
41 : : public PanelLayout,
42 : public ::sfx2::sidebar::IContextChangeReceiver,
43 : public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
44 : {
45 : public:
46 : virtual ~ParaPropertyPanel();
47 : virtual void dispose() SAL_OVERRIDE;
48 :
49 : static VclPtr<vcl::Window> Create (
50 : vcl::Window* pParent,
51 : const css::uno::Reference<css::frame::XFrame>& rxFrame,
52 : SfxBindings* pBindings,
53 : const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
54 :
55 : virtual void DataChanged (const DataChangedEvent& rEvent) SAL_OVERRIDE;
56 0 : SfxBindings* GetBindings() { return mpBindings;}
57 :
58 : virtual void HandleContextChange (
59 : const ::sfx2::sidebar::EnumContext& rContext) SAL_OVERRIDE;
60 :
61 : virtual void NotifyItemUpdate(
62 : const sal_uInt16 nSId,
63 : const SfxItemState eState,
64 : const SfxPoolItem* pState,
65 : const bool bIsEnabled) SAL_OVERRIDE;
66 :
67 : static FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
68 :
69 : ParaPropertyPanel (
70 : vcl::Window* pParent,
71 : const css::uno::Reference<css::frame::XFrame>& rxFrame,
72 : SfxBindings* pBindings,
73 : const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
74 :
75 : private:
76 : // UI controls
77 : //Alignment
78 : VclPtr<ToolBox> mpTBxVertAlign;
79 : //NumBullet&Backcolor
80 : VclPtr<ToolBox> mpTBxNumBullet;
81 : VclPtr<ToolBox> mpTBxOutline;
82 : VclPtr<ToolBox> mpTBxBackColor;
83 : //Paragraph spacing
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;
90 :
91 : // Resources
92 : Image maSpace3;
93 : Image maIndHang;
94 :
95 : // Data Member
96 : long maTxtLeft;
97 : long maUpper;
98 : long maLower;
99 :
100 : FieldUnit m_eMetricUnit;
101 : FieldUnit m_last_eMetricUnit;
102 : SfxMapUnit m_eLRSpaceUnit;
103 : SfxMapUnit m_eULSpaceUnit;
104 : // Control Items
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;
110 :
111 : css::uno::Reference<css::frame::XFrame> mxFrame;
112 : ::sfx2::sidebar::EnumContext maContext;
113 : SfxBindings* mpBindings;
114 : css::uno::Reference<css::ui::XSidebar> mxSidebar;
115 :
116 : DECL_LINK(ModifyIndentHdl_Impl, void*);
117 : DECL_LINK_TYPED(ClickIndent_IncDec_Hdl_Impl, ToolBox*, void);
118 : DECL_LINK(ULSpaceHdl_Impl, void*);
119 :
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 );
123 :
124 : void initial();
125 : void ReSize(bool bSize);
126 : void InitToolBoxIndent();
127 : void InitToolBoxSpacing();
128 : };
129 :
130 : } } // end of namespace svx::sidebar
131 :
132 : #endif
133 :
134 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|