19#ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_REPORTCONTROLLER_HXX
20#define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_REPORTCONTROLLER_HXX
26#include <com/sun/star/beans/PropertyValue.hpp>
27#include <com/sun/star/beans/XPropertyChangeListener.hpp>
28#include <com/sun/star/embed/XVisualObject.hpp>
29#include <com/sun/star/frame/XDesktop2.hpp>
30#include <com/sun/star/frame/XFrame.hpp>
31#include <com/sun/star/report/XReportDefinition.hpp>
32#include <com/sun/star/report/XReportEngine.hpp>
33#include <com/sun/star/report/XSection.hpp>
34#include <com/sun/star/sdbc/XRowSet.hpp>
35#include <com/sun/star/uno/Sequence.hxx>
36#include <com/sun/star/uno/XComponentContext.hpp>
37#include <com/sun/star/util/XModeSelector.hpp>
38#include <com/sun/star/util/XNumberFormatter.hpp>
39#include <com/sun/star/view/XSelectionSupplier.hpp>
59 class OGroupsSortingDialog;
62 class OAddFieldWindow;
67 , css::beans::XPropertyChangeListener
68 , css::view::XSelectionSupplier
69 , css::util::XModeSelector
70 , css::embed::XVisualObject
82 css::uno::Sequence< css::beans::PropertyValue>
96 css::uno::Reference< css::sdbc::XRowSet >
m_xRowSet;
100 mutable css::uno::Reference< css::container::XNameAccess >
m_xColumns;
103 std::shared_ptr<rptui::OReportModel>
129 void createControl(
const css::uno::Sequence< css::beans::PropertyValue >& _aArgs,
const css::uno::Reference< css::report::XSection>& _xSection,
const OUString& _sFunction ,
SdrObjKind _nObjectId = SdrObjKind::ReportDesignFormattedField);
147 void modifyGroup(
const bool _bAppend,
const css::uno::Sequence< css::beans::PropertyValue >& _aArgs);
155 void createGroupSection(
const bool _bUndo,
const bool _bHeader,
const css::uno::Sequence< css::beans::PropertyValue >&_aArgs);
161 void listen(
const bool _bAdd);
165 void openPageDialog(
const css::uno::Reference< css::report::XSection>& _xSection);
177 sal_Int32
getGroupPosition(
const css::uno::Reference< css::report::XGroup >& _xGroup);
192 void groupChange(
const css::uno::Reference< css::report::XGroup>& _xGroup
193 ,std::u16string_view _sPropName
194 ,sal_Int32 _nGroupPos
200 css::uno::Reference< css::frame::XFrame >
getXFrame();
206 static void shrinkSectionBottom(
const css::uno::Reference< css::report::XSection >& _xSection);
207 static void shrinkSectionTop(
const css::uno::Reference< css::report::XSection >& _xSection);
210 void shrinkSection(
TranslateId pUndoStrId,
const css::uno::Reference< css::report::XSection >& _xSection, sal_Int32 _nShrinkId);
227 void addPairControls(
const css::uno::Sequence< css::beans::PropertyValue >& aArgs);
233 void createPageNumber(
const css::uno::Sequence< css::beans::PropertyValue >& _aArgs);
239 void createDateTime(
const css::uno::Sequence< css::beans::PropertyValue >& _aArgs);
276 virtual void onLoadedMenu(
const css::uno::Reference< css::frame::XLayoutManager >& _xLayoutManager )
override;
296 ,
const OUString& _sProperty
297 ,
const css::uno::Any& _aValue
298 ,
const css::uno::Sequence< css::beans::PropertyValue >& _aArgs);
308 virtual void Execute(sal_uInt16 nId,
const css::uno::Sequence< css::beans::PropertyValue>& aArgs)
override;
317 explicit OReportController(css::uno::Reference< css::uno::XComponentContext >
const & the_context);
324 DECLARE_XTYPEPROVIDER( )
334 ,const css::
uno::
Reference< css::report::XReportControlFormat>& _xControlFormat);
338 virtual
void SAL_CALL
disposing( const css::lang::EventObject& Source ) override;
351 virtual
void SAL_CALL
elementInserted(const css::container::ContainerEvent& Event) override;
352 virtual
void SAL_CALL
elementRemoved(const css::container::ContainerEvent& Event) override;
353 virtual
void SAL_CALL
elementReplaced(const css::container::ContainerEvent& Event) override;
356 virtual
void SAL_CALL
propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
375 virtual css::uno::Reference< css::frame::XModel > SAL_CALL
getModel()
override;
378 virtual OUString SAL_CALL
getTitle( )
override;
381 virtual void SAL_CALL
setMode(
const OUString& aMode )
override ;
382 virtual OUString SAL_CALL
getMode( )
override ;
387 virtual void SAL_CALL
setVisualAreaSize( ::sal_Int64 nAspect,
const css::awt::Size& aSize )
override;
388 virtual css::awt::Size SAL_CALL
getVisualAreaSize( ::sal_Int64 nAspect )
override;
390 virtual ::sal_Int32 SAL_CALL
getMapUnit( ::sal_Int64 nAspect )
override;
411 css::uno::Reference< css::sdbc::XRowSet >
const &
getRowSet();
430 return ::cppu::OPropertySetHelper::createPropertySetInfo(
getInfoHelper());
436 virtual ::cppu::IPropertyArrayHelper& SAL_CALL
getInfoHelper()
override;
440 css::uno::Reference< css::container::XNameAccess >
const &
getColumns()
const;
445 void addUndoAction( std::unique_ptr<SfxUndoAction> i_pAction );
Reference< XComponentContext > m_xContext
std::shared_ptr< rptui::OReportModel > m_aReportModel
static void shrinkSectionBottom(const css::uno::Reference< css::report::XSection > &_xSection)
shrink a section
virtual void SAL_CALL setMode(const OUString &aMode) override
void OnInvalidateClipboard()
void createControl(const css::uno::Sequence< css::beans::PropertyValue > &_aArgs, const css::uno::Reference< css::report::XSection > &_xSection, const OUString &_sFunction, SdrObjKind _nObjectId=SdrObjKind::ReportDesignFormattedField)
creates a formatted field in the given section with the given formula as data field
virtual void SAL_CALL elementInserted(const css::container::ContainerEvent &Event) override
OSectionView * getCurrentSectionView() const
gets the current section (SdrView)
void addPairControls(const css::uno::Sequence< css::beans::PropertyValue > &aArgs)
inserts a label - field pair into the current selected section
void createDefaultControl(const css::uno::Sequence< css::beans::PropertyValue > &_aArgs)
creates a new default control for the currently set type when the modifier KEY_MOD1 was pressed
rtl::Reference< OXReportControllerObserver > m_pReportControllerObserver
virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) override
virtual ::sal_Int32 SAL_CALL getMapUnit(::sal_Int64 nAspect) override
void switchReportSection(const sal_Int16 _nId)
switch the report header/footer sectionon off with undo or without depending on the given id.
void changeZOrder(sal_Int32 _nId)
change the ZOrder of a current select object.
SfxUndoManager & getUndoManager() const
virtual ~OReportController() override
virtual bool Construct(vcl::Window *pParent) override
DECL_LINK(OnClipboardChanged, TransferableDataHelper *, void)
void createNewFunction(const css::uno::Any &_aValue)
creates a new function in the given value context
virtual void impl_onModifyChanged() override
css::uno::Reference< css::frame::XModel > executeReport()
creates a new report from the report definition.
css::uno::Reference< css::lang::XComponent > m_xHoldAlive
void executeMethodWithUndo(TranslateId pUndoStrId, const ::std::function< void(ODesignView *)> &_pMemfun)
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue) override
virtual css::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation(::sal_Int64 nAspect) override
virtual void Notify(SfxBroadcaster &rBc, SfxHint const &rHint) override
void impl_zoom_nothrow()
set the zoom factor at the design view
bool m_bChartEnabledAsked
sal_Int32 m_nSplitPos
the current mode of the controller
bool impl_setPropertyAtControls_throw(TranslateId pUndoResId, const OUString &_sProperty, const css::uno::Any &_aValue, const css::uno::Sequence< css::beans::PropertyValue > &_aArgs)
set the property at all selected controls.
void groupChange(const css::uno::Reference< css::report::XGroup > &_xGroup, std::u16string_view _sPropName, sal_Int32 _nGroupPos, bool _bShow)
change the sections for a group
void listen(const bool _bAdd)
add or remove me as listener at the report definition
void createGroupSection(const bool _bUndo, const bool _bHeader, const css::uno::Sequence< css::beans::PropertyValue > &_aArgs)
creates a group section.
rtl::Reference< TransferableClipboardListener > m_pClipboardNotifier
void openSortingAndGroupingDialog()
opens or hides the sorting and grouping dialog
css::uno::Reference< css::beans::XPropertyChangeListener > m_xRowSetMediator
sal_Int32 getGroupPosition(const css::uno::Reference< css::report::XGroup > &_xGroup)
returns the position of the group inside the groups collection
virtual sal_Bool SAL_CALL select(const css::uno::Any &xSelection) override
virtual css::uno::Reference< css::frame::XModel > SAL_CALL getModel() override
OSectionWindow * getSectionWindow(const css::uno::Reference< css::report::XSection > &_xSection) const
void impl_fillCustomShapeState_nothrow(const char *_pCustomShapeType, dbaui::FeatureState &_rState) const
virtual void SAL_CALL addSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
virtual void SAL_CALL setVisualAreaSize(::sal_Int64 nAspect, const css::awt::Size &aSize) override
std::shared_ptr< OGroupsSortingDialog > m_xGroupsFloater
notifier for changes in the clipboard
css::uno::Reference< css::util::XNumberFormatter > m_xFormatter
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
sal_Int32 m_nPageNum
the position of the splitter
OUString m_sMode
last active property browser page
ODesignView * getDesignView() const
virtual sal_Bool SAL_CALL supportsMode(const OUString &aMode) override
css::uno::Reference< css::sdbc::XRowSet > m_xRowSet
virtual void impl_initialize() override
const css::uno::Reference< css::util::XNumberFormatter > & getReportNumberFormatter() const
returns the number formatter
const css::uno::Reference< css::report::XReportDefinition > & getReportDefinition() const
gives access to the report definition
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
virtual css::uno::Any SAL_CALL getSelection() override
void insertGraphic()
opens the file open dialog to allow the user to select an image which will be bound to a newly create...
DECL_LINK(OnCreateHdl, OAddFieldWindow &, void)
virtual dbaui::FeatureState GetState(sal_uInt16 nId) const override
void checkChartEnabled()
fills the member that chart is enabled or not
static bool isFormatCommandEnabled(sal_uInt16 _nCommand, const css::uno::Reference< css::report::XReportControlFormat > &_xControlFormat)
returns <TRUE> when the command is enabled
void addUndoAction(std::unique_ptr< SfxUndoAction > i_pAction)
void switchPageSection(const sal_Int16 _nId)
switch the report header/footer sectionon off with undo or without depending on the given id.
virtual css::awt::Size SAL_CALL getVisualAreaSize(::sal_Int64 nAspect) override
virtual sal_Bool SAL_CALL attachModel(const css::uno::Reference< css::frame::XModel > &xModel) override
void openZoomDialog()
opens the zoom dialog
virtual void SAL_CALL removeSelectionChangeListener(const css::uno::Reference< css::view::XSelectionChangeListener > &xListener) override
static void shrinkSectionTop(const css::uno::Reference< css::report::XSection > &_xSection)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
OUString m_sLastActivePage
name for the report definition
virtual OUString SAL_CALL getMode() override
css::uno::Reference< css::sdbc::XRowSet > const & getRowSet()
returns the RowSet which reflects the current settings of the report definition
virtual OUString SAL_CALL getTitle() override
css::awt::Size m_aVisualAreaSize
::comphelper::OInterfaceContainerHelper3< css::view::XSelectionChangeListener > m_aSelectionListeners
void collapseSection(const bool _bCollapse)
collapse or expand the currently selected section.
TransferableDataHelper m_aSystemClipboard
virtual void SAL_CALL restoreViewData(const css::uno::Any &Data) override
void createDateTime(const css::uno::Sequence< css::beans::PropertyValue > &_aArgs)
creates a formatted field with TODAY() function and if set also a NOW() function
virtual void describeSupportedFeatures() override
virtual css::uno::Any SAL_CALL getViewData() override
bool m_bInGeneratePreview
OUString getColumnLabel_throw(const OUString &i_sColumnName) const
OReportController(css::uno::Reference< css::uno::XComponentContext > const &the_context)
css::uno::Reference< css::container::XNameAccess > const & getColumns() const
css::uno::Reference< css::report::XReportDefinition > m_xReportDefinition
DECL_LINK(OnExecuteReport, void *, void)
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
void modifyGroup(const bool _bAppend, const css::uno::Sequence< css::beans::PropertyValue > &_aArgs)
append a new group or remove it with undo.
const std::shared_ptr< rptui::OReportModel > & getSdrModel() const
return the SdrModel of the real model
css::uno::Reference< css::container::XNameAccess > m_xColumns
css::uno::Reference< css::report::XReportEngine > m_xReportEngine
css::uno::Reference< css::frame::XFrame > getXFrame()
OReportController(const OReportController &)=delete
virtual void getPropertyDefaultByHandle(sal_Int32 _nHandle, css::uno::Any &_rDefault) const override
sal_Int16 getZoomValue() const
virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent &Event) override
css::uno::Reference< css::frame::XDesktop2 > m_xFrameLoader
sal_Int32 getSplitPos() const
returns the current position of the splitter
void createPageNumber(const css::uno::Sequence< css::beans::PropertyValue > &_aArgs)
inserts a label - field combination to show the page number and/or page count
virtual void SAL_CALL disposing() override
void setSplitPos(sal_Int32 _nSplitPos)
sal_Int32 m_nSelectionCount
the page number from the restoreView call
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
void markSection(const bool _bNext)
marks the next or previous section, when the first/last section was already selected then the report ...
virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedModes() override
void alignControlsWithUndo(TranslateId pUndoStrId, ControlModification _nControlModification, bool _bAlignAtSection=false)
OReportController & operator=(const OReportController &)=delete
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent &Event) override
virtual void onLoadedMenu(const css::uno::Reference< css::frame::XLayoutManager > &_xLayoutManager) override
void openPageDialog(const css::uno::Reference< css::report::XSection > &_xSection)
opens the common page dialog
void impl_fillState_nothrow(const OUString &_sProperty, dbaui::FeatureState &_rState) const
fills the state for the feature request.
void clearUndoManager() const
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void notifyGroupSections(const css::container::ContainerEvent &_rEvent, bool _bShow)
calls propertyChanged when the header or footer is really turned on.
void shrinkSection(TranslateId pUndoStrId, const css::uno::Reference< css::report::XSection > &_xSection, sal_Int32 _nShrinkId)
css::uno::Sequence< css::beans::PropertyValue > m_aCollapsedSections
SwView * getView(const uno::Reference< frame::XModel > &xModel)
::dbaui::DBSubComponentController OReportController_BASE
::cppu::ImplHelper5< css::container::XContainerListener, css::beans::XPropertyChangeListener, css::view::XSelectionSupplier, css::util::XModeSelector, css::embed::XVisualObject > OReportController_Listener
#define DECLARE_XINTERFACE()