1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef RPTUI_REPORTCONTROLLER_HXX 28*cdf0e10cSrcweir #define RPTUI_REPORTCONTROLLER_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include "DesignView.hxx" 31*cdf0e10cSrcweir #include "ModuleHelper.hxx" 32*cdf0e10cSrcweir #include "ReportControllerObserver.hxx" 33*cdf0e10cSrcweir #include "RptDef.hxx" 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir /** === begin UNO includes === **/ 36*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp> 37*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyChangeListener.hpp> 38*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 39*cdf0e10cSrcweir #include <com/sun/star/embed/XVisualObject.hpp> 40*cdf0e10cSrcweir #include <com/sun/star/frame/XComponentLoader.hpp> 41*cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp> 42*cdf0e10cSrcweir #include <com/sun/star/io/XObjectInputStream.hpp> 43*cdf0e10cSrcweir #include <com/sun/star/io/XObjectOutputStream.hpp> 44*cdf0e10cSrcweir #include <com/sun/star/report/XReportControlModel.hpp> 45*cdf0e10cSrcweir #include <com/sun/star/report/XReportDefinition.hpp> 46*cdf0e10cSrcweir #include <com/sun/star/report/XReportEngine.hpp> 47*cdf0e10cSrcweir #include <com/sun/star/report/XSection.hpp> 48*cdf0e10cSrcweir #include <com/sun/star/sdbc/XConnection.hpp> 49*cdf0e10cSrcweir #include <com/sun/star/sdbc/XRowSet.hpp> 50*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx> 51*cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 52*cdf0e10cSrcweir #include <com/sun/star/util/XModeSelector.hpp> 53*cdf0e10cSrcweir #include <com/sun/star/util/XNumberFormatter.hpp> 54*cdf0e10cSrcweir #include <com/sun/star/view/XSelectionSupplier.hpp> 55*cdf0e10cSrcweir /** === end UNO includes === **/ 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir #include <comphelper/implementationreference.hxx> 58*cdf0e10cSrcweir #include <comphelper/proparrhlp.hxx> 59*cdf0e10cSrcweir #include <comphelper/propertystatecontainer.hxx> 60*cdf0e10cSrcweir #include <comphelper/uno3.hxx> 61*cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx> 62*cdf0e10cSrcweir #include <dbaccess/dbsubcomponentcontroller.hxx> 63*cdf0e10cSrcweir #include <svl/lstner.hxx> 64*cdf0e10cSrcweir #include <svtools/transfer.hxx> 65*cdf0e10cSrcweir #include <svx/svdedtv.hxx> 66*cdf0e10cSrcweir #include <svx/zoomitem.hxx> 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir #include <boost/noncopyable.hpp> 69*cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 70*cdf0e10cSrcweir #include <functional> 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir class TransferableHelper; 73*cdf0e10cSrcweir class TransferableClipboardListener; 74*cdf0e10cSrcweir class VclWindowEvent; 75*cdf0e10cSrcweir class SfxUndoManager; 76*cdf0e10cSrcweir namespace rptui 77*cdf0e10cSrcweir { 78*cdf0e10cSrcweir class OGroupsSortingDialog; 79*cdf0e10cSrcweir class OPropertyMediator; 80*cdf0e10cSrcweir class OReportModel; 81*cdf0e10cSrcweir class OSectionView; 82*cdf0e10cSrcweir class OAddFieldWindow; 83*cdf0e10cSrcweir class OSectionWindow; 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir typedef ::dbaui::DBSubComponentController OReportController_BASE; 86*cdf0e10cSrcweir typedef ::cppu::ImplHelper5 < ::com::sun::star::container::XContainerListener 87*cdf0e10cSrcweir , ::com::sun::star::beans::XPropertyChangeListener 88*cdf0e10cSrcweir , ::com::sun::star::view::XSelectionSupplier 89*cdf0e10cSrcweir , ::com::sun::star::util::XModeSelector 90*cdf0e10cSrcweir , ::com::sun::star::embed::XVisualObject 91*cdf0e10cSrcweir > OReportController_Listener; 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir class OReportController : public OReportController_BASE 94*cdf0e10cSrcweir ,public OReportController_Listener 95*cdf0e10cSrcweir ,public SfxListener 96*cdf0e10cSrcweir ,public ::comphelper::OPropertyStateContainer 97*cdf0e10cSrcweir ,public ::comphelper::OPropertyArrayUsageHelper < OReportController_BASE > 98*cdf0e10cSrcweir ,public ::boost::noncopyable 99*cdf0e10cSrcweir { 100*cdf0e10cSrcweir private: 101*cdf0e10cSrcweir OModuleClient m_aModuleClient; 102*cdf0e10cSrcweir ::cppu::OInterfaceContainerHelper 103*cdf0e10cSrcweir m_aSelectionListeners; 104*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> 105*cdf0e10cSrcweir m_aCollapsedSections; 106*cdf0e10cSrcweir TransferableDataHelper m_aSystemClipboard; // content of the clipboard 107*cdf0e10cSrcweir TransferableClipboardListener* 108*cdf0e10cSrcweir m_pClipbordNotifier; /// notifier for changes in the clipboard 109*cdf0e10cSrcweir OGroupsSortingDialog* m_pGroupsFloater; 110*cdf0e10cSrcweir 111*cdf0e10cSrcweir OXReportControllerObserver* m_pReportControllerObserver; 112*cdf0e10cSrcweir 113*cdf0e10cSrcweir ODesignView* getDesignView() const { return static_cast< ODesignView* >( getView() ); } 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xReportDefinition; 116*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportEngine > m_xReportEngine; 117*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XComponentLoader > m_xFrameLoader; 118*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; 119*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xRowSet; 120*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > m_xRowSetMediator; 121*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; // a number formatter working with the report's NumberFormatsSupplier 122*cdf0e10cSrcweir mutable ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xHoldAlive; 123*cdf0e10cSrcweir mutable ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xColumns; 124*cdf0e10cSrcweir ::com::sun::star::awt::Size m_aVisualAreaSize; 125*cdf0e10cSrcweir 126*cdf0e10cSrcweir ::boost::shared_ptr<rptui::OReportModel> 127*cdf0e10cSrcweir m_aReportModel; 128*cdf0e10cSrcweir ::rtl::OUString m_sName; /// name for the report definition 129*cdf0e10cSrcweir ::rtl::OUString m_sLastActivePage; /// last active property browser page 130*cdf0e10cSrcweir ::rtl::OUString m_sMode; /// the current mode of the controller 131*cdf0e10cSrcweir sal_Int32 m_nSplitPos; /// the position of the splitter 132*cdf0e10cSrcweir sal_Int32 m_nPageNum; /// the page number from the restoreView call 133*cdf0e10cSrcweir sal_Int32 m_nSelectionCount; 134*cdf0e10cSrcweir ::sal_Int64 m_nAspect; 135*cdf0e10cSrcweir sal_Int16 m_nZoomValue; 136*cdf0e10cSrcweir SvxZoomType m_eZoomType; 137*cdf0e10cSrcweir sal_Bool m_bShowRuler; 138*cdf0e10cSrcweir sal_Bool m_bGridVisible; 139*cdf0e10cSrcweir sal_Bool m_bGridUse; 140*cdf0e10cSrcweir sal_Bool m_bShowProperties; 141*cdf0e10cSrcweir sal_Bool m_bGroupFloaterWasVisible; 142*cdf0e10cSrcweir sal_Bool m_bHelplinesMove; 143*cdf0e10cSrcweir bool m_bChartEnabled; 144*cdf0e10cSrcweir bool m_bChartEnabledAsked; 145*cdf0e10cSrcweir bool m_bInGeneratePreview; 146*cdf0e10cSrcweir 147*cdf0e10cSrcweir /** creates a formatted field in the given section with the given formula as data field 148*cdf0e10cSrcweir * 149*cdf0e10cSrcweir * \param _aArgs 150*cdf0e10cSrcweir * \param _xSection the section where to create the formatted field 151*cdf0e10cSrcweir * \param _sFunction the function which will be set at the data field. 152*cdf0e10cSrcweir */ 153*cdf0e10cSrcweir void createControl(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aArgs,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection,const ::rtl::OUString& _sFunction ,sal_uInt16 _nObjectId = OBJ_DLG_FORMATTEDFIELD); 154*cdf0e10cSrcweir /** switch the report header/footer sectionon off with undo or without depending on the given id. 155*cdf0e10cSrcweir * 156*cdf0e10cSrcweir * \param _nId Can either be SID_REPORTHEADER_WITHOUT_UNDO or SID_REPORTFOOTER_WITHOUT_UNDO or SID_REPORTHEADERFOOTER. 157*cdf0e10cSrcweir */ 158*cdf0e10cSrcweir void switchReportSection(const sal_Int16 _nId); 159*cdf0e10cSrcweir 160*cdf0e10cSrcweir /** switch the report header/footer sectionon off with undo or without depending on the given id. 161*cdf0e10cSrcweir * 162*cdf0e10cSrcweir * \param _nId Can either be SID_PAGEHEADER_WITHOUT_UNDO or SID_PAGEFOOTER_WITHOUT_UNDO or SID_PAGEHEADERFOOTER. 163*cdf0e10cSrcweir */ 164*cdf0e10cSrcweir void switchPageSection(const sal_Int16 _nId); 165*cdf0e10cSrcweir 166*cdf0e10cSrcweir /** append a new group or remove it with undo. 167*cdf0e10cSrcweir * 168*cdf0e10cSrcweir * \param _bAppend 169*cdf0e10cSrcweir * \param _aArgs The args which contains a element named PROPERTY_GROUP of type report::XGroup. 170*cdf0e10cSrcweir */ 171*cdf0e10cSrcweir void modifyGroup(const bool _bAppend, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aArgs); 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir /** creates a group section. 174*cdf0e10cSrcweir * 175*cdf0e10cSrcweir * \param _bUndo true when undo action should be created 176*cdf0e10cSrcweir * \param _bHeader true when it is a header otherwise it is a footer 177*cdf0e10cSrcweir * \param _aArgs The args which contains a element named PROPERTY_GROUP of type report::XGroup. 178*cdf0e10cSrcweir */ 179*cdf0e10cSrcweir void createGroupSection(const bool _bUndo,const bool _bHeader,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >&_aArgs); 180*cdf0e10cSrcweir 181*cdf0e10cSrcweir /** add or remove me as listener at the report definition 182*cdf0e10cSrcweir * 183*cdf0e10cSrcweir * \param _bAdd 184*cdf0e10cSrcweir */ 185*cdf0e10cSrcweir void listen(const bool _bAdd); 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir /** opens the common page dialog 188*cdf0e10cSrcweir */ 189*cdf0e10cSrcweir void openPageDialog(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection); 190*cdf0e10cSrcweir 191*cdf0e10cSrcweir /** opens or hides the sorting and grouping dialog 192*cdf0e10cSrcweir */ 193*cdf0e10cSrcweir void openSortingAndGroupingDialog(); 194*cdf0e10cSrcweir 195*cdf0e10cSrcweir /** opens the zoom dialog 196*cdf0e10cSrcweir */ 197*cdf0e10cSrcweir void openZoomDialog(); 198*cdf0e10cSrcweir 199*cdf0e10cSrcweir /** returns the position of the group inside the groups collection 200*cdf0e10cSrcweir */ 201*cdf0e10cSrcweir sal_Int32 getGroupPosition(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup); 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir /** calls propertyChanged when the header or footer is really turned on. 204*cdf0e10cSrcweir @param _rEvent the group 205*cdf0e10cSrcweir @param _bShow when <TRUE/> the header and footer will be shown otherwise not 206*cdf0e10cSrcweir */ 207*cdf0e10cSrcweir void notifyGroupSections(const ::com::sun::star::container::ContainerEvent& _rEvent 208*cdf0e10cSrcweir ,bool _bShow); 209*cdf0e10cSrcweir 210*cdf0e10cSrcweir /** change the sections for a group 211*cdf0e10cSrcweir @param _sPropName the header or footer 212*cdf0e10cSrcweir @param _xGroup the group 213*cdf0e10cSrcweir @param _nGroupPos the position of the group inside the groups collection or the previous index when it was removed 214*cdf0e10cSrcweir @param _bShow when <TRUE/> the header and footer will be shown otherwise not 215*cdf0e10cSrcweir */ 216*cdf0e10cSrcweir void groupChange( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup 217*cdf0e10cSrcweir ,const ::rtl::OUString& _sPropName 218*cdf0e10cSrcweir ,sal_Int32 _nGroupPos 219*cdf0e10cSrcweir ,bool _bShow); 220*cdf0e10cSrcweir 221*cdf0e10cSrcweir void executeMethodWithUndo(sal_uInt16 _nUndoStrId,const ::std::mem_fun_t<void,ODesignView>& _pMemfun); 222*cdf0e10cSrcweir void alignControlsWithUndo(sal_uInt16 _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection = false); 223*cdf0e10cSrcweir 224*cdf0e10cSrcweir // open the help agent of report designer at start time 225*cdf0e10cSrcweir void doOpenHelpAgent(); 226*cdf0e10cSrcweir 227*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getXFrame(); 228*cdf0e10cSrcweir 229*cdf0e10cSrcweir /** shrink a section 230*cdf0e10cSrcweir @param _nUndoStrId the string id of the string which is shown in undo menu 231*cdf0e10cSrcweir @param _nShrinkId ID of what you would like to shrink. 232*cdf0e10cSrcweir */ 233*cdf0e10cSrcweir void shrinkSectionBottom(::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection); 234*cdf0e10cSrcweir void shrinkSectionTop(::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection); 235*cdf0e10cSrcweir 236*cdf0e10cSrcweir public: 237*cdf0e10cSrcweir void shrinkSection(sal_uInt16 _nUndoStrId, ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection, sal_Int32 _nShrinkId); 238*cdf0e10cSrcweir 239*cdf0e10cSrcweir /** opens the file open dialog to allow the user to select a image which will be 240*cdf0e10cSrcweir * bound to a newly created image button. 241*cdf0e10cSrcweir */ 242*cdf0e10cSrcweir void insertGraphic(); 243*cdf0e10cSrcweir 244*cdf0e10cSrcweir /** resets the floater 245*cdf0e10cSrcweir */ 246*cdf0e10cSrcweir void updateFloater(); 247*cdf0e10cSrcweir 248*cdf0e10cSrcweir /** creates a new function in the given value context 249*cdf0e10cSrcweir * 250*cdf0e10cSrcweir * \param _aValue contains a XNameContainer 251*cdf0e10cSrcweir */ 252*cdf0e10cSrcweir void createNewFunction(const ::com::sun::star::uno::Any& _aValue); 253*cdf0e10cSrcweir 254*cdf0e10cSrcweir /** inserts a label - field pair into the current selected section 255*cdf0e10cSrcweir * 256*cdf0e10cSrcweir * \param aArgs 257*cdf0e10cSrcweir */ 258*cdf0e10cSrcweir void addPairControls(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs); 259*cdf0e10cSrcweir 260*cdf0e10cSrcweir /** inserts a label - field combination to show the page number and/or page count 261*cdf0e10cSrcweir * 262*cdf0e10cSrcweir * \param _aArgs 263*cdf0e10cSrcweir */ 264*cdf0e10cSrcweir void createPageNumber(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aArgs); 265*cdf0e10cSrcweir 266*cdf0e10cSrcweir /** creates a formatted filed with TODAY() function and if set also an NOW() function 267*cdf0e10cSrcweir * 268*cdf0e10cSrcweir * \param _aArgs 269*cdf0e10cSrcweir */ 270*cdf0e10cSrcweir void createDateTime(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aArgs); 271*cdf0e10cSrcweir 272*cdf0e10cSrcweir /** gets the current section (SdrView) 273*cdf0e10cSrcweir * 274*cdf0e10cSrcweir * \return the currently selected section or <NULL/> if noone is selected 275*cdf0e10cSrcweir */ 276*cdf0e10cSrcweir OSectionView* getCurrentSectionView() const; 277*cdf0e10cSrcweir 278*cdf0e10cSrcweir /**change the ZOrder of a current select object. 279*cdf0e10cSrcweir * 280*cdf0e10cSrcweir * \param _nId The command ID about what to do. 281*cdf0e10cSrcweir */ 282*cdf0e10cSrcweir void changeZOrder(sal_Int32 _nId); 283*cdf0e10cSrcweir 284*cdf0e10cSrcweir /** marks the next or previous section, when the first/last section was already selected then the report will be selected. 285*cdf0e10cSrcweir * 286*cdf0e10cSrcweir * \param _bNext 287*cdf0e10cSrcweir */ 288*cdf0e10cSrcweir void markSection(const bool _bNext); 289*cdf0e10cSrcweir 290*cdf0e10cSrcweir /** collapse or expand the currently selected section. 291*cdf0e10cSrcweir * 292*cdf0e10cSrcweir * \param _bCollapse collapse if sal_True otherwise expand 293*cdf0e10cSrcweir */ 294*cdf0e10cSrcweir void collapseSection(const bool _bCollapse); 295*cdf0e10cSrcweir 296*cdf0e10cSrcweir /** fills the member that chart is enabled or not 297*cdf0e10cSrcweir * 298*cdf0e10cSrcweir */ 299*cdf0e10cSrcweir void checkChartEnabled(); 300*cdf0e10cSrcweir 301*cdf0e10cSrcweir /** set the zoom factor at the design view 302*cdf0e10cSrcweir */ 303*cdf0e10cSrcweir void impl_zoom_nothrow(); 304*cdf0e10cSrcweir 305*cdf0e10cSrcweir virtual void impl_onModifyChanged(); 306*cdf0e10cSrcweir 307*cdf0e10cSrcweir virtual void onLoadedMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& _xLayoutManager ); 308*cdf0e10cSrcweir virtual void impl_initialize( ); 309*cdf0e10cSrcweir bool isUiVisible() const; 310*cdf0e10cSrcweir 311*cdf0e10cSrcweir /** creates a new default control for the currently set type when the modifier KEY_MOD1 was pressed 312*cdf0e10cSrcweir * \param _aArgs must contain a properyvalue with name "KeyModifier" and value KEY_MOD1 when control should be created. 313*cdf0e10cSrcweir */ 314*cdf0e10cSrcweir void createDefaultControl(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aArgs); 315*cdf0e10cSrcweir 316*cdf0e10cSrcweir /** fills the state for the feture request. 317*cdf0e10cSrcweir @param _sProperty the property which should be filled in the value 318*cdf0e10cSrcweir @param _rState the state to fill 319*cdf0e10cSrcweir */ 320*cdf0e10cSrcweir void impl_fillState_nothrow(const ::rtl::OUString& _sProperty,dbaui::FeatureState& _rState) const; 321*cdf0e10cSrcweir void impl_fillCustomShapeState_nothrow(const char* _pCustomShapeType,dbaui::FeatureState& _rState) const; 322*cdf0e10cSrcweir 323*cdf0e10cSrcweir /** set the property at all selected controls. 324*cdf0e10cSrcweir @return <TRUE/> when the selection is not empty 325*cdf0e10cSrcweir */ 326*cdf0e10cSrcweir bool impl_setPropertyAtControls_throw(const sal_uInt16 _nUndoResId 327*cdf0e10cSrcweir ,const ::rtl::OUString& _sProperty 328*cdf0e10cSrcweir ,const ::com::sun::star::uno::Any& _aValue 329*cdf0e10cSrcweir ,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _aArgs); 330*cdf0e10cSrcweir 331*cdf0e10cSrcweir DECL_LINK( OnInvalidateClipboard, void* ); 332*cdf0e10cSrcweir DECL_LINK( OnClipboardChanged, void* ); 333*cdf0e10cSrcweir DECL_LINK( OnExecuteReport, void* ); 334*cdf0e10cSrcweir DECL_LINK( OnOpenHelpAgent, void* ); 335*cdf0e10cSrcweir short saveModified(); 336*cdf0e10cSrcweir // all the features which should be handled by this class 337*cdf0e10cSrcweir virtual void describeSupportedFeatures(); 338*cdf0e10cSrcweir // state of a feature. 'feature' may be the handle of a ::com::sun::star::util::URL somebody requested a dispatch interface for OR a toolbar slot. 339*cdf0e10cSrcweir virtual dbaui::FeatureState GetState(sal_uInt16 nId) const; 340*cdf0e10cSrcweir // execute a feature 341*cdf0e10cSrcweir virtual void Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); 342*cdf0e10cSrcweir 343*cdf0e10cSrcweir virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, ::com::sun::star::uno::Any& _rDefault ) const; 344*cdf0e10cSrcweir virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception); 345*cdf0e10cSrcweir 346*cdf0e10cSrcweir private: 347*cdf0e10cSrcweir virtual ~OReportController(); 348*cdf0e10cSrcweir 349*cdf0e10cSrcweir public: 350*cdf0e10cSrcweir OReportController(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context); 351*cdf0e10cSrcweir 352*cdf0e10cSrcweir DECL_LINK( EventLstHdl, VclWindowEvent* ); 353*cdf0e10cSrcweir DECL_LINK( OnCreateHdl, OAddFieldWindow*); 354*cdf0e10cSrcweir 355*cdf0e10cSrcweir DECLARE_XINTERFACE( ) 356*cdf0e10cSrcweir DECLARE_XTYPEPROVIDER( ) 357*cdf0e10cSrcweir 358*cdf0e10cSrcweir // SfxListener 359*cdf0e10cSrcweir virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint); 360*cdf0e10cSrcweir 361*cdf0e10cSrcweir /** returns <TRUE/> when the command is enbaled 362*cdf0e10cSrcweir @param _nCommand the command id 363*cdf0e10cSrcweir @param _xControlFormat the report control format 364*cdf0e10cSrcweir */ 365*cdf0e10cSrcweir sal_Bool isFormatCommandEnabled(sal_uInt16 _nCommand 366*cdf0e10cSrcweir ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlFormat>& _xControlFormat) const; 367*cdf0e10cSrcweir 368*cdf0e10cSrcweir virtual sal_Bool Construct(Window* pParent); 369*cdf0e10cSrcweir // XEventListener 370*cdf0e10cSrcweir virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); 371*cdf0e10cSrcweir 372*cdf0e10cSrcweir // ::com::sun::star::frame::XController 373*cdf0e10cSrcweir virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) throw( ::com::sun::star::uno::RuntimeException ); 374*cdf0e10cSrcweir 375*cdf0e10cSrcweir // ::com::sun::star::lang::XComponent 376*cdf0e10cSrcweir virtual void SAL_CALL disposing(); 377*cdf0e10cSrcweir 378*cdf0e10cSrcweir // XServiceInfo 379*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException); 380*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); 381*cdf0e10cSrcweir // need by registration 382*cdf0e10cSrcweir static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException ); 383*cdf0e10cSrcweir static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); 384*cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL 385*cdf0e10cSrcweir create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext); 386*cdf0e10cSrcweir 387*cdf0e10cSrcweir // ::com::sun::star::container::XContainerListener 388*cdf0e10cSrcweir virtual void SAL_CALL elementInserted(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException ); 389*cdf0e10cSrcweir virtual void SAL_CALL elementRemoved(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException ); 390*cdf0e10cSrcweir virtual void SAL_CALL elementReplaced(const ::com::sun::star::container::ContainerEvent& Event) throw( ::com::sun::star::uno::RuntimeException ); 391*cdf0e10cSrcweir 392*cdf0e10cSrcweir // XPropertyChangeListener 393*cdf0e10cSrcweir virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException); 394*cdf0e10cSrcweir 395*cdf0e10cSrcweir // XSelectionSupplier 396*cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL select( const ::com::sun::star::uno::Any& xSelection ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); 397*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getSelection( ) throw (::com::sun::star::uno::RuntimeException); 398*cdf0e10cSrcweir virtual void SAL_CALL addSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 399*cdf0e10cSrcweir virtual void SAL_CALL removeSelectionChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 400*cdf0e10cSrcweir 401*cdf0e10cSrcweir // ::com::sun::star::frame::XController 402*cdf0e10cSrcweir virtual sal_Bool SAL_CALL attachModel(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xModel) throw( ::com::sun::star::uno::RuntimeException ); 403*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getViewData(void) throw( ::com::sun::star::uno::RuntimeException ); 404*cdf0e10cSrcweir virtual void SAL_CALL restoreViewData(const ::com::sun::star::uno::Any& Data) throw( ::com::sun::star::uno::RuntimeException ); 405*cdf0e10cSrcweir 406*cdf0e10cSrcweir /** gives access to the report definition 407*cdf0e10cSrcweir * \return the report definition object, may be <NULL/> 408*cdf0e10cSrcweir */ 409*cdf0e10cSrcweir inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition> getReportDefinition() const { return m_xReportDefinition; } 410*cdf0e10cSrcweir 411*cdf0e10cSrcweir // ::com::sun::star::frame::XController 412*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL getModel(void) throw( ::com::sun::star::uno::RuntimeException ); 413*cdf0e10cSrcweir 414*cdf0e10cSrcweir // XTitle 415*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getTitle( ) throw (::com::sun::star::uno::RuntimeException); 416*cdf0e10cSrcweir 417*cdf0e10cSrcweir // XModeSelector 418*cdf0e10cSrcweir virtual void SAL_CALL setMode( const ::rtl::OUString& aMode ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException) ; 419*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getMode( ) throw (::com::sun::star::uno::RuntimeException) ; 420*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedModes( ) throw (::com::sun::star::uno::RuntimeException) ; 421*cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL supportsMode( const ::rtl::OUString& aMode ) throw (::com::sun::star::uno::RuntimeException) ; 422*cdf0e10cSrcweir 423*cdf0e10cSrcweir // XVisualObject 424*cdf0e10cSrcweir virtual void SAL_CALL setVisualAreaSize( ::sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::embed::WrongStateException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 425*cdf0e10cSrcweir virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( ::sal_Int64 nAspect ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::embed::WrongStateException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 426*cdf0e10cSrcweir virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::embed::WrongStateException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 427*cdf0e10cSrcweir virtual ::sal_Int32 SAL_CALL getMapUnit( ::sal_Int64 nAspect ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); 428*cdf0e10cSrcweir 429*cdf0e10cSrcweir 430*cdf0e10cSrcweir /** returns the current position of the splitter 431*cdf0e10cSrcweir * 432*cdf0e10cSrcweir * \return 433*cdf0e10cSrcweir */ 434*cdf0e10cSrcweir inline sal_Int32 getSplitPos() const { return m_nSplitPos;} 435*cdf0e10cSrcweir inline void setSplitPos(sal_Int32 _nSplitPos) { m_nSplitPos = _nSplitPos;} 436*cdf0e10cSrcweir 437*cdf0e10cSrcweir /** creates a new report from the report definition. 438*cdf0e10cSrcweir * 439*cdf0e10cSrcweir * \return The model or <NULL/> if the model could not be created. 440*cdf0e10cSrcweir */ 441*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel> executeReport(); 442*cdf0e10cSrcweir 443*cdf0e10cSrcweir /** returns the RowSet which reflects the current settings of the report definition 444*cdf0e10cSrcweir 445*cdf0e10cSrcweir The caller is allowed to hold a reference to the RowSet - it is kept alive as long 446*cdf0e10cSrcweir as the controller lives, and it's settings will follow the report definition's settings. 447*cdf0e10cSrcweir */ 448*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > getRowSet(); 449*cdf0e10cSrcweir 450*cdf0e10cSrcweir /** returns the number formatter 451*cdf0e10cSrcweir */ 452*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > getReportNumberFormatter() const; 453*cdf0e10cSrcweir 454*cdf0e10cSrcweir /** return the SdrModel of the real model 455*cdf0e10cSrcweir * 456*cdf0e10cSrcweir * \return 457*cdf0e10cSrcweir */ 458*cdf0e10cSrcweir ::boost::shared_ptr<rptui::OReportModel> getSdrModel() const; 459*cdf0e10cSrcweir 460*cdf0e10cSrcweir inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext() const { return m_xContext; } 461*cdf0e10cSrcweir inline sal_Int16 getZoomValue() const { return m_nZoomValue; } 462*cdf0e10cSrcweir inline void resetZoomType() { m_eZoomType = SVX_ZOOM_PERCENT; } 463*cdf0e10cSrcweir 464*cdf0e10cSrcweir // com::sun::star::beans::XPropertySet 465*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) 466*cdf0e10cSrcweir { 467*cdf0e10cSrcweir return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper()); 468*cdf0e10cSrcweir } 469*cdf0e10cSrcweir // comphelper::OPropertyArrayUsageHelper 470*cdf0e10cSrcweir virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const; 471*cdf0e10cSrcweir 472*cdf0e10cSrcweir // cppu::OPropertySetHelper 473*cdf0e10cSrcweir virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); 474*cdf0e10cSrcweir 475*cdf0e10cSrcweir ::boost::shared_ptr<OSectionWindow> getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const; 476*cdf0e10cSrcweir 477*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getColumns() const; 478*cdf0e10cSrcweir ::rtl::OUString getColumnLabel_throw(const ::rtl::OUString& i_sColumnName) const; 479*cdf0e10cSrcweir 480*cdf0e10cSrcweir SfxUndoManager& getUndoManager() const; 481*cdf0e10cSrcweir void clearUndoManager() const; 482*cdf0e10cSrcweir void addUndoAction( SfxUndoAction* i_pAction ); 483*cdf0e10cSrcweir }; 484*cdf0e10cSrcweir } 485*cdf0e10cSrcweir #endif // RPTUI_REPORTCONTROLLER_HXX 486*cdf0e10cSrcweir 487