1ff0525f2SOliver-Rainer Wittmann /**************************************************************
2ff0525f2SOliver-Rainer Wittmann *
3ff0525f2SOliver-Rainer Wittmann * Licensed to the Apache Software Foundation (ASF) under one
4ff0525f2SOliver-Rainer Wittmann * or more contributor license agreements.  See the NOTICE file
5ff0525f2SOliver-Rainer Wittmann * distributed with this work for additional information
6ff0525f2SOliver-Rainer Wittmann * regarding copyright ownership.  The ASF licenses this file
7ff0525f2SOliver-Rainer Wittmann * to you under the Apache License, Version 2.0 (the
8ff0525f2SOliver-Rainer Wittmann * "License"); you may not use this file except in compliance
9ff0525f2SOliver-Rainer Wittmann * with the License.  You may obtain a copy of the License at
10ff0525f2SOliver-Rainer Wittmann *
11ff0525f2SOliver-Rainer Wittmann *   http://www.apache.org/licenses/LICENSE-2.0
12ff0525f2SOliver-Rainer Wittmann *
13ff0525f2SOliver-Rainer Wittmann * Unless required by applicable law or agreed to in writing,
14ff0525f2SOliver-Rainer Wittmann * software distributed under the License is distributed on an
15ff0525f2SOliver-Rainer Wittmann * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16ff0525f2SOliver-Rainer Wittmann * KIND, either express or implied.  See the License for the
17ff0525f2SOliver-Rainer Wittmann * specific language governing permissions and limitations
18ff0525f2SOliver-Rainer Wittmann * under the License.
19ff0525f2SOliver-Rainer Wittmann *
20ff0525f2SOliver-Rainer Wittmann *************************************************************/
21ff0525f2SOliver-Rainer Wittmann 
22ff0525f2SOliver-Rainer Wittmann #ifndef SW_SIDEBAR_PAGE_PROPERTY_PANEL_HXX
23ff0525f2SOliver-Rainer Wittmann #define SW_SIDEBAR_PAGE_PROPERTY_PANEL_HXX
24ff0525f2SOliver-Rainer Wittmann 
25ff0525f2SOliver-Rainer Wittmann #include <svx/sidebar/Popup.hxx>
26ff0525f2SOliver-Rainer Wittmann 
27ff0525f2SOliver-Rainer Wittmann #include <sfx2/sidebar/ControllerItem.hxx>
28ff0525f2SOliver-Rainer Wittmann 
29ff0525f2SOliver-Rainer Wittmann namespace svx { namespace sidebar {
30ff0525f2SOliver-Rainer Wittmann     class PopupControl;
31ff0525f2SOliver-Rainer Wittmann } }
32ff0525f2SOliver-Rainer Wittmann 
33ff0525f2SOliver-Rainer Wittmann #include <i18npool/paper.hxx>
34ff0525f2SOliver-Rainer Wittmann 
35ff0525f2SOliver-Rainer Wittmann #include <svx/pageitem.hxx>
36f120fe41SAndre Fischer #include <svx/rulritem.hxx>
37ff0525f2SOliver-Rainer Wittmann #include <editeng/sizeitem.hxx>
38ff0525f2SOliver-Rainer Wittmann 
39ff0525f2SOliver-Rainer Wittmann #include <vcl/ctrl.hxx>
40ff0525f2SOliver-Rainer Wittmann #include <vcl/fixed.hxx>
41ff0525f2SOliver-Rainer Wittmann #include <vcl/button.hxx>
42ff0525f2SOliver-Rainer Wittmann #include <vcl/toolbox.hxx>
43ff0525f2SOliver-Rainer Wittmann #include <vcl/lstbox.hxx>
44ff0525f2SOliver-Rainer Wittmann #include <vcl/field.hxx>
45f120fe41SAndre Fischer #include <svl/intitem.hxx>
46ff0525f2SOliver-Rainer Wittmann 
47ff0525f2SOliver-Rainer Wittmann #include <boost/scoped_ptr.hpp>
48ff0525f2SOliver-Rainer Wittmann 
49ff0525f2SOliver-Rainer Wittmann 
50f120fe41SAndre Fischer namespace css = ::com::sun::star;
51f120fe41SAndre Fischer namespace cssu = ::com::sun::star::uno;
52f120fe41SAndre Fischer 
53ff0525f2SOliver-Rainer Wittmann namespace sw { namespace sidebar {
54ff0525f2SOliver-Rainer Wittmann 
55ff0525f2SOliver-Rainer Wittmann     class PagePropertyPanel
56ff0525f2SOliver-Rainer Wittmann         : public Control,
57ff0525f2SOliver-Rainer Wittmann           public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
58ff0525f2SOliver-Rainer Wittmann     {
59ff0525f2SOliver-Rainer Wittmann     public:
60ff0525f2SOliver-Rainer Wittmann         static PagePropertyPanel* Create(
61ff0525f2SOliver-Rainer Wittmann             Window* pParent,
625cd5f659SOliver-Rainer Wittmann             SfxBindings* pBindings );
63ff0525f2SOliver-Rainer Wittmann 
64ff0525f2SOliver-Rainer Wittmann         // interface of ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
65ff0525f2SOliver-Rainer Wittmann         virtual void NotifyItemUpdate(
66ff0525f2SOliver-Rainer Wittmann             const sal_uInt16 nSId,
67ff0525f2SOliver-Rainer Wittmann             const SfxItemState eState,
68*45da7d5eSAndre Fischer             const SfxPoolItem* pState,
69*45da7d5eSAndre Fischer             const bool bIsEnabled);
70ff0525f2SOliver-Rainer Wittmann 
71ff0525f2SOliver-Rainer Wittmann         SfxBindings* GetBindings() const
72ff0525f2SOliver-Rainer Wittmann         {
73ff0525f2SOliver-Rainer Wittmann             return mpBindings;
74ff0525f2SOliver-Rainer Wittmann         }
75ff0525f2SOliver-Rainer Wittmann 
76ff0525f2SOliver-Rainer Wittmann 
77ff0525f2SOliver-Rainer Wittmann         ::svx::sidebar::PopupControl* CreatePageOrientationControl( ::svx::sidebar::PopupContainer* pParent );
78ff0525f2SOliver-Rainer Wittmann         void ExecuteOrientationChange( const sal_Bool bLandscape );
79ff0525f2SOliver-Rainer Wittmann         void ClosePageOrientationPopup();
80ff0525f2SOliver-Rainer Wittmann 
81ff0525f2SOliver-Rainer Wittmann         ::svx::sidebar::PopupControl* CreatePageMarginControl( ::svx::sidebar::PopupContainer* pParent );
82ff0525f2SOliver-Rainer Wittmann         void ExecuteMarginLRChange(
83ff0525f2SOliver-Rainer Wittmann             const long nPageLeftMargin,
84ff0525f2SOliver-Rainer Wittmann             const long nPageRightMargin );
85ff0525f2SOliver-Rainer Wittmann         void ExecuteMarginULChange(
86ff0525f2SOliver-Rainer Wittmann             const long nPageTopMargin,
87ff0525f2SOliver-Rainer Wittmann             const long nPageBottomMargin );
88ff0525f2SOliver-Rainer Wittmann         void ExecutePageLayoutChange( const bool bMirrored );
89ff0525f2SOliver-Rainer Wittmann         void ClosePageMarginPopup();
90ff0525f2SOliver-Rainer Wittmann 
91ff0525f2SOliver-Rainer Wittmann         ::svx::sidebar::PopupControl* CreatePageSizeControl( ::svx::sidebar::PopupContainer* pParent );
92ff0525f2SOliver-Rainer Wittmann         void ExecuteSizeChange( const Paper ePaper );
93ff0525f2SOliver-Rainer Wittmann         void ClosePageSizePopup();
94ff0525f2SOliver-Rainer Wittmann 
95ff0525f2SOliver-Rainer Wittmann         ::svx::sidebar::PopupControl* CreatePageColumnControl( ::svx::sidebar::PopupContainer* pParent );
96ff0525f2SOliver-Rainer Wittmann         void ExecuteColumnChange( const sal_uInt16 nColumnType );
97ff0525f2SOliver-Rainer Wittmann         void ClosePageColumnPopup();
98ff0525f2SOliver-Rainer Wittmann 
99ff0525f2SOliver-Rainer Wittmann     private:
100ff0525f2SOliver-Rainer Wittmann         PagePropertyPanel(
101ff0525f2SOliver-Rainer Wittmann             Window* pParent,
1025cd5f659SOliver-Rainer Wittmann             SfxBindings* pBindings );
103ff0525f2SOliver-Rainer Wittmann         virtual ~PagePropertyPanel(void);
104ff0525f2SOliver-Rainer Wittmann 
105ff0525f2SOliver-Rainer Wittmann         SfxBindings* mpBindings;
106ff0525f2SOliver-Rainer Wittmann 
107ff0525f2SOliver-Rainer Wittmann         // toolboxes - on click open corresponding popup
108ff0525f2SOliver-Rainer Wittmann         FixedText   maFtOrientation;
109ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<Window> mpToolBoxOrientationBackground;
110ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<ToolBox> mpToolBoxOrientation;
111ff0525f2SOliver-Rainer Wittmann         FixedText				maFtMargin;
112ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<Window> mpToolBoxMarginBackground;
113ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<ToolBox> mpToolBoxMargin;
114ff0525f2SOliver-Rainer Wittmann         FixedText				maFtSize;
115ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<Window> mpToolBoxSizeBackground;
116ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<ToolBox> mpToolBoxSize;
117ff0525f2SOliver-Rainer Wittmann         FixedText				maFtColumn;
118ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<Window> mpToolBoxColumnBackground;
119ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<ToolBox> mpToolBoxColumn;
120ff0525f2SOliver-Rainer Wittmann 
121ff0525f2SOliver-Rainer Wittmann         Image*					maImgSize;
122ff0525f2SOliver-Rainer Wittmann         Image*					maImgSize_L;
123ff0525f2SOliver-Rainer Wittmann         Image					mImgPortrait;
124ff0525f2SOliver-Rainer Wittmann         Image					mImgLandscape;
125ff0525f2SOliver-Rainer Wittmann         Image					mImgNarrow;
126ff0525f2SOliver-Rainer Wittmann         Image					mImgNormal;
127ff0525f2SOliver-Rainer Wittmann         Image					mImgWide;
128ff0525f2SOliver-Rainer Wittmann         Image					mImgMirrored;
129ff0525f2SOliver-Rainer Wittmann         Image					mImgMarginCustom;
130ff0525f2SOliver-Rainer Wittmann         Image					mImgNarrow_L;
131ff0525f2SOliver-Rainer Wittmann         Image					mImgNormal_L;
132ff0525f2SOliver-Rainer Wittmann         Image					mImgWide_L;
133ff0525f2SOliver-Rainer Wittmann         Image					mImgMirrored_L;
134ff0525f2SOliver-Rainer Wittmann         Image					mImgMarginCustom_L;
135ff0525f2SOliver-Rainer Wittmann         Image					mImgA3;
136ff0525f2SOliver-Rainer Wittmann         Image					mImgA4;
137ff0525f2SOliver-Rainer Wittmann         Image					mImgA5;
138ff0525f2SOliver-Rainer Wittmann         Image					mImgB4;
139ff0525f2SOliver-Rainer Wittmann         Image					mImgB5;
140ff0525f2SOliver-Rainer Wittmann         Image					mImgC5;
141ff0525f2SOliver-Rainer Wittmann         Image					mImgLetter;
142ff0525f2SOliver-Rainer Wittmann         Image					mImgLegal;
143ff0525f2SOliver-Rainer Wittmann         Image					mImgSizeNone;
144ff0525f2SOliver-Rainer Wittmann         Image					mImgA3_L;
145ff0525f2SOliver-Rainer Wittmann         Image					mImgA4_L;
146ff0525f2SOliver-Rainer Wittmann         Image					mImgA5_L;
147ff0525f2SOliver-Rainer Wittmann         Image					mImgB4_L;
148ff0525f2SOliver-Rainer Wittmann         Image					mImgB5_L;
149ff0525f2SOliver-Rainer Wittmann         Image					mImgC5_L;
150ff0525f2SOliver-Rainer Wittmann         Image					mImgLetter_L;
151ff0525f2SOliver-Rainer Wittmann         Image					mImgLegal_L;
152ff0525f2SOliver-Rainer Wittmann         Image					mImgSizeNone_L;
153ff0525f2SOliver-Rainer Wittmann         Image					mImgColumn1;
154ff0525f2SOliver-Rainer Wittmann         Image					mImgColumn2;
155ff0525f2SOliver-Rainer Wittmann         Image					mImgColumn3;
156ff0525f2SOliver-Rainer Wittmann         Image					mImgLeft;
157ff0525f2SOliver-Rainer Wittmann         Image					mImgRight;
158ff0525f2SOliver-Rainer Wittmann         Image					mImgColumnNone;
159ff0525f2SOliver-Rainer Wittmann         Image					mImgColumn1_L;
160ff0525f2SOliver-Rainer Wittmann         Image					mImgColumn2_L;
161ff0525f2SOliver-Rainer Wittmann         Image					mImgColumn3_L;
162ff0525f2SOliver-Rainer Wittmann         Image					mImgLeft_L;
163ff0525f2SOliver-Rainer Wittmann         Image					mImgRight_L;
164ff0525f2SOliver-Rainer Wittmann         Image					mImgColumnNone_L;
165ff0525f2SOliver-Rainer Wittmann 
166ff0525f2SOliver-Rainer Wittmann         // item keeping the following page style attributes:
167ff0525f2SOliver-Rainer Wittmann         // - page orientation
168ff0525f2SOliver-Rainer Wittmann         // - page usage - only left, only right, both, mirrored
169ff0525f2SOliver-Rainer Wittmann         // item also hold the numbering type for the page style which should
170ff0525f2SOliver-Rainer Wittmann         // be kept stable.
171ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<SvxPageItem> mpPageItem;
172ff0525f2SOliver-Rainer Wittmann 
173ff0525f2SOliver-Rainer Wittmann         // item keeping the page style's left and right margins
174ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem;
175ff0525f2SOliver-Rainer Wittmann         // item keeping the page style's top and bottom margins
176ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<SvxLongULSpaceItem> mpPageULMarginItem;
177ff0525f2SOliver-Rainer Wittmann 
178ff0525f2SOliver-Rainer Wittmann         // item keeping the page style's page size
179ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<SvxSizeItem> mpPageSizeItem;
180ff0525f2SOliver-Rainer Wittmann         // Paper corresponding to the page style's page size
181ff0525f2SOliver-Rainer Wittmann         Paper mePaper;
182ff0525f2SOliver-Rainer Wittmann 
183ff0525f2SOliver-Rainer Wittmann         // item keeping the page column type
184ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr<SfxInt16Item> mpPageColumnTypeItem;
185ff0525f2SOliver-Rainer Wittmann 
186ff0525f2SOliver-Rainer Wittmann         FieldUnit 			meFUnit;
187ff0525f2SOliver-Rainer Wittmann         SfxMapUnit			meUnit;
188ff0525f2SOliver-Rainer Wittmann 
189ff0525f2SOliver-Rainer Wittmann         // controller items
190ff0525f2SOliver-Rainer Wittmann         ::sfx2::sidebar::ControllerItem m_aSwPagePgULControl;
191ff0525f2SOliver-Rainer Wittmann         ::sfx2::sidebar::ControllerItem m_aSwPagePgLRControl;
192ff0525f2SOliver-Rainer Wittmann         ::sfx2::sidebar::ControllerItem m_aSwPagePgSizeControl;
193ff0525f2SOliver-Rainer Wittmann         ::sfx2::sidebar::ControllerItem m_aSwPagePgControl;
194ff0525f2SOliver-Rainer Wittmann         ::sfx2::sidebar::ControllerItem m_aSwPageColControl;
195ff0525f2SOliver-Rainer Wittmann         ::sfx2::sidebar::ControllerItem m_aSwPagePgMetricControl;
196ff0525f2SOliver-Rainer Wittmann 
197ff0525f2SOliver-Rainer Wittmann         // popups
198ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr< ::svx::sidebar::Popup > mpOrientationPopup;
199ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr< ::svx::sidebar::Popup > mpMarginPopup;
200ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr< ::svx::sidebar::Popup > mpSizePopup;
201ff0525f2SOliver-Rainer Wittmann         ::boost::scoped_ptr< ::svx::sidebar::Popup > mpColumnPopup;
202ff0525f2SOliver-Rainer Wittmann 
2037dc3d34dSOliver-Rainer Wittmann         bool mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify;
2047dc3d34dSOliver-Rainer Wittmann 
205ff0525f2SOliver-Rainer Wittmann         // handler for popup toolboxes to show the popups
206ff0525f2SOliver-Rainer Wittmann         DECL_LINK(ClickOrientationHdl, ToolBox* );
207ff0525f2SOliver-Rainer Wittmann         DECL_LINK(ClickMarginHdl, ToolBox* );
208ff0525f2SOliver-Rainer Wittmann         DECL_LINK(ClickSizeHdl, ToolBox* );
209ff0525f2SOliver-Rainer Wittmann         DECL_LINK(ClickColumnHdl, ToolBox* );
210ff0525f2SOliver-Rainer Wittmann 
211ff0525f2SOliver-Rainer Wittmann         void Initialize();
212ff0525f2SOliver-Rainer Wittmann 
213ff0525f2SOliver-Rainer Wittmann         void MetricState( SfxItemState eState, const SfxPoolItem* pState );
214ff0525f2SOliver-Rainer Wittmann 
215ff0525f2SOliver-Rainer Wittmann         // helper to adjust popup toolbox' images
216ff0525f2SOliver-Rainer Wittmann         void ChangeMarginImage();
217ff0525f2SOliver-Rainer Wittmann         void ChangeSizeImage();
218ff0525f2SOliver-Rainer Wittmann         void ChangeColumnImage( const sal_uInt16 nColumnType );
219ff0525f2SOliver-Rainer Wittmann 
220ff0525f2SOliver-Rainer Wittmann     };
221ff0525f2SOliver-Rainer Wittmann 
222ff0525f2SOliver-Rainer Wittmann } } // end of namespace ::sw::sidebar
223ff0525f2SOliver-Rainer Wittmann 
224ff0525f2SOliver-Rainer Wittmann #endif
225