MyProtocolHandler.h (34dd1e25) MyProtocolHandler.h (b1c5b4ce)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 8 unchanged lines hidden (view full) ---

17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22#ifndef _MyProtocolHandler_HXX
23#define _MyProtocolHandler_HXX
24
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 8 unchanged lines hidden (view full) ---

17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22#ifndef _MyProtocolHandler_HXX
23#define _MyProtocolHandler_HXX
24
25#include <com/sun/star/uno/XComponentContext.hpp>
25#include <com/sun/star/awt/XToolkit.hpp>
26#include <com/sun/star/beans/NamedValue.hpp>
27#include <com/sun/star/lang/XInitialization.hpp>
28#include <com/sun/star/lang/XServiceInfo.hpp>
29#include <com/sun/star/frame/XDispatchProvider.hpp>
30#include <com/sun/star/frame/XControlNotificationListener.hpp>
31#include <cppuhelper/implbase2.hxx>
32#include <cppuhelper/implbase3.hxx>

--- 20 unchanged lines hidden (view full) ---

53class MyProtocolHandler : public cppu::WeakImplHelper3
54<
55 com::sun::star::frame::XDispatchProvider,
56 com::sun::star::lang::XInitialization,
57 com::sun::star::lang::XServiceInfo
58>
59{
60private:
26#include <com/sun/star/awt/XToolkit.hpp>
27#include <com/sun/star/beans/NamedValue.hpp>
28#include <com/sun/star/lang/XInitialization.hpp>
29#include <com/sun/star/lang/XServiceInfo.hpp>
30#include <com/sun/star/frame/XDispatchProvider.hpp>
31#include <com/sun/star/frame/XControlNotificationListener.hpp>
32#include <cppuhelper/implbase2.hxx>
33#include <cppuhelper/implbase3.hxx>

--- 20 unchanged lines hidden (view full) ---

54class MyProtocolHandler : public cppu::WeakImplHelper3
55<
56 com::sun::star::frame::XDispatchProvider,
57 com::sun::star::lang::XInitialization,
58 com::sun::star::lang::XServiceInfo
59>
60{
61private:
61 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
62 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
62 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
63
64public:
63 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
64
65public:
65 MyProtocolHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF)
66 : mxMSF( rxMSF ) {}
66 MyProtocolHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
67 : mxContext( rxContext ) {}
67
68 // XDispatchProvider
69 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
70 SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL,
71 const ::rtl::OUString& sTargetFrameName, sal_Int32 nSearchFlags )
72 throw( ::com::sun::star::uno::RuntimeException );
73 virtual ::com::sun::star::uno::Sequence < ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > >
74 SAL_CALL queryDispatches(

--- 18 unchanged lines hidden (view full) ---

93
94sal_Bool SAL_CALL MyProtocolHandler_supportsService( const ::rtl::OUString& ServiceName )
95 throw ( ::com::sun::star::uno::RuntimeException );
96
97::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL MyProtocolHandler_getSupportedServiceNames( )
98 throw ( ::com::sun::star::uno::RuntimeException );
99
100::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
68
69 // XDispatchProvider
70 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >
71 SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL,
72 const ::rtl::OUString& sTargetFrameName, sal_Int32 nSearchFlags )
73 throw( ::com::sun::star::uno::RuntimeException );
74 virtual ::com::sun::star::uno::Sequence < ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > >
75 SAL_CALL queryDispatches(

--- 18 unchanged lines hidden (view full) ---

94
95sal_Bool SAL_CALL MyProtocolHandler_supportsService( const ::rtl::OUString& ServiceName )
96 throw ( ::com::sun::star::uno::RuntimeException );
97
98::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL MyProtocolHandler_getSupportedServiceNames( )
99 throw ( ::com::sun::star::uno::RuntimeException );
100
101::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
101SAL_CALL MyProtocolHandler_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr)
102SAL_CALL MyProtocolHandler_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rContext)
102 throw ( ::com::sun::star::uno::Exception );
103
104class BaseDispatch : public cppu::WeakImplHelper2
105<
106 ::com::sun::star::frame::XDispatch,
107 ::com::sun::star::frame::XControlNotificationListener
108>
109{
110protected:
111 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
103 throw ( ::com::sun::star::uno::Exception );
104
105class BaseDispatch : public cppu::WeakImplHelper2
106<
107 ::com::sun::star::frame::XDispatch,
108 ::com::sun::star::frame::XControlNotificationListener
109>
110{
111protected:
112 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
112 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
113 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
113 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > mxToolkit;
114 ::rtl::OUString msDocService;
115 ::rtl::OUString maComboBoxText;
116 sal_Bool mbButtonEnabled;
117
118public:
114 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > mxToolkit;
115 ::rtl::OUString msDocService;
116 ::rtl::OUString maComboBoxText;
117 sal_Bool mbButtonEnabled;
118
119public:
119 BaseDispatch( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF,
120 BaseDispatch( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext,
120 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const ::rtl::OUString& rServiceName );
121
122 virtual ~BaseDispatch();
123
124 void ShowMessageBox( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aTitle, const ::rtl::OUString& aMsgText );
125 void SendCommand( const com::sun::star::util::URL& aURL, const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rArgs, sal_Bool bEnabled );
126 void SendCommandTo( const com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener >& xControl, const com::sun::star::util::URL& aURL, const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rArgs, sal_Bool bEnabled );
127

--- 9 unchanged lines hidden (view full) ---

137 // XControlNotificationListener
138 virtual void SAL_CALL controlEvent( const ::com::sun::star::frame::ControlEvent& Event )
139 throw (::com::sun::star::uno::RuntimeException);
140};
141
142class WriterDispatch : public BaseDispatch
143{
144public:
121 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame, const ::rtl::OUString& rServiceName );
122
123 virtual ~BaseDispatch();
124
125 void ShowMessageBox( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aTitle, const ::rtl::OUString& aMsgText );
126 void SendCommand( const com::sun::star::util::URL& aURL, const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rArgs, sal_Bool bEnabled );
127 void SendCommandTo( const com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener >& xControl, const com::sun::star::util::URL& aURL, const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rArgs, sal_Bool bEnabled );
128

--- 9 unchanged lines hidden (view full) ---

138 // XControlNotificationListener
139 virtual void SAL_CALL controlEvent( const ::com::sun::star::frame::ControlEvent& Event )
140 throw (::com::sun::star::uno::RuntimeException);
141};
142
143class WriterDispatch : public BaseDispatch
144{
145public:
145 WriterDispatch( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF,
146 WriterDispatch( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext,
146 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame )
147 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame )
147 : BaseDispatch( rxMSF, xFrame, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) )
148 : BaseDispatch( rxContext, xFrame, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) )
148 {}
149};
150
151class CalcDispatch : public BaseDispatch
152{
153public:
149 {}
150};
151
152class CalcDispatch : public BaseDispatch
153{
154public:
154 CalcDispatch( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF,
155 CalcDispatch( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext,
155 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame )
156 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame )
156 : BaseDispatch( rxMSF, xFrame, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadSheetDocument" ) ) )
157 : BaseDispatch( rxContext, xFrame, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadSheetDocument" ) ) )
157 {}
158};
159
160#endif
158 {}
159};
160
161#endif