Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / sidebar / AlignmentPropertyPanel.hxx
blobecda42376400bcabbd0130ebbf24174a9ab19c3d
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 .
19 #ifndef SC_PROPERTYPANEL_ALIGNMENT_HXX
20 #define SC_PROPERTYPANEL_ALIGNMENT_HXX
22 #include <sfx2/sidebar/ControllerItem.hxx>
23 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
24 #include <svx/sidebar/PanelLayout.hxx>
25 #include <vcl/fixed.hxx>
26 #include <boost/scoped_ptr.hpp>
27 #include <editeng/svxenum.hxx>
29 class ToolBox;
30 class MetricField;
31 class MetricBox;
32 class CheckBox;
33 namespace svx { namespace sidebar { class SidebarDialControl; }}
35 namespace sc { namespace sidebar {
37 class AlignmentPropertyPanel
38 : public PanelLayout,
39 public ::sfx2::sidebar::IContextChangeReceiver,
40 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
42 public:
43 static AlignmentPropertyPanel* Create(
44 Window* pParent,
45 const cssu::Reference<css::frame::XFrame>& rxFrame,
46 SfxBindings* pBindings);
48 virtual void DataChanged(
49 const DataChangedEvent& rEvent);
51 virtual void HandleContextChange(
52 const ::sfx2::sidebar::EnumContext aContext);
54 virtual void NotifyItemUpdate(
55 const sal_uInt16 nSId,
56 const SfxItemState eState,
57 const SfxPoolItem* pState,
58 const bool bIsEnabled);
60 SfxBindings* GetBindings();
62 private:
63 //ui controls
64 ToolBox* mpTBHorizontal;
65 ToolBox* mpTBVertical;
66 FixedText* mpFTLeftIndent;
67 MetricField* mpMFLeftIndent;
68 CheckBox* mpCBXWrapText;
69 CheckBox* mpCBXMergeCell;
70 FixedText* mpFtRotate;
71 svx::sidebar::SidebarDialControl* mpCtrlDial;
72 MetricBox* mpMtrAngle;
73 CheckBox* mpCbStacked;
75 ::sfx2::sidebar::ControllerItem maAlignHorControl;
76 ::sfx2::sidebar::ControllerItem maAlignVerControl;
77 ::sfx2::sidebar::ControllerItem maLeftIndentControl;
78 ::sfx2::sidebar::ControllerItem maMergeCellControl;
79 ::sfx2::sidebar::ControllerItem maWrapTextControl;
80 ::sfx2::sidebar::ControllerItem maAngleControl;
81 ::sfx2::sidebar::ControllerItem maStackControl;
83 SvxCellHorJustify meHorAlignState;
84 SvxCellVerJustify meVerAlignState;
86 /// bitfield
87 bool mbMultiDisable : 1;
89 cssu::Reference<css::frame::XFrame> mxFrame;
90 ::sfx2::sidebar::EnumContext maContext;
91 SfxBindings* mpBindings;
93 DECL_LINK( TbxHorAlignSelectHdl, ToolBox* );
94 DECL_LINK( TbxVerAlignSelectHdl, ToolBox* );
95 DECL_LINK( MFLeftIndentMdyHdl, void * );
96 DECL_LINK( CBOXMergnCellClkHdl, void * );
97 DECL_LINK( CBOXWrapTextClkHdl, void * );
98 DECL_LINK( AngleModifiedHdl, void * );
99 DECL_LINK( RotationHdl, void * );
100 DECL_LINK( ClickStackHdl, void * );
102 // constructor/destuctor
103 AlignmentPropertyPanel(
104 Window* pParent,
105 const cssu::Reference<css::frame::XFrame>& rxFrame,
106 SfxBindings* pBindings);
107 virtual ~AlignmentPropertyPanel();
109 void Initialize();
110 void UpdateHorAlign();
111 void UpdateVerAlign();
112 void FormatDegrees(double& dTmp);
115 } } // end of namespace ::sc::sidebar
117 #endif
118 // eof
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */