1*c45d927aSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*c45d927aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*c45d927aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*c45d927aSAndrew Rist * distributed with this work for additional information 6*c45d927aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*c45d927aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*c45d927aSAndrew Rist * "License"); you may not use this file except in compliance 9*c45d927aSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*c45d927aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*c45d927aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*c45d927aSAndrew Rist * software distributed under the License is distributed on an 15*c45d927aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*c45d927aSAndrew Rist * KIND, either express or implied. See the License for the 17*c45d927aSAndrew Rist * specific language governing permissions and limitations 18*c45d927aSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*c45d927aSAndrew Rist *************************************************************/ 21*c45d927aSAndrew Rist 22*c45d927aSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SD_TABLEDESIGNPANE_HXX 25cdf0e10cSrcweir #define _SD_TABLEDESIGNPANE_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 28cdf0e10cSrcweir #include <com/sun/star/ui/XUIElement.hpp> 29cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawView.hpp> 30cdf0e10cSrcweir #include <com/sun/star/container/XIndexAccess.hpp> 31cdf0e10cSrcweir 32cdf0e10cSrcweir #include <vcl/dialog.hxx> 33cdf0e10cSrcweir #include <vcl/fixed.hxx> 34cdf0e10cSrcweir #include <vcl/button.hxx> 35cdf0e10cSrcweir #include <svtools/valueset.hxx> 36cdf0e10cSrcweir 37cdf0e10cSrcweir #include <boost/scoped_ptr.hpp> 38cdf0e10cSrcweir 39cdf0e10cSrcweir #include "TableDesignPane.hrc" 40cdf0e10cSrcweir 41cdf0e10cSrcweir namespace sd 42cdf0e10cSrcweir { 43cdf0e10cSrcweir 44cdf0e10cSrcweir namespace tools { 45cdf0e10cSrcweir class EventMultiplexerEvent; 46cdf0e10cSrcweir } 47cdf0e10cSrcweir 48cdf0e10cSrcweir class ViewShellBase; 49cdf0e10cSrcweir 50cdf0e10cSrcweir // -------------------------------------------------------------------- 51cdf0e10cSrcweir 52cdf0e10cSrcweir class TableDesignPane : public Control 53cdf0e10cSrcweir { 54cdf0e10cSrcweir public: 55cdf0e10cSrcweir TableDesignPane( ::Window* pParent, ViewShellBase& rBase, bool bModal ); 56cdf0e10cSrcweir virtual ~TableDesignPane(); 57cdf0e10cSrcweir 58cdf0e10cSrcweir // callbacks 59cdf0e10cSrcweir void onSelectionChanged(); 60cdf0e10cSrcweir 61cdf0e10cSrcweir // Control 62cdf0e10cSrcweir virtual void Resize(); 63cdf0e10cSrcweir 64cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt ); 65cdf0e10cSrcweir 66cdf0e10cSrcweir void ApplyOptions(); 67cdf0e10cSrcweir void ApplyStyle(); 68cdf0e10cSrcweir 69cdf0e10cSrcweir bool isStyleChanged() const { return mbStyleSelected; } 70cdf0e10cSrcweir bool isOptionsChanged() const { return mbOptionsChanged; } 71cdf0e10cSrcweir 72cdf0e10cSrcweir private: 73cdf0e10cSrcweir void addListener(); 74cdf0e10cSrcweir void removeListener(); 75cdf0e10cSrcweir void updateLayout(); 76cdf0e10cSrcweir void updateControls(); 77cdf0e10cSrcweir 78cdf0e10cSrcweir void FillDesignPreviewControl(); 79cdf0e10cSrcweir 80cdf0e10cSrcweir DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent*); 81cdf0e10cSrcweir DECL_LINK(implValueSetHdl, Control* ); 82cdf0e10cSrcweir DECL_LINK(implCheckBoxHdl, Control* ); 83cdf0e10cSrcweir 84cdf0e10cSrcweir private: 85cdf0e10cSrcweir ViewShellBase& mrBase; 86cdf0e10cSrcweir const rtl::OUString msTableTemplate; 87cdf0e10cSrcweir 88cdf0e10cSrcweir boost::scoped_ptr< Control > mxControls[DESIGNPANE_CONTROL_COUNT]; 89cdf0e10cSrcweir int mnOrgOffsetY[DESIGNPANE_CONTROL_COUNT]; 90cdf0e10cSrcweir 91cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxSelectedTable; 92cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView; 93cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > mxTableFamily; 94cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > mxToolbar; 95cdf0e10cSrcweir 96cdf0e10cSrcweir bool mbModal; 97cdf0e10cSrcweir bool mbStyleSelected; 98cdf0e10cSrcweir bool mbOptionsChanged; 99cdf0e10cSrcweir }; 100cdf0e10cSrcweir 101cdf0e10cSrcweir // -------------------------------------------------------------------- 102cdf0e10cSrcweir 103cdf0e10cSrcweir class TableDesignDialog : public ModalDialog 104cdf0e10cSrcweir { 105cdf0e10cSrcweir public: 106cdf0e10cSrcweir TableDesignDialog( ::Window* pParent, ViewShellBase& rBase ); 107cdf0e10cSrcweir 108cdf0e10cSrcweir virtual short Execute(); 109cdf0e10cSrcweir private: 110cdf0e10cSrcweir ViewShellBase& mrBase; 111cdf0e10cSrcweir boost::scoped_ptr< TableDesignPane > mpDesignPane; 112cdf0e10cSrcweir 113cdf0e10cSrcweir boost::scoped_ptr< FixedLine > mxFlSep1; 114cdf0e10cSrcweir boost::scoped_ptr< FixedLine > mxFlSep2; 115cdf0e10cSrcweir boost::scoped_ptr< HelpButton > mxHelpButton; 116cdf0e10cSrcweir boost::scoped_ptr< OKButton > mxOkButton; 117cdf0e10cSrcweir boost::scoped_ptr< CancelButton > mxCancelButton; 118cdf0e10cSrcweir }; 119cdf0e10cSrcweir 120cdf0e10cSrcweir } 121cdf0e10cSrcweir 122cdf0e10cSrcweir #endif // _SD_TABLEFORMATPANE_HXX 123