LibreOffice Module extensions (master) 1
framectr.hxx
Go to the documentation of this file.
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
20#pragma once
21
22#include <com/sun/star/frame/XDispatchProvider.hpp>
23#include <com/sun/star/frame/XController.hpp>
24#include <com/sun/star/frame/XDispatch.hpp>
25#include <com/sun/star/lang/XServiceInfo.hpp>
26#include <com/sun/star/frame/XDispatchInformationProvider.hpp>
28#include <rtl/ref.hxx>
29#include <tools/link.hxx>
30#include <utility>
31#include <vcl/window.hxx>
32#include <vector>
33#include <memory>
34
35#include "bibmod.hxx"
36class BibDataManager;
38namespace com::sun::star{
39 namespace form::runtime {
40 class XFormController;
41 }
42}
44{
45public:
46 css::util::URL aURL;
47 css::uno::Reference< css::frame::XStatusListener > xListener;
48 BibStatusDispatch( css::util::URL _aURL, css::uno::Reference< css::frame::XStatusListener > xRef )
49 : aURL(std::move( _aURL ))
50 , xListener(std::move( xRef ))
51 {}
52};
53
54typedef std::vector<std::unique_ptr<BibStatusDispatch> > BibStatusDispatchArr;
55
56class BibFrameController_Impl : public cppu::WeakImplHelper <
57 css::lang::XServiceInfo,
58 css::frame::XController,
59 css::frame::XDispatch,
60 css::frame::XDispatchProvider,
61 css::frame::XDispatchInformationProvider
62>
63{
64friend class BibFrameCtrl_Impl;
67 css::uno::Reference< css::awt::XWindow > m_xWindow;
68 css::uno::Reference< css::frame::XFrame > m_xFrame;
72
73 DECL_LINK( DisposeHdl, void*, void );
74
75 static bool SaveModified(const css::uno::Reference< css::form::runtime::XFormController>& xController);
76public:
77 BibFrameController_Impl( css::uno::Reference< css::awt::XWindow > xComponent,
78 BibDataManager* pDatMan);
79 virtual ~BibFrameController_Impl() override;
80
81
82 void ChangeDataSource(const css::uno::Sequence< css::beans::PropertyValue >& aArgs);
83 void RemoveFilter();
84
85 // css::lang::XServiceInfo
86 virtual OUString SAL_CALL getImplementationName() override;
87 virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override;
88 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
89
90 // css::frame::XController
91 virtual void SAL_CALL attachFrame( const css::uno::Reference< css::frame::XFrame > & xFrame ) override;
92 virtual sal_Bool SAL_CALL attachModel( const css::uno::Reference< css::frame::XModel > & xModel ) override;
93 virtual sal_Bool SAL_CALL suspend( sal_Bool bSuspend ) override;
94 virtual css::uno::Any SAL_CALL getViewData() override;
95 virtual void SAL_CALL restoreViewData( const css::uno::Any& Value ) override;
96 virtual css::uno::Reference< css::frame::XFrame > SAL_CALL getFrame() override;
97 virtual css::uno::Reference< css::frame::XModel > SAL_CALL getModel() override;
98
99 // css::lang::XComponent
100 virtual void SAL_CALL dispose() override;
101 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener > & aListener ) override;
102 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener > & aListener ) override;
103
104 // css::frame::XDispatchProvider
105 virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags) override;
106 virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& aDescripts) override;
107
108 //class css::frame::XDispatch
109 virtual void SAL_CALL dispatch(const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& aArgs) override;
110 virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL) override;
111 virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > & xControl, const css::util::URL& aURL) override;
112
113 // css::frame::XDispatchInformationProvider
114 virtual css::uno::Sequence< ::sal_Int16 > SAL_CALL getSupportedCommandGroups( ) override;
115 virtual css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation( ::sal_Int16 CommandGroup ) override;
116 };
117
118/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
rtl::Reference< BibFrameCtrl_Impl > m_xImpl
Definition: framectr.hxx:65
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
Definition: framectr.cxx:607
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: framectr.cxx:239
void ChangeDataSource(const css::uno::Sequence< css::beans::PropertyValue > &aArgs)
Definition: framectr.cxx:804
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &aURL, const OUString &aTargetFrameName, sal_Int32 nSearchFlags) override
Definition: framectr.cxx:249
VclPtr< vcl::Window > m_xLastQueriedFocusWin
Definition: framectr.hxx:71
virtual void SAL_CALL attachFrame(const css::uno::Reference< css::frame::XFrame > &xFrame) override
Definition: framectr.cxx:184
virtual css::uno::Reference< css::frame::XFrame > SAL_CALL getFrame() override
Definition: framectr.cxx:213
virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) override
Definition: framectr.cxx:195
virtual OUString SAL_CALL getImplementationName() override
Definition: framectr.cxx:167
virtual void SAL_CALL dispose() override
Definition: framectr.cxx:223
css::uno::Reference< css::awt::XWindow > m_xWindow
Definition: framectr.hxx:67
css::uno::Reference< css::frame::XFrame > m_xFrame
Definition: framectr.hxx:68
virtual css::uno::Reference< css::frame::XModel > SAL_CALL getModel() override
Definition: framectr.cxx:218
virtual ~BibFrameController_Impl() override
Definition: framectr.cxx:161
DECL_LINK(DisposeHdl, void *, void)
virtual css::uno::Sequence< ::sal_Int16 > SAL_CALL getSupportedCommandGroups() override
Definition: framectr.cxx:275
virtual css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation(::sal_Int16 CommandGroup) override
Definition: framectr.cxx:285
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &aDescripts) override
Definition: framectr.cxx:266
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: framectr.cxx:177
virtual sal_Bool SAL_CALL supportsService(const OUString &sServiceName) override
Definition: framectr.cxx:172
rtl::Reference< BibDataManager > m_xDatMan
Definition: framectr.hxx:70
virtual css::uno::Any SAL_CALL getViewData() override
Definition: framectr.cxx:204
virtual void SAL_CALL dispatch(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
Definition: framectr.cxx:374
virtual sal_Bool SAL_CALL attachModel(const css::uno::Reference< css::frame::XModel > &xModel) override
Definition: framectr.cxx:190
BibFrameController_Impl(css::uno::Reference< css::awt::XWindow > xComponent, BibDataManager *pDatMan)
Definition: framectr.cxx:151
BibStatusDispatchArr m_aStatusListeners
Definition: framectr.hxx:66
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: framectr.cxx:244
virtual void SAL_CALL restoreViewData(const css::uno::Any &Value) override
Definition: framectr.cxx:209
static bool SaveModified(const css::uno::Reference< css::form::runtime::XFormController > &xController)
Definition: framectr.cxx:322
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &xControl, const css::util::URL &aURL) override
Definition: framectr.cxx:741
css::uno::Reference< css::frame::XStatusListener > xListener
Definition: framectr.hxx:47
BibStatusDispatch(css::util::URL _aURL, css::uno::Reference< css::frame::XStatusListener > xRef)
Definition: framectr.hxx:48
css::util::URL aURL
Definition: framectr.hxx:46
std::vector< std::unique_ptr< BibStatusDispatch > > BibStatusDispatchArr
Definition: framectr.hxx:54
unsigned char sal_Bool