1*f8e07b45SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*f8e07b45SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*f8e07b45SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*f8e07b45SAndrew Rist * distributed with this work for additional information 6*f8e07b45SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*f8e07b45SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*f8e07b45SAndrew Rist * "License"); you may not use this file except in compliance 9*f8e07b45SAndrew Rist * with the License. You may obtain a copy of the License at 10*f8e07b45SAndrew Rist * 11*f8e07b45SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*f8e07b45SAndrew Rist * 13*f8e07b45SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*f8e07b45SAndrew Rist * software distributed under the License is distributed on an 15*f8e07b45SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*f8e07b45SAndrew Rist * KIND, either express or implied. See the License for the 17*f8e07b45SAndrew Rist * specific language governing permissions and limitations 18*f8e07b45SAndrew Rist * under the License. 19*f8e07b45SAndrew Rist * 20*f8e07b45SAndrew Rist *************************************************************/ 21*f8e07b45SAndrew Rist 22*f8e07b45SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef __FRAMEWORK_DISPATCH_INTERACTION_HXX_ 25cdf0e10cSrcweir #define __FRAMEWORK_DISPATCH_INTERACTION_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/task/XInteractionRequest.hpp> 28cdf0e10cSrcweir #include <com/sun/star/task/XInteractionContinuation.hpp> 29cdf0e10cSrcweir #include <com/sun/star/task/XInteractionAbort.hpp> 30cdf0e10cSrcweir #include <com/sun/star/task/XInteractionApprove.hpp> 31cdf0e10cSrcweir #include <com/sun/star/task/XInteractionDisapprove.hpp> 32cdf0e10cSrcweir #include <com/sun/star/task/XInteractionRetry.hpp> 33cdf0e10cSrcweir #include <com/sun/star/document/XInteractionFilterSelect.hpp> 34cdf0e10cSrcweir #include <com/sun/star/document/NoSuchFilterRequest.hpp> 35cdf0e10cSrcweir #include <com/sun/star/document/AmbigousFilterRequest.hpp> 36cdf0e10cSrcweir #include <com/sun/star/uno/RuntimeException.hpp> 37cdf0e10cSrcweir 38cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 39cdf0e10cSrcweir // includes of other projects 40cdf0e10cSrcweir //_________________________________________________________________________________________________________________ 41cdf0e10cSrcweir #include <rtl/ustring.hxx> 42cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx> 43cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx> 44cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx> 45cdf0e10cSrcweir #include <framework/fwedllapi.h> 46cdf0e10cSrcweir 47cdf0e10cSrcweir namespace framework{ 48cdf0e10cSrcweir 49cdf0e10cSrcweir /*-************************************************************************************************************//** 50cdf0e10cSrcweir @short special request for interaction to ask user for right filter 51cdf0e10cSrcweir @descr These helper can be used to ask user for right filter, if filter detection failed. 52cdf0e10cSrcweir It capsulate communication with any interaction handler and supports an easy 53cdf0e10cSrcweir access on interaction results for user of these class. 54cdf0e10cSrcweir Use it and forget complex mechanism of interaction ... 55cdf0e10cSrcweir 56cdf0e10cSrcweir @example RequestFilterSelect* pRequest = new RequestFilterSelect; 57cdf0e10cSrcweir Reference< XInteractionRequest > xRequest ( pRequest ); 58cdf0e10cSrcweir xInteractionHandler->handle( xRequest ); 59cdf0e10cSrcweir if( ! pRequest.isAbort() ) 60cdf0e10cSrcweir { 61cdf0e10cSrcweir OUString sFilter = pRequest->getFilter(); 62cdf0e10cSrcweir } 63cdf0e10cSrcweir 64cdf0e10cSrcweir @implements XInteractionRequest 65cdf0e10cSrcweir 66cdf0e10cSrcweir @base WeakImplHelper1 67cdf0e10cSrcweir 68cdf0e10cSrcweir @devstatus ready to use 69cdf0e10cSrcweir @threadsafe no (used on once position only!) 70cdf0e10cSrcweir *//*-*************************************************************************************************************/ 71cdf0e10cSrcweir class RequestFilterSelect_Impl; 72cdf0e10cSrcweir class FWE_DLLPUBLIC RequestFilterSelect 73cdf0e10cSrcweir { 74cdf0e10cSrcweir RequestFilterSelect_Impl* pImp; 75cdf0e10cSrcweir 76cdf0e10cSrcweir public: 77cdf0e10cSrcweir RequestFilterSelect( const ::rtl::OUString& sURL ); 78cdf0e10cSrcweir ~RequestFilterSelect(); 79cdf0e10cSrcweir sal_Bool isAbort () const; 80cdf0e10cSrcweir ::rtl::OUString getFilter() const; 81cdf0e10cSrcweir com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > GetRequest(); 82cdf0e10cSrcweir }; 83cdf0e10cSrcweir 84cdf0e10cSrcweir /*-************************************************************************************************************//** 85cdf0e10cSrcweir @short special request for interaction 86cdf0e10cSrcweir @descr User must decide between a preselected and another detected filter. 87cdf0e10cSrcweir It capsulate communication with any interaction handler and supports an easy 88cdf0e10cSrcweir access on interaction results for user of these class. 89cdf0e10cSrcweir 90cdf0e10cSrcweir @implements XInteractionRequest 91cdf0e10cSrcweir 92cdf0e10cSrcweir @base WeakImplHelper1 93cdf0e10cSrcweir 94cdf0e10cSrcweir @devstatus ready to use 95cdf0e10cSrcweir @threadsafe no (used on once position only!) 96cdf0e10cSrcweir *//*-*************************************************************************************************************/ 97cdf0e10cSrcweir class FWE_DLLPUBLIC InteractionRequest 98cdf0e10cSrcweir { 99cdf0e10cSrcweir public: 100cdf0e10cSrcweir static com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > 101cdf0e10cSrcweir CreateRequest( const ::com::sun::star::uno::Any& aRequest, 102cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > lContinuations ); 103cdf0e10cSrcweir }; 104cdf0e10cSrcweir 105cdf0e10cSrcweir /*-************************************************************************************************************//** 106cdf0e10cSrcweir @short special request for interaction 107cdf0e10cSrcweir @descr User must decide between a preselected and another detected filter. 108cdf0e10cSrcweir It capsulate communication with any interaction handler and supports an easy 109cdf0e10cSrcweir access on interaction results for user of these class. 110cdf0e10cSrcweir 111cdf0e10cSrcweir @implements XInteractionRequest 112cdf0e10cSrcweir 113cdf0e10cSrcweir @base WeakImplHelper1 114cdf0e10cSrcweir 115cdf0e10cSrcweir @devstatus ready to use 116cdf0e10cSrcweir @threadsafe no (used on once position only!) 117cdf0e10cSrcweir *//*-*************************************************************************************************************/ 118cdf0e10cSrcweir /* 119cdf0e10cSrcweir class RequestAmbigousFilter_Impl; 120cdf0e10cSrcweir class RequestAmbigousFilter // seems to be unused currently 121cdf0e10cSrcweir { 122cdf0e10cSrcweir RequestAmbigousFilter_Impl* pImp; 123cdf0e10cSrcweir 124cdf0e10cSrcweir // c++ interface 125cdf0e10cSrcweir public: 126cdf0e10cSrcweir RequestAmbigousFilter( const ::rtl::OUString& sURL, 127cdf0e10cSrcweir const ::rtl::OUString& sSelectedFilter , 128cdf0e10cSrcweir const ::rtl::OUString& sDetectedFilter ); 129cdf0e10cSrcweir ~RequestAmbigousFilter(); 130cdf0e10cSrcweir sal_Bool isAbort () const; 131cdf0e10cSrcweir ::rtl::OUString getFilter() const; 132cdf0e10cSrcweir com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > GetRequest(); 133cdf0e10cSrcweir }; 134cdf0e10cSrcweir */ 135cdf0e10cSrcweir 136cdf0e10cSrcweir } // namespace framework 137cdf0e10cSrcweir 138cdf0e10cSrcweir #endif // #define __FRAMEWORK_DISPATCH_INTERACTION_HXX_ 139