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