xref: /AOO41X/main/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx (revision facb16e735f93e448ae83858ca0abe498f906969)
1*facb16e7SArmin Le Grand /**************************************************************
2*facb16e7SArmin Le Grand  *
3*facb16e7SArmin Le Grand  * Licensed to the Apache Software Foundation (ASF) under one
4*facb16e7SArmin Le Grand  * or more contributor license agreements.  See the NOTICE file
5*facb16e7SArmin Le Grand  * distributed with this work for additional information
6*facb16e7SArmin Le Grand  * regarding copyright ownership.  The ASF licenses this file
7*facb16e7SArmin Le Grand  * to you under the Apache License, Version 2.0 (the
8*facb16e7SArmin Le Grand  * "License"); you may not use this file except in compliance
9*facb16e7SArmin Le Grand  * with the License.  You may obtain a copy of the License at
10*facb16e7SArmin Le Grand  *
11*facb16e7SArmin Le Grand  *   http://www.apache.org/licenses/LICENSE-2.0
12*facb16e7SArmin Le Grand  *
13*facb16e7SArmin Le Grand  * Unless required by applicable law or agreed to in writing,
14*facb16e7SArmin Le Grand  * software distributed under the License is distributed on an
15*facb16e7SArmin Le Grand  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*facb16e7SArmin Le Grand  * KIND, either express or implied.  See the License for the
17*facb16e7SArmin Le Grand  * specific language governing permissions and limitations
18*facb16e7SArmin Le Grand  * under the License.
19*facb16e7SArmin Le Grand  *
20*facb16e7SArmin Le Grand  *************************************************************/
21*facb16e7SArmin Le Grand 
22*facb16e7SArmin Le Grand #ifndef SC_PROPERTYPANEL_ALIGNMENT_HXX
23*facb16e7SArmin Le Grand #define SC_PROPERTYPANEL_ALIGNMENT_HXX
24*facb16e7SArmin Le Grand 
25*facb16e7SArmin Le Grand #include <sfx2/sidebar/SidebarPanelBase.hxx>
26*facb16e7SArmin Le Grand #include <sfx2/sidebar/ControllerItem.hxx>
27*facb16e7SArmin Le Grand #include <sfx2/sidebar/IContextChangeReceiver.hxx>
28*facb16e7SArmin Le Grand #include <vcl/fixed.hxx>
29*facb16e7SArmin Le Grand #include <boost/scoped_ptr.hpp>
30*facb16e7SArmin Le Grand #include <editeng/svxenum.hxx>
31*facb16e7SArmin Le Grand 
32*facb16e7SArmin Le Grand class ToolBox;
33*facb16e7SArmin Le Grand class MetricField;
34*facb16e7SArmin Le Grand class MetricBox;
35*facb16e7SArmin Le Grand class CheckBox;
36*facb16e7SArmin Le Grand namespace svx { namespace sidebar { class SidebarDialControl; }}
37*facb16e7SArmin Le Grand 
38*facb16e7SArmin Le Grand namespace sc { namespace sidebar {
39*facb16e7SArmin Le Grand 
40*facb16e7SArmin Le Grand class AlignmentPropertyPanel
41*facb16e7SArmin Le Grand :   public Control,
42*facb16e7SArmin Le Grand     public ::sfx2::sidebar::IContextChangeReceiver,
43*facb16e7SArmin Le Grand     public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
44*facb16e7SArmin Le Grand {
45*facb16e7SArmin Le Grand public:
46*facb16e7SArmin Le Grand     static AlignmentPropertyPanel* Create(
47*facb16e7SArmin Le Grand         Window* pParent,
48*facb16e7SArmin Le Grand         const cssu::Reference<css::frame::XFrame>& rxFrame,
49*facb16e7SArmin Le Grand         SfxBindings* pBindings);
50*facb16e7SArmin Le Grand 
51*facb16e7SArmin Le Grand     virtual void DataChanged(
52*facb16e7SArmin Le Grand         const DataChangedEvent& rEvent);
53*facb16e7SArmin Le Grand 
54*facb16e7SArmin Le Grand     virtual void HandleContextChange(
55*facb16e7SArmin Le Grand         const ::sfx2::sidebar::EnumContext aContext);
56*facb16e7SArmin Le Grand 
57*facb16e7SArmin Le Grand     virtual void NotifyItemUpdate(
58*facb16e7SArmin Le Grand         const sal_uInt16 nSId,
59*facb16e7SArmin Le Grand         const SfxItemState eState,
60*facb16e7SArmin Le Grand         const SfxPoolItem* pState);
61*facb16e7SArmin Le Grand 
62*facb16e7SArmin Le Grand     SfxBindings* GetBindings();
63*facb16e7SArmin Le Grand 
64*facb16e7SArmin Le Grand private:
65*facb16e7SArmin Le Grand     //ui controls
66*facb16e7SArmin Le Grand     ::boost::scoped_ptr< ToolBox >              mpTBHorizontal;
67*facb16e7SArmin Le Grand     ::boost::scoped_ptr< ToolBox >              mpTBVertical;
68*facb16e7SArmin Le Grand     ::boost::scoped_ptr< FixedText >            mpFTLeftIndent;
69*facb16e7SArmin Le Grand     ::boost::scoped_ptr< MetricField >          mpMFLeftIndent;
70*facb16e7SArmin Le Grand     ::boost::scoped_ptr< CheckBox >             mpCBXWrapText;
71*facb16e7SArmin Le Grand     ::boost::scoped_ptr< CheckBox >             mpCBXMergeCell;
72*facb16e7SArmin Le Grand     ::boost::scoped_ptr< FixedText >            mpFtRotate;
73*facb16e7SArmin Le Grand     ::boost::scoped_ptr< svx::sidebar::SidebarDialControl > mpCtrlDial;
74*facb16e7SArmin Le Grand     ::boost::scoped_ptr< MetricBox >            mpMtrAngle;
75*facb16e7SArmin Le Grand     ::boost::scoped_ptr< CheckBox >             mpCbStacked;
76*facb16e7SArmin Le Grand 
77*facb16e7SArmin Le Grand     ::sfx2::sidebar::ControllerItem             maAlignHorControl;
78*facb16e7SArmin Le Grand     ::sfx2::sidebar::ControllerItem             maAlignVerControl;
79*facb16e7SArmin Le Grand     ::sfx2::sidebar::ControllerItem             maLeftIndentControl;
80*facb16e7SArmin Le Grand     ::sfx2::sidebar::ControllerItem             maMergeCellControl;
81*facb16e7SArmin Le Grand     ::sfx2::sidebar::ControllerItem             maWrapTextControl;
82*facb16e7SArmin Le Grand     ::sfx2::sidebar::ControllerItem             maAngleControl;
83*facb16e7SArmin Le Grand     ::sfx2::sidebar::ControllerItem             maStackControl;
84*facb16e7SArmin Le Grand 
85*facb16e7SArmin Le Grand     Image                                       maIMGAlignLeft;
86*facb16e7SArmin Le Grand     Image                                       maIMGAlignCenter;
87*facb16e7SArmin Le Grand     Image                                       maIMGAlignRight;
88*facb16e7SArmin Le Grand     Image                                       maIMGAlignJust;
89*facb16e7SArmin Le Grand     Image                                       maIMGAlignTop;
90*facb16e7SArmin Le Grand     Image                                       maIMGAlignCenterV;
91*facb16e7SArmin Le Grand     Image                                       maIMGAlignBottom;
92*facb16e7SArmin Le Grand 
93*facb16e7SArmin Le Grand     SvxCellHorJustify                           meHorAlignState;
94*facb16e7SArmin Le Grand     SvxCellVerJustify                           meVerAlignState;
95*facb16e7SArmin Le Grand 
96*facb16e7SArmin Le Grand     /// bitfield
97*facb16e7SArmin Le Grand     bool                                        mbMultiDisable : 1;
98*facb16e7SArmin Le Grand 
99*facb16e7SArmin Le Grand     cssu::Reference<css::frame::XFrame>         mxFrame;
100*facb16e7SArmin Le Grand     ::sfx2::sidebar::EnumContext                maContext;
101*facb16e7SArmin Le Grand     SfxBindings*                                mpBindings;
102*facb16e7SArmin Le Grand 
103*facb16e7SArmin Le Grand     DECL_LINK( TbxHorAlignSelectHdl, ToolBox* );
104*facb16e7SArmin Le Grand     DECL_LINK( TbxVerAlignSelectHdl, ToolBox* );
105*facb16e7SArmin Le Grand     DECL_LINK( MFLeftIndentMdyHdl, void * );
106*facb16e7SArmin Le Grand     DECL_LINK( CBOXMergnCellClkHdl, void * );
107*facb16e7SArmin Le Grand     DECL_LINK( CBOXWrapTextClkHdl, void * );
108*facb16e7SArmin Le Grand     DECL_LINK( AngleModifiedHdl, void * );
109*facb16e7SArmin Le Grand     DECL_LINK( RotationHdl, void * );
110*facb16e7SArmin Le Grand     DECL_LINK( ClickStackHdl, void * );
111*facb16e7SArmin Le Grand 
112*facb16e7SArmin Le Grand     // constructor/destuctor
113*facb16e7SArmin Le Grand     AlignmentPropertyPanel(
114*facb16e7SArmin Le Grand         Window* pParent,
115*facb16e7SArmin Le Grand         const cssu::Reference<css::frame::XFrame>& rxFrame,
116*facb16e7SArmin Le Grand         SfxBindings* pBindings);
117*facb16e7SArmin Le Grand     virtual ~AlignmentPropertyPanel();
118*facb16e7SArmin Le Grand 
119*facb16e7SArmin Le Grand     void Initialize();
120*facb16e7SArmin Le Grand     void UpdateHorAlign();
121*facb16e7SArmin Le Grand     void UpdateVerAlign();
122*facb16e7SArmin Le Grand     void FormatDegrees(double& dTmp);
123*facb16e7SArmin Le Grand };
124*facb16e7SArmin Le Grand 
125*facb16e7SArmin Le Grand } } // end of namespace ::sc::sidebar
126*facb16e7SArmin Le Grand 
127*facb16e7SArmin Le Grand #endif
128*facb16e7SArmin Le Grand // eof
129