use insert function instead of for loop
[LibreOffice.git] / extensions / source / bibliography / framectr.hxx
blob9aac2cee0dab75c1e70e8520a20fa632ef67638b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
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>
27 #include <cppuhelper/implbase.hxx>
28 #include <rtl/ref.hxx>
29 #include <tools/link.hxx>
30 #include <utility>
31 #include <vcl/window.hxx>
32 #include <vector>
33 #include <memory>
35 #include "bibmod.hxx"
36 class BibDataManager;
37 class BibFrameCtrl_Impl;
38 namespace com::sun::star{
39 namespace form::runtime {
40 class XFormController;
43 class BibStatusDispatch
45 public:
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 ))
54 typedef std::vector<std::unique_ptr<BibStatusDispatch> > BibStatusDispatchArr;
56 class 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
64 friend class BibFrameCtrl_Impl;
65 rtl::Reference<BibFrameCtrl_Impl> m_xImpl;
66 BibStatusDispatchArr m_aStatusListeners;
67 css::uno::Reference< css::awt::XWindow > m_xWindow;
68 css::uno::Reference< css::frame::XFrame > m_xFrame;
69 bool m_bDisposing;
70 rtl::Reference<BibDataManager> m_xDatMan;
71 VclPtr<vcl::Window> m_xLastQueriedFocusWin;
73 DECL_LINK( DisposeHdl, void*, void );
75 static bool SaveModified(const css::uno::Reference< css::form::runtime::XFormController>& xController);
76 public:
77 BibFrameController_Impl( css::uno::Reference< css::awt::XWindow > xComponent,
78 BibDataManager* pDatMan);
79 virtual ~BibFrameController_Impl() override;
82 void ChangeDataSource(const css::uno::Sequence< css::beans::PropertyValue >& aArgs);
83 void RemoveFilter();
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;
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;
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;
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;
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;
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;
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */