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