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 :
20 : #ifndef INCLUDED_EXTENSIONS_SOURCE_BIBLIOGRAPHY_FRAMECTR_HXX
21 : #define INCLUDED_EXTENSIONS_SOURCE_BIBLIOGRAPHY_FRAMECTR_HXX
22 : #include <com/sun/star/beans/XPropertyChangeListener.hpp>
23 : #include <com/sun/star/frame/XDispatchProvider.hpp>
24 : #include <com/sun/star/frame/XController.hpp>
25 : #include <com/sun/star/frame/XDispatch.hpp>
26 : #include <com/sun/star/form/XLoadable.hpp>
27 : #include <com/sun/star/lang/XServiceInfo.hpp>
28 : #include <com/sun/star/frame/XDispatchInformationProvider.hpp>
29 : #include <cppuhelper/implbase5.hxx>
30 : #include <boost/ptr_container/ptr_vector.hpp>
31 :
32 : #include "bibmod.hxx"
33 : class BibDataManager;
34 : class BibFrameCtrl_Impl;
35 : namespace com{namespace sun{namespace star{
36 : namespace form { namespace runtime {
37 : class XFormController;
38 : } }
39 : }}}
40 0 : class BibStatusDispatch
41 : {
42 : public:
43 : ::com::sun::star::util::URL aURL;
44 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > xListener;
45 0 : BibStatusDispatch( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > xRef )
46 : : aURL( rURL )
47 0 : , xListener( xRef )
48 0 : {}
49 : };
50 :
51 : typedef boost::ptr_vector<BibStatusDispatch> BibStatusDispatchArr;
52 :
53 : class BibFrameController_Impl : public cppu::WeakImplHelper5 <
54 : ::com::sun::star::lang::XServiceInfo,
55 : ::com::sun::star::frame::XController,
56 : ::com::sun::star::frame::XDispatch,
57 : ::com::sun::star::frame::XDispatchProvider,
58 : ::com::sun::star::frame::XDispatchInformationProvider
59 : >
60 : {
61 : friend class BibFrameCtrl_Impl;
62 : BibFrameCtrl_Impl* pImp;
63 : BibStatusDispatchArr aStatusListeners;
64 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xWindow;
65 : ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame;
66 : bool bDisposing;
67 : bool bHierarchical;
68 : ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable > m_xDatMan;
69 : BibDataManager* pDatMan;
70 : HdlBibModul pBibMod;
71 :
72 : DECL_STATIC_LINK( BibFrameController_Impl, DisposeHdl, void* );
73 :
74 : bool SaveModified(const ::com::sun::star::uno::Reference< ::com::sun::star::form::runtime::XFormController>& xController);
75 : public:
76 : BibFrameController_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > & xComponent,
77 : BibDataManager* pDatMan);
78 : virtual ~BibFrameController_Impl();
79 :
80 :
81 : void activate();
82 : void deactivate();
83 :
84 : void ChangeDataSource(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs);
85 : void RemoveFilter();
86 :
87 : // ::com::sun::star::lang::XServiceInfo
88 : virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
89 : virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
90 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
91 :
92 : // ::com::sun::star::frame::XController
93 : virtual void SAL_CALL attachFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & xFrame ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
94 : 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;
95 : virtual sal_Bool SAL_CALL suspend( sal_Bool bSuspend ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
96 : virtual ::com::sun::star::uno::Any SAL_CALL getViewData() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
97 : virtual void SAL_CALL restoreViewData( const ::com::sun::star::uno::Any& Value ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
98 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL getFrame() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
99 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SAL_CALL getModel() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
100 :
101 : // ::com::sun::star::lang::XComponent
102 : virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
103 : virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
104 : virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
105 :
106 : // ::com::sun::star::frame::XDispatchProvider
107 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
108 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches( const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& aDescripts) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
109 :
110 : //class ::com::sun::star::frame::XDispatch
111 : virtual void SAL_CALL dispatch(const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs)
112 : throw (::com::sun::star::uno::RuntimeException,
113 : std::exception) SAL_OVERRIDE;
114 : virtual void SAL_CALL addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL)
115 : throw (::com::sun::star::uno::RuntimeException,
116 : std::exception) SAL_OVERRIDE;
117 : virtual void SAL_CALL removeStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & xControl, const ::com::sun::star::util::URL& aURL) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
118 :
119 : // ::com::sun::star::frame::XDispatchInformationProvider
120 : virtual ::com::sun::star::uno::Sequence< ::sal_Int16 > SAL_CALL getSupportedCommandGroups( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
121 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation( ::sal_Int16 CommandGroup ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
122 : };
123 :
124 : #endif
125 :
126 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|