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, 62*5cd5f659SOliver-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*5cd5f659SOliver-Rainer Wittmann const SfxPoolItem* pState ); 69ff0525f2SOliver-Rainer Wittmann 70ff0525f2SOliver-Rainer Wittmann // action on 'More Options' button in panel title 71ff0525f2SOliver-Rainer Wittmann void ShowPageStyleFormatDialog( void ); 72ff0525f2SOliver-Rainer Wittmann 73ff0525f2SOliver-Rainer Wittmann SfxBindings* GetBindings() const 74ff0525f2SOliver-Rainer Wittmann { 75ff0525f2SOliver-Rainer Wittmann return mpBindings; 76ff0525f2SOliver-Rainer Wittmann } 77ff0525f2SOliver-Rainer Wittmann 78ff0525f2SOliver-Rainer Wittmann 79ff0525f2SOliver-Rainer Wittmann ::svx::sidebar::PopupControl* CreatePageOrientationControl( ::svx::sidebar::PopupContainer* pParent ); 80ff0525f2SOliver-Rainer Wittmann void ExecuteOrientationChange( const sal_Bool bLandscape ); 81ff0525f2SOliver-Rainer Wittmann void ClosePageOrientationPopup(); 82ff0525f2SOliver-Rainer Wittmann 83ff0525f2SOliver-Rainer Wittmann ::svx::sidebar::PopupControl* CreatePageMarginControl( ::svx::sidebar::PopupContainer* pParent ); 84ff0525f2SOliver-Rainer Wittmann void ExecuteMarginLRChange( 85ff0525f2SOliver-Rainer Wittmann const long nPageLeftMargin, 86ff0525f2SOliver-Rainer Wittmann const long nPageRightMargin ); 87ff0525f2SOliver-Rainer Wittmann void ExecuteMarginULChange( 88ff0525f2SOliver-Rainer Wittmann const long nPageTopMargin, 89ff0525f2SOliver-Rainer Wittmann const long nPageBottomMargin ); 90ff0525f2SOliver-Rainer Wittmann void ExecutePageLayoutChange( const bool bMirrored ); 91ff0525f2SOliver-Rainer Wittmann void ClosePageMarginPopup(); 92ff0525f2SOliver-Rainer Wittmann 93ff0525f2SOliver-Rainer Wittmann ::svx::sidebar::PopupControl* CreatePageSizeControl( ::svx::sidebar::PopupContainer* pParent ); 94ff0525f2SOliver-Rainer Wittmann void ExecuteSizeChange( const Paper ePaper ); 95ff0525f2SOliver-Rainer Wittmann void ClosePageSizePopup(); 96ff0525f2SOliver-Rainer Wittmann 97ff0525f2SOliver-Rainer Wittmann ::svx::sidebar::PopupControl* CreatePageColumnControl( ::svx::sidebar::PopupContainer* pParent ); 98ff0525f2SOliver-Rainer Wittmann void ExecuteColumnChange( const sal_uInt16 nColumnType ); 99ff0525f2SOliver-Rainer Wittmann void ClosePageColumnPopup(); 100ff0525f2SOliver-Rainer Wittmann 101ff0525f2SOliver-Rainer Wittmann private: 102ff0525f2SOliver-Rainer Wittmann PagePropertyPanel( 103ff0525f2SOliver-Rainer Wittmann Window* pParent, 104*5cd5f659SOliver-Rainer Wittmann SfxBindings* pBindings ); 105ff0525f2SOliver-Rainer Wittmann virtual ~PagePropertyPanel(void); 106ff0525f2SOliver-Rainer Wittmann 107ff0525f2SOliver-Rainer Wittmann SfxBindings* mpBindings; 108ff0525f2SOliver-Rainer Wittmann 109ff0525f2SOliver-Rainer Wittmann // toolboxes - on click open corresponding popup 110ff0525f2SOliver-Rainer Wittmann FixedText maFtOrientation; 111ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<Window> mpToolBoxOrientationBackground; 112ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<ToolBox> mpToolBoxOrientation; 113ff0525f2SOliver-Rainer Wittmann FixedText maFtMargin; 114ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<Window> mpToolBoxMarginBackground; 115ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<ToolBox> mpToolBoxMargin; 116ff0525f2SOliver-Rainer Wittmann FixedText maFtSize; 117ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<Window> mpToolBoxSizeBackground; 118ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<ToolBox> mpToolBoxSize; 119ff0525f2SOliver-Rainer Wittmann FixedText maFtColumn; 120ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<Window> mpToolBoxColumnBackground; 121ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<ToolBox> mpToolBoxColumn; 122ff0525f2SOliver-Rainer Wittmann 123ff0525f2SOliver-Rainer Wittmann Image* maImgSize; 124ff0525f2SOliver-Rainer Wittmann Image* maImgSize_L; 125ff0525f2SOliver-Rainer Wittmann Image mImgPortrait; 126ff0525f2SOliver-Rainer Wittmann Image mImgLandscape; 127ff0525f2SOliver-Rainer Wittmann Image mImgNarrow; 128ff0525f2SOliver-Rainer Wittmann Image mImgNormal; 129ff0525f2SOliver-Rainer Wittmann Image mImgWide; 130ff0525f2SOliver-Rainer Wittmann Image mImgMirrored; 131ff0525f2SOliver-Rainer Wittmann Image mImgMarginCustom; 132ff0525f2SOliver-Rainer Wittmann Image mImgNarrow_L; 133ff0525f2SOliver-Rainer Wittmann Image mImgNormal_L; 134ff0525f2SOliver-Rainer Wittmann Image mImgWide_L; 135ff0525f2SOliver-Rainer Wittmann Image mImgMirrored_L; 136ff0525f2SOliver-Rainer Wittmann Image mImgMarginCustom_L; 137ff0525f2SOliver-Rainer Wittmann Image mImgA3; 138ff0525f2SOliver-Rainer Wittmann Image mImgA4; 139ff0525f2SOliver-Rainer Wittmann Image mImgA5; 140ff0525f2SOliver-Rainer Wittmann Image mImgB4; 141ff0525f2SOliver-Rainer Wittmann Image mImgB5; 142ff0525f2SOliver-Rainer Wittmann Image mImgC5; 143ff0525f2SOliver-Rainer Wittmann Image mImgLetter; 144ff0525f2SOliver-Rainer Wittmann Image mImgLegal; 145ff0525f2SOliver-Rainer Wittmann Image mImgSizeNone; 146ff0525f2SOliver-Rainer Wittmann Image mImgA3_L; 147ff0525f2SOliver-Rainer Wittmann Image mImgA4_L; 148ff0525f2SOliver-Rainer Wittmann Image mImgA5_L; 149ff0525f2SOliver-Rainer Wittmann Image mImgB4_L; 150ff0525f2SOliver-Rainer Wittmann Image mImgB5_L; 151ff0525f2SOliver-Rainer Wittmann Image mImgC5_L; 152ff0525f2SOliver-Rainer Wittmann Image mImgLetter_L; 153ff0525f2SOliver-Rainer Wittmann Image mImgLegal_L; 154ff0525f2SOliver-Rainer Wittmann Image mImgSizeNone_L; 155ff0525f2SOliver-Rainer Wittmann Image mImgColumn1; 156ff0525f2SOliver-Rainer Wittmann Image mImgColumn2; 157ff0525f2SOliver-Rainer Wittmann Image mImgColumn3; 158ff0525f2SOliver-Rainer Wittmann Image mImgLeft; 159ff0525f2SOliver-Rainer Wittmann Image mImgRight; 160ff0525f2SOliver-Rainer Wittmann Image mImgColumnNone; 161ff0525f2SOliver-Rainer Wittmann Image mImgColumn1_L; 162ff0525f2SOliver-Rainer Wittmann Image mImgColumn2_L; 163ff0525f2SOliver-Rainer Wittmann Image mImgColumn3_L; 164ff0525f2SOliver-Rainer Wittmann Image mImgLeft_L; 165ff0525f2SOliver-Rainer Wittmann Image mImgRight_L; 166ff0525f2SOliver-Rainer Wittmann Image mImgColumnNone_L; 167ff0525f2SOliver-Rainer Wittmann 168ff0525f2SOliver-Rainer Wittmann // item keeping the following page style attributes: 169ff0525f2SOliver-Rainer Wittmann // - page orientation 170ff0525f2SOliver-Rainer Wittmann // - page usage - only left, only right, both, mirrored 171ff0525f2SOliver-Rainer Wittmann // item also hold the numbering type for the page style which should 172ff0525f2SOliver-Rainer Wittmann // be kept stable. 173ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<SvxPageItem> mpPageItem; 174ff0525f2SOliver-Rainer Wittmann 175ff0525f2SOliver-Rainer Wittmann // item keeping the page style's left and right margins 176ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem; 177ff0525f2SOliver-Rainer Wittmann // item keeping the page style's top and bottom margins 178ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<SvxLongULSpaceItem> mpPageULMarginItem; 179ff0525f2SOliver-Rainer Wittmann 180ff0525f2SOliver-Rainer Wittmann // item keeping the page style's page size 181ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<SvxSizeItem> mpPageSizeItem; 182ff0525f2SOliver-Rainer Wittmann // Paper corresponding to the page style's page size 183ff0525f2SOliver-Rainer Wittmann Paper mePaper; 184ff0525f2SOliver-Rainer Wittmann 185ff0525f2SOliver-Rainer Wittmann // item keeping the page column type 186ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr<SfxInt16Item> mpPageColumnTypeItem; 187ff0525f2SOliver-Rainer Wittmann 188ff0525f2SOliver-Rainer Wittmann FieldUnit meFUnit; 189ff0525f2SOliver-Rainer Wittmann SfxMapUnit meUnit; 190ff0525f2SOliver-Rainer Wittmann 191ff0525f2SOliver-Rainer Wittmann // controller items 192ff0525f2SOliver-Rainer Wittmann ::sfx2::sidebar::ControllerItem m_aSwPagePgULControl; 193ff0525f2SOliver-Rainer Wittmann ::sfx2::sidebar::ControllerItem m_aSwPagePgLRControl; 194ff0525f2SOliver-Rainer Wittmann ::sfx2::sidebar::ControllerItem m_aSwPagePgSizeControl; 195ff0525f2SOliver-Rainer Wittmann ::sfx2::sidebar::ControllerItem m_aSwPagePgControl; 196ff0525f2SOliver-Rainer Wittmann ::sfx2::sidebar::ControllerItem m_aSwPageColControl; 197ff0525f2SOliver-Rainer Wittmann ::sfx2::sidebar::ControllerItem m_aSwPagePgMetricControl; 198ff0525f2SOliver-Rainer Wittmann 199ff0525f2SOliver-Rainer Wittmann // popups 200ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr< ::svx::sidebar::Popup > mpOrientationPopup; 201ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr< ::svx::sidebar::Popup > mpMarginPopup; 202ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr< ::svx::sidebar::Popup > mpSizePopup; 203ff0525f2SOliver-Rainer Wittmann ::boost::scoped_ptr< ::svx::sidebar::Popup > mpColumnPopup; 204ff0525f2SOliver-Rainer Wittmann 2057dc3d34dSOliver-Rainer Wittmann bool mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify; 2067dc3d34dSOliver-Rainer Wittmann 207ff0525f2SOliver-Rainer Wittmann // handler for popup toolboxes to show the popups 208ff0525f2SOliver-Rainer Wittmann DECL_LINK(ClickOrientationHdl, ToolBox* ); 209ff0525f2SOliver-Rainer Wittmann DECL_LINK(ClickMarginHdl, ToolBox* ); 210ff0525f2SOliver-Rainer Wittmann DECL_LINK(ClickSizeHdl, ToolBox* ); 211ff0525f2SOliver-Rainer Wittmann DECL_LINK(ClickColumnHdl, ToolBox* ); 212ff0525f2SOliver-Rainer Wittmann 213ff0525f2SOliver-Rainer Wittmann void Initialize(); 214ff0525f2SOliver-Rainer Wittmann 215ff0525f2SOliver-Rainer Wittmann void MetricState( SfxItemState eState, const SfxPoolItem* pState ); 216ff0525f2SOliver-Rainer Wittmann 217ff0525f2SOliver-Rainer Wittmann // helper to adjust popup toolbox' images 218ff0525f2SOliver-Rainer Wittmann void ChangeMarginImage(); 219ff0525f2SOliver-Rainer Wittmann void ChangeSizeImage(); 220ff0525f2SOliver-Rainer Wittmann void ChangeColumnImage( const sal_uInt16 nColumnType ); 221ff0525f2SOliver-Rainer Wittmann 222ff0525f2SOliver-Rainer Wittmann }; 223ff0525f2SOliver-Rainer Wittmann 224ff0525f2SOliver-Rainer Wittmann } } // end of namespace ::sw::sidebar 225ff0525f2SOliver-Rainer Wittmann 226ff0525f2SOliver-Rainer Wittmann #endif 227