Simplify InteractionContinuation and derivatives
Change-Id: Ib7294cc09255f7563ae14488ab7fb56d02092dc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178117 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
parent
a1b8b44bf9
commit
e512091e89
13 changed files with 60 additions and 520 deletions
|
@ -130,7 +130,7 @@ public:
|
|||
* method the way that they simply call recordSelection() which is provided by
|
||||
* this class.
|
||||
*/
|
||||
class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionContinuation : public cppu::OWeakObject
|
||||
class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionContinuation : public cppu::WeakImplHelper<>
|
||||
{
|
||||
InteractionRequest* m_pRequest;
|
||||
|
||||
|
@ -150,138 +150,84 @@ public:
|
|||
};
|
||||
|
||||
|
||||
using InteractionAbort_BASE = cppu::ImplInheritanceHelper<InteractionContinuation,
|
||||
css::task::XInteractionAbort>;
|
||||
/**
|
||||
* This class implements a standard interaction continuation, namely the
|
||||
* interface XInteractionAbort. Instances of this class can be passed
|
||||
* along with an interaction request to indicate the possibility to abort
|
||||
* the operation that caused the request.
|
||||
*/
|
||||
class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionAbort final : public InteractionContinuation,
|
||||
public css::lang::XTypeProvider,
|
||||
public css::task::XInteractionAbort
|
||||
class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionAbort final : public InteractionAbort_BASE
|
||||
{
|
||||
public:
|
||||
InteractionAbort( InteractionRequest * pRequest )
|
||||
: InteractionContinuation( pRequest ) {}
|
||||
|
||||
// XInterface
|
||||
virtual css::uno::Any SAL_CALL
|
||||
queryInterface( const css::uno::Type & rType ) override;
|
||||
virtual void SAL_CALL acquire() noexcept override
|
||||
{ OWeakObject::acquire(); }
|
||||
virtual void SAL_CALL release() noexcept override
|
||||
{ OWeakObject::release(); }
|
||||
|
||||
// XTypeProvider
|
||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL
|
||||
getTypes() override;
|
||||
virtual css::uno::Sequence< sal_Int8 > SAL_CALL
|
||||
getImplementationId() override;
|
||||
: InteractionAbort_BASE( pRequest ) {}
|
||||
|
||||
// XInteractionContinuation
|
||||
virtual void SAL_CALL select() override;
|
||||
};
|
||||
|
||||
|
||||
using InteractionRetry_BASE = cppu::ImplInheritanceHelper<InteractionContinuation,
|
||||
css::task::XInteractionRetry>;
|
||||
/**
|
||||
* This class implements a standard interaction continuation, namely the
|
||||
* interface XInteractionRetry. Instances of this class can be passed
|
||||
* along with an interaction request to indicate the possibility to retry
|
||||
* the operation that caused the request.
|
||||
*/
|
||||
class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionRetry final : public InteractionContinuation,
|
||||
public css::lang::XTypeProvider,
|
||||
public css::task::XInteractionRetry
|
||||
class UNLESS_MERGELIBS(UCBHELPER_DLLPUBLIC) InteractionRetry final : public InteractionRetry_BASE
|
||||
{
|
||||
public:
|
||||
InteractionRetry( InteractionRequest * pRequest )
|
||||
: InteractionContinuation( pRequest ) {}
|
||||
|
||||
// XInterface
|
||||
virtual css::uno::Any SAL_CALL
|
||||
queryInterface( const css::uno::Type & rType ) override;
|
||||
virtual void SAL_CALL acquire() noexcept override
|
||||
{ OWeakObject::acquire(); }
|
||||
virtual void SAL_CALL release() noexcept override
|
||||
{ OWeakObject::release(); }
|
||||
|
||||
// XTypeProvider
|
||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL
|
||||
getTypes() override;
|
||||
virtual css::uno::Sequence< sal_Int8 > SAL_CALL
|
||||
getImplementationId() override;
|
||||
: InteractionRetry_BASE( pRequest ) {}
|
||||
|
||||
// XInteractionContinuation
|
||||
virtual void SAL_CALL select() override;
|
||||
};
|
||||
|
||||
|
||||
using InteractionApprove_BASE = cppu::ImplInheritanceHelper<InteractionContinuation,
|
||||
css::task::XInteractionApprove>;
|
||||
/**
|
||||
* This class implements a standard interaction continuation, namely the
|
||||
* interface XInteractionApprove. Instances of this class can be passed
|
||||
* along with an interaction request to indicate the possibility to approve
|
||||
* the request.
|
||||
*/
|
||||
class UCBHELPER_DLLPUBLIC InteractionApprove final : public InteractionContinuation,
|
||||
public css::lang::XTypeProvider,
|
||||
public css::task::XInteractionApprove
|
||||
class UCBHELPER_DLLPUBLIC InteractionApprove final : public InteractionApprove_BASE
|
||||
{
|
||||
public:
|
||||
InteractionApprove( InteractionRequest * pRequest )
|
||||
: InteractionContinuation( pRequest ) {}
|
||||
|
||||
// XInterface
|
||||
virtual css::uno::Any SAL_CALL
|
||||
queryInterface( const css::uno::Type & rType ) override;
|
||||
virtual void SAL_CALL acquire() noexcept override
|
||||
{ OWeakObject::acquire(); }
|
||||
virtual void SAL_CALL release() noexcept override
|
||||
{ OWeakObject::release(); }
|
||||
|
||||
// XTypeProvider
|
||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL
|
||||
getTypes() override;
|
||||
virtual css::uno::Sequence< sal_Int8 > SAL_CALL
|
||||
getImplementationId() override;
|
||||
: InteractionApprove_BASE( pRequest ) {}
|
||||
|
||||
// XInteractionContinuation
|
||||
virtual void SAL_CALL select() override;
|
||||
};
|
||||
|
||||
|
||||
using InteractionDisapprove_BASE = cppu::ImplInheritanceHelper<InteractionContinuation,
|
||||
css::task::XInteractionDisapprove>;
|
||||
/**
|
||||
* This class implements a standard interaction continuation, namely the
|
||||
* interface XInteractionDisapprove. Instances of this class can be passed
|
||||
* along with an interaction request to indicate the possibility to disapprove
|
||||
* the request.
|
||||
*/
|
||||
class UCBHELPER_DLLPUBLIC InteractionDisapprove final : public InteractionContinuation,
|
||||
public css::lang::XTypeProvider,
|
||||
public css::task::XInteractionDisapprove
|
||||
class UCBHELPER_DLLPUBLIC InteractionDisapprove final : public InteractionDisapprove_BASE
|
||||
{
|
||||
public:
|
||||
InteractionDisapprove( InteractionRequest * pRequest )
|
||||
: InteractionContinuation( pRequest ) {}
|
||||
|
||||
// XInterface
|
||||
virtual css::uno::Any SAL_CALL
|
||||
queryInterface( const css::uno::Type & rType ) override;
|
||||
virtual void SAL_CALL acquire() noexcept override
|
||||
{ OWeakObject::acquire(); }
|
||||
virtual void SAL_CALL release() noexcept override
|
||||
{ OWeakObject::release(); }
|
||||
|
||||
// XTypeProvider
|
||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL
|
||||
getTypes() override;
|
||||
virtual css::uno::Sequence< sal_Int8 > SAL_CALL
|
||||
getImplementationId() override;
|
||||
: InteractionDisapprove_BASE( pRequest ) {}
|
||||
|
||||
// XInteractionContinuation
|
||||
virtual void SAL_CALL select() override;
|
||||
};
|
||||
|
||||
|
||||
using InteractionSupplyAuthentication_BASE = cppu::ImplInheritanceHelper<InteractionContinuation,
|
||||
css::ucb::XInteractionSupplyAuthentication2>;
|
||||
/**
|
||||
* This class implements a standard interaction continuation, namely the
|
||||
* interface XInteractionSupplyAuthentication. Instances of this class can be
|
||||
|
@ -289,9 +235,7 @@ public:
|
|||
* interaction handler to supply the missing authentication data.
|
||||
*/
|
||||
class UCBHELPER_DLLPUBLIC InteractionSupplyAuthentication final :
|
||||
public InteractionContinuation,
|
||||
public css::lang::XTypeProvider,
|
||||
public css::ucb::XInteractionSupplyAuthentication2
|
||||
public InteractionSupplyAuthentication_BASE
|
||||
{
|
||||
css::uno::Sequence< css::ucb::RememberAuthentication >
|
||||
m_aRememberPasswordModes;
|
||||
|
@ -355,20 +299,6 @@ public:
|
|||
const css::ucb::RememberAuthentication eDefaultRememberAccountMode,
|
||||
bool bCanUseSystemCredentials );
|
||||
|
||||
// XInterface
|
||||
virtual css::uno::Any SAL_CALL
|
||||
queryInterface( const css::uno::Type & rType ) override;
|
||||
virtual void SAL_CALL acquire() noexcept override
|
||||
{ OWeakObject::acquire(); }
|
||||
virtual void SAL_CALL release() noexcept override
|
||||
{ OWeakObject::release(); }
|
||||
|
||||
// XTypeProvider
|
||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL
|
||||
getTypes() override;
|
||||
virtual css::uno::Sequence< sal_Int8 > SAL_CALL
|
||||
getImplementationId() override;
|
||||
|
||||
// XInteractionContinuation
|
||||
virtual void SAL_CALL select() override;
|
||||
|
||||
|
@ -461,7 +391,7 @@ inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
|
|||
const css::uno::Sequence< css::ucb::RememberAuthentication > & rRememberAccountModes,
|
||||
const css::ucb::RememberAuthentication eDefaultRememberAccountMode,
|
||||
bool bCanUseSystemCredentials )
|
||||
: InteractionContinuation( pRequest ),
|
||||
: InteractionSupplyAuthentication_BASE( pRequest ),
|
||||
m_aRememberPasswordModes( rRememberPasswordModes ),
|
||||
m_aRememberAccountModes( rRememberAccountModes ),
|
||||
m_eRememberPasswordMode( eDefaultRememberPasswordMode ),
|
||||
|
@ -477,6 +407,8 @@ inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
|
|||
}
|
||||
|
||||
|
||||
using InteractionReplaceExistingData_BASE = cppu::ImplInheritanceHelper<InteractionContinuation,
|
||||
css::ucb::XInteractionReplaceExistingData>;
|
||||
/**
|
||||
* This class implements a standard interaction continuation, namely the
|
||||
* interface XInteractionReplaceExistingData. Instances of this class can be
|
||||
|
@ -484,49 +416,26 @@ inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
|
|||
* replace existing data.
|
||||
*/
|
||||
class InteractionReplaceExistingData final :
|
||||
public InteractionContinuation,
|
||||
public css::lang::XTypeProvider,
|
||||
public css::ucb::XInteractionReplaceExistingData
|
||||
public InteractionReplaceExistingData_BASE
|
||||
{
|
||||
public:
|
||||
InteractionReplaceExistingData( InteractionRequest * pRequest )
|
||||
: InteractionContinuation( pRequest ) {}
|
||||
|
||||
// XInterface
|
||||
virtual css::uno::Any SAL_CALL
|
||||
queryInterface( const css::uno::Type & rType ) override;
|
||||
virtual void SAL_CALL acquire() noexcept override
|
||||
{ OWeakObject::acquire(); }
|
||||
virtual void SAL_CALL release() noexcept override
|
||||
{ OWeakObject::release(); }
|
||||
|
||||
// XTypeProvider
|
||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL
|
||||
getTypes() override;
|
||||
virtual css::uno::Sequence< sal_Int8 > SAL_CALL
|
||||
getImplementationId() override;
|
||||
: InteractionReplaceExistingData_BASE( pRequest ) {}
|
||||
|
||||
// XInteractionContinuation
|
||||
virtual void SAL_CALL select() override;
|
||||
};
|
||||
|
||||
using InteractionAuthFallback_BASE = cppu::ImplInheritanceHelper<InteractionContinuation,
|
||||
css::ucb::XInteractionAuthFallback>;
|
||||
class UCBHELPER_DLLPUBLIC InteractionAuthFallback final :
|
||||
public InteractionContinuation,
|
||||
public css::ucb::XInteractionAuthFallback
|
||||
public InteractionAuthFallback_BASE
|
||||
{
|
||||
OUString m_aCode;
|
||||
|
||||
public:
|
||||
InteractionAuthFallback( InteractionRequest * pRequest )
|
||||
: InteractionContinuation( pRequest ) {}
|
||||
|
||||
// XInterface
|
||||
virtual css::uno::Any SAL_CALL
|
||||
queryInterface( const css::uno::Type & rType ) override;
|
||||
virtual void SAL_CALL acquire() noexcept override
|
||||
{ OWeakObject::acquire(); }
|
||||
virtual void SAL_CALL release() noexcept override
|
||||
{ OWeakObject::release(); }
|
||||
: InteractionAuthFallback_BASE( pRequest ) {}
|
||||
|
||||
// XInteractionContinuation
|
||||
virtual void SAL_CALL select() override;
|
||||
|
@ -535,8 +444,6 @@ public:
|
|||
virtual void SAL_CALL setCode( const OUString& code ) override;
|
||||
/// @throws css::uno::RuntimeException
|
||||
const OUString& getCode() const;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -589,7 +589,7 @@ void SfxMedium::CheckFileDate( const util::DateTime& aInitDate )
|
|||
xHandler->handle( xInteractionRequestImpl );
|
||||
|
||||
::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection();
|
||||
if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() )
|
||||
if ( uno::Reference< task::XInteractionAbort >( cppu::getXWeak(xSelected.get()), uno::UNO_QUERY ).is() )
|
||||
{
|
||||
SetError(ERRCODE_ABORT);
|
||||
}
|
||||
|
@ -1170,11 +1170,11 @@ SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog(const LockFileEntr
|
|||
|
||||
bool bOpenReadOnly = false;
|
||||
::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xInteractionRequestImpl->getSelection();
|
||||
if ( uno::Reference< task::XInteractionAbort >( xSelected.get(), uno::UNO_QUERY ).is() )
|
||||
if ( uno::Reference< task::XInteractionAbort >( cppu::getXWeak(xSelected.get()), uno::UNO_QUERY ).is() )
|
||||
{
|
||||
SetError(ERRCODE_ABORT);
|
||||
}
|
||||
else if ( uno::Reference< task::XInteractionDisapprove >( xSelected.get(), uno::UNO_QUERY ).is() )
|
||||
else if ( uno::Reference< task::XInteractionDisapprove >( cppu::getXWeak(xSelected.get()), uno::UNO_QUERY ).is() )
|
||||
{
|
||||
// own lock on loading, user has selected to ignore the lock
|
||||
// own lock on saving, user has selected to ignore the lock
|
||||
|
@ -1188,12 +1188,12 @@ SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog(const LockFileEntr
|
|||
else
|
||||
nResult = ShowLockResult::Succeeded;
|
||||
}
|
||||
else if (uno::Reference< task::XInteractionRetry >(xSelected.get(), uno::UNO_QUERY).is())
|
||||
else if (uno::Reference< task::XInteractionRetry >(cppu::getXWeak(xSelected.get()), uno::UNO_QUERY).is())
|
||||
{
|
||||
// User decided to ignore the alien (stale?) lock file without filesystem lock
|
||||
nResult = ShowLockResult::Succeeded;
|
||||
}
|
||||
else if (uno::Reference< task::XInteractionApprove >( xSelected.get(), uno::UNO_QUERY ).is())
|
||||
else if (uno::Reference< task::XInteractionApprove >( cppu::getXWeak(xSelected.get()), uno::UNO_QUERY ).is())
|
||||
{
|
||||
bOpenReadOnly = true;
|
||||
}
|
||||
|
@ -1264,12 +1264,12 @@ bool SfxMedium::ShowLockFileProblemDialog(MessageDlg nWhichDlg)
|
|||
::rtl::Reference< ::ucbhelper::InteractionContinuation > xSelected = xIgnoreRequestImpl->getSelection();
|
||||
bool bReadOnly = true;
|
||||
|
||||
if (uno::Reference<task::XInteractionAbort>(xSelected.get(), uno::UNO_QUERY).is())
|
||||
if (uno::Reference<task::XInteractionAbort>(cppu::getXWeak(xSelected.get()), uno::UNO_QUERY).is())
|
||||
{
|
||||
SetError(ERRCODE_ABORT);
|
||||
bReadOnly = false;
|
||||
}
|
||||
else if (!uno::Reference<task::XInteractionApprove>(xSelected.get(), uno::UNO_QUERY).is())
|
||||
else if (!uno::Reference<task::XInteractionApprove>(cppu::getXWeak(xSelected.get()), uno::UNO_QUERY).is())
|
||||
{
|
||||
// user selected "Notify"
|
||||
pImpl->m_bNotifyWhenEditable = true;
|
||||
|
@ -4940,7 +4940,7 @@ IMPL_STATIC_LINK(SfxMedium, ShowReloadEditableDialog, void*, p, void)
|
|||
xHandler->handle(xInteractionRequestImpl);
|
||||
::rtl::Reference<::ucbhelper::InteractionContinuation> xSelected
|
||||
= xInteractionRequestImpl->getSelection();
|
||||
if (uno::Reference<task::XInteractionApprove>(xSelected.get(), uno::UNO_QUERY).is())
|
||||
if (uno::Reference<task::XInteractionApprove>(cppu::getXWeak(xSelected.get()), uno::UNO_QUERY).is())
|
||||
{
|
||||
for (SfxViewFrame* pFrame = SfxViewFrame::GetFirst(); pFrame;
|
||||
pFrame = SfxViewFrame::GetNext(*pFrame))
|
||||
|
|
|
@ -828,7 +828,7 @@ OUString PasswordContainer::RequestPasswordFromUser( PasswordRequestMode aRMode,
|
|||
|
||||
if ( xSelection.is() )
|
||||
{
|
||||
Reference< XInteractionAbort > xAbort( xSelection.get(), UNO_QUERY );
|
||||
Reference< XInteractionAbort > xAbort( xSelection->getXWeak(), UNO_QUERY );
|
||||
if ( !xAbort.is() )
|
||||
{
|
||||
const ::rtl::Reference< ucbhelper::InteractionSupplyAuthentication > & xSupp
|
||||
|
|
|
@ -376,7 +376,7 @@ NameClashContinuation interactiveNameClashResolve(
|
|||
{
|
||||
// Handler handled the request.
|
||||
uno::Reference< task::XInteractionAbort > xAbort(
|
||||
xSelection.get(), uno::UNO_QUERY );
|
||||
xSelection->getXWeak(), uno::UNO_QUERY );
|
||||
if ( xAbort.is() )
|
||||
{
|
||||
// Abort.
|
||||
|
@ -387,7 +387,7 @@ NameClashContinuation interactiveNameClashResolve(
|
|||
uno::Reference<
|
||||
ucb::XInteractionReplaceExistingData >
|
||||
xReplace(
|
||||
xSelection.get(), uno::UNO_QUERY );
|
||||
xSelection->getXWeak(), uno::UNO_QUERY );
|
||||
if ( xReplace.is() )
|
||||
{
|
||||
// Try again: Replace existing data.
|
||||
|
@ -398,7 +398,7 @@ NameClashContinuation interactiveNameClashResolve(
|
|||
uno::Reference<
|
||||
ucb::XInteractionSupplyName >
|
||||
xSupplyName(
|
||||
xSelection.get(), uno::UNO_QUERY );
|
||||
xSelection->getXWeak(), uno::UNO_QUERY );
|
||||
if ( xSupplyName.is() )
|
||||
{
|
||||
// Try again: Use new name.
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace cmis
|
|||
{
|
||||
// Handler handled the request.
|
||||
uno::Reference< task::XInteractionAbort > xAbort(
|
||||
xSelection.get(), uno::UNO_QUERY );
|
||||
xSelection->getXWeak(), uno::UNO_QUERY );
|
||||
if ( !xAbort.is() )
|
||||
{
|
||||
const rtl::Reference<
|
||||
|
@ -91,7 +91,7 @@ namespace cmis
|
|||
if (xSelection.is())
|
||||
{
|
||||
// Handler handled the request.
|
||||
uno::Reference<task::XInteractionAbort> xAbort(xSelection.get(),
|
||||
uno::Reference<task::XInteractionAbort> xAbort(xSelection->getXWeak(),
|
||||
uno::UNO_QUERY);
|
||||
if (!xAbort.is())
|
||||
{
|
||||
|
|
|
@ -157,7 +157,7 @@ static void ooo_mount_operation_ask_password (GMountOperation *op,
|
|||
return;
|
||||
}
|
||||
|
||||
css::uno::Reference< css::task::XInteractionAbort > xAbort(xSelection.get(), css::uno::UNO_QUERY );
|
||||
css::uno::Reference< css::task::XInteractionAbort > xAbort(xSelection->getXWeak(), css::uno::UNO_QUERY );
|
||||
if ( xAbort.is() )
|
||||
{
|
||||
g_mount_operation_reply (op, G_MOUNT_OPERATION_ABORTED);
|
||||
|
|
|
@ -2627,7 +2627,7 @@ static OUString obtainPassword(
|
|||
{
|
||||
// Handler handled the request.
|
||||
uno::Reference< task::XInteractionAbort > xAbort(
|
||||
xSelection.get(), uno::UNO_QUERY );
|
||||
xSelection->getXWeak(), uno::UNO_QUERY );
|
||||
if ( xAbort.is() )
|
||||
{
|
||||
throw ucb::CommandFailedException(
|
||||
|
@ -2637,7 +2637,7 @@ static OUString obtainPassword(
|
|||
}
|
||||
|
||||
uno::Reference< task::XInteractionPassword > xPassword(
|
||||
xSelection.get(), uno::UNO_QUERY );
|
||||
xSelection->getXWeak(), uno::UNO_QUERY );
|
||||
if ( xPassword.is() )
|
||||
{
|
||||
return xPassword->getPassword();
|
||||
|
|
|
@ -37,25 +37,13 @@ namespace tdoc_ucp
|
|||
{
|
||||
namespace {
|
||||
|
||||
class InteractionSupplyPassword :
|
||||
public ucbhelper::InteractionContinuation,
|
||||
public lang::XTypeProvider,
|
||||
public task::XInteractionPassword
|
||||
using InteractionSupplyPassword_BASE = cppu::ImplInheritanceHelper<ucbhelper::InteractionContinuation,
|
||||
task::XInteractionPassword>;
|
||||
class InteractionSupplyPassword : public InteractionSupplyPassword_BASE
|
||||
{
|
||||
public:
|
||||
explicit InteractionSupplyPassword( ucbhelper::InteractionRequest * pRequest )
|
||||
: InteractionContinuation( pRequest ) {}
|
||||
|
||||
// XInterface
|
||||
virtual uno::Any SAL_CALL queryInterface( const uno::Type & rType ) override;
|
||||
virtual void SAL_CALL acquire()
|
||||
noexcept override;
|
||||
virtual void SAL_CALL release()
|
||||
noexcept override;
|
||||
|
||||
// XTypeProvider
|
||||
virtual uno::Sequence< uno::Type > SAL_CALL getTypes() override;
|
||||
virtual uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
|
||||
: InteractionSupplyPassword_BASE( pRequest ) {}
|
||||
|
||||
// XInteractionContinuation
|
||||
virtual void SAL_CALL select() override;
|
||||
|
@ -76,61 +64,6 @@ namespace tdoc_ucp
|
|||
// InteractionSupplyPassword Implementation.
|
||||
|
||||
|
||||
// XInterface methods.
|
||||
|
||||
|
||||
// virtual
|
||||
void SAL_CALL InteractionSupplyPassword::acquire()
|
||||
noexcept
|
||||
{
|
||||
OWeakObject::acquire();
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
void SAL_CALL InteractionSupplyPassword::release()
|
||||
noexcept
|
||||
{
|
||||
OWeakObject::release();
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Any SAL_CALL
|
||||
InteractionSupplyPassword::queryInterface( const uno::Type & rType )
|
||||
{
|
||||
uno::Any aRet = cppu::queryInterface( rType,
|
||||
static_cast< lang::XTypeProvider * >( this ),
|
||||
static_cast< task::XInteractionContinuation * >( this ),
|
||||
static_cast< task::XInteractionPassword * >( this ) );
|
||||
|
||||
return aRet.hasValue()
|
||||
? aRet : InteractionContinuation::queryInterface( rType );
|
||||
}
|
||||
|
||||
|
||||
// XTypeProvider methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< sal_Int8 > SAL_CALL
|
||||
InteractionSupplyPassword::getImplementationId()
|
||||
{
|
||||
return css::uno::Sequence<sal_Int8>();
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< uno::Type > SAL_CALL InteractionSupplyPassword::getTypes()
|
||||
{
|
||||
static cppu::OTypeCollection s_aCollection(
|
||||
cppu::UnoType<lang::XTypeProvider>::get(),
|
||||
cppu::UnoType<task::XInteractionPassword>::get() );
|
||||
|
||||
return s_aCollection.getTypes();
|
||||
}
|
||||
|
||||
|
||||
// XInteractionContinuation methods.
|
||||
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ int DAVAuthListener_Impl::authenticate(
|
|||
{
|
||||
// Handler handled the request.
|
||||
uno::Reference< task::XInteractionAbort > xAbort(
|
||||
xSelection.get(), uno::UNO_QUERY );
|
||||
xSelection->getXWeak(), uno::UNO_QUERY );
|
||||
if ( !xAbort.is() )
|
||||
{
|
||||
const rtl::Reference<
|
||||
|
|
|
@ -143,44 +143,6 @@ void InteractionContinuation::recordSelection()
|
|||
// InteractionAbort Implementation.
|
||||
|
||||
|
||||
// XInterface methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Any SAL_CALL
|
||||
InteractionAbort::queryInterface( const uno::Type & rType )
|
||||
{
|
||||
uno::Any aRet = cppu::queryInterface( rType,
|
||||
static_cast< lang::XTypeProvider * >( this ),
|
||||
static_cast< task::XInteractionContinuation * >( this ),
|
||||
static_cast< task::XInteractionAbort * >( this ) );
|
||||
|
||||
return aRet.hasValue()
|
||||
? aRet : InteractionContinuation::queryInterface( rType );
|
||||
}
|
||||
|
||||
|
||||
// XTypeProvider methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< sal_Int8 > SAL_CALL InteractionAbort::getImplementationId()
|
||||
{
|
||||
return css::uno::Sequence<sal_Int8>();
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< uno::Type > SAL_CALL InteractionAbort::getTypes()
|
||||
{
|
||||
static cppu::OTypeCollection s_aCollection(
|
||||
cppu::UnoType<lang::XTypeProvider>::get(),
|
||||
cppu::UnoType<task::XInteractionAbort>::get() );
|
||||
|
||||
return s_aCollection.getTypes();
|
||||
}
|
||||
|
||||
|
||||
// XInteractionContinuation methods.
|
||||
|
||||
|
||||
|
@ -194,44 +156,6 @@ void SAL_CALL InteractionAbort::select()
|
|||
// InteractionRetry Implementation.
|
||||
|
||||
|
||||
// XInterface methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Any SAL_CALL
|
||||
InteractionRetry::queryInterface( const uno::Type & rType )
|
||||
{
|
||||
uno::Any aRet = cppu::queryInterface( rType,
|
||||
static_cast< lang::XTypeProvider * >( this ),
|
||||
static_cast< task::XInteractionContinuation * >( this ),
|
||||
static_cast< task::XInteractionRetry * >( this ) );
|
||||
|
||||
return aRet.hasValue()
|
||||
? aRet : InteractionContinuation::queryInterface( rType );
|
||||
}
|
||||
|
||||
|
||||
// XTypeProvider methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< sal_Int8 > SAL_CALL InteractionRetry::getImplementationId()
|
||||
{
|
||||
return css::uno::Sequence<sal_Int8>();
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< uno::Type > SAL_CALL InteractionRetry::getTypes()
|
||||
{
|
||||
static cppu::OTypeCollection s_aCollection(
|
||||
cppu::UnoType<lang::XTypeProvider>::get(),
|
||||
cppu::UnoType<task::XInteractionRetry>::get() );
|
||||
|
||||
return s_aCollection.getTypes();
|
||||
}
|
||||
|
||||
|
||||
// XInteractionContinuation methods.
|
||||
|
||||
|
||||
|
@ -245,44 +169,6 @@ void SAL_CALL InteractionRetry::select()
|
|||
// InteractionApprove Implementation.
|
||||
|
||||
|
||||
// XInterface methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Any SAL_CALL
|
||||
InteractionApprove::queryInterface( const uno::Type & rType )
|
||||
{
|
||||
uno::Any aRet = cppu::queryInterface( rType,
|
||||
static_cast< lang::XTypeProvider * >( this ),
|
||||
static_cast< task::XInteractionContinuation * >( this ),
|
||||
static_cast< task::XInteractionApprove * >( this ) );
|
||||
|
||||
return aRet.hasValue()
|
||||
? aRet : InteractionContinuation::queryInterface( rType );
|
||||
}
|
||||
|
||||
|
||||
// XTypeProvider methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< sal_Int8 > SAL_CALL InteractionApprove::getImplementationId()
|
||||
{
|
||||
return css::uno::Sequence<sal_Int8>();
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< uno::Type > SAL_CALL InteractionApprove::getTypes()
|
||||
{
|
||||
static cppu::OTypeCollection s_aCollection(
|
||||
cppu::UnoType<lang::XTypeProvider>::get(),
|
||||
cppu::UnoType<task::XInteractionApprove>::get() );
|
||||
|
||||
return s_aCollection.getTypes();
|
||||
}
|
||||
|
||||
|
||||
// XInteractionContinuation methods.
|
||||
|
||||
|
||||
|
@ -296,44 +182,6 @@ void SAL_CALL InteractionApprove::select()
|
|||
// InteractionDisapprove Implementation.
|
||||
|
||||
|
||||
// XInterface methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Any SAL_CALL
|
||||
InteractionDisapprove::queryInterface( const uno::Type & rType )
|
||||
{
|
||||
uno::Any aRet = cppu::queryInterface( rType,
|
||||
static_cast< lang::XTypeProvider * >( this ),
|
||||
static_cast< task::XInteractionContinuation * >( this ),
|
||||
static_cast< task::XInteractionDisapprove * >( this ) );
|
||||
|
||||
return aRet.hasValue()
|
||||
? aRet : InteractionContinuation::queryInterface( rType );
|
||||
}
|
||||
|
||||
|
||||
// XTypeProvider methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< sal_Int8 > SAL_CALL InteractionDisapprove::getImplementationId()
|
||||
{
|
||||
return css::uno::Sequence<sal_Int8>();
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< uno::Type > SAL_CALL InteractionDisapprove::getTypes()
|
||||
{
|
||||
static cppu::OTypeCollection s_aCollection(
|
||||
cppu::UnoType<lang::XTypeProvider>::get(),
|
||||
cppu::UnoType<task::XInteractionDisapprove>::get() );
|
||||
|
||||
return s_aCollection.getTypes();
|
||||
}
|
||||
|
||||
|
||||
// XInteractionContinuation methods.
|
||||
|
||||
|
||||
|
@ -347,46 +195,6 @@ void SAL_CALL InteractionDisapprove::select()
|
|||
// InteractionSupplyAuthentication Implementation.
|
||||
|
||||
|
||||
// XInterface methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Any SAL_CALL
|
||||
InteractionSupplyAuthentication::queryInterface( const uno::Type & rType )
|
||||
{
|
||||
uno::Any aRet = cppu::queryInterface( rType,
|
||||
static_cast< lang::XTypeProvider * >( this ),
|
||||
static_cast< task::XInteractionContinuation * >( this ),
|
||||
static_cast< ucb::XInteractionSupplyAuthentication * >( this ),
|
||||
static_cast< ucb::XInteractionSupplyAuthentication2 * >( this ));
|
||||
|
||||
return aRet.hasValue()
|
||||
? aRet : InteractionContinuation::queryInterface( rType );
|
||||
}
|
||||
|
||||
|
||||
// XTypeProvider methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< sal_Int8 > SAL_CALL
|
||||
InteractionSupplyAuthentication::getImplementationId()
|
||||
{
|
||||
return css::uno::Sequence<sal_Int8>();
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< uno::Type > SAL_CALL InteractionSupplyAuthentication::getTypes()
|
||||
{
|
||||
static cppu::OTypeCollection s_aCollection(
|
||||
cppu::UnoType<lang::XTypeProvider>::get(),
|
||||
cppu::UnoType<ucb::XInteractionSupplyAuthentication2>::get() );
|
||||
|
||||
return s_aCollection.getTypes();
|
||||
}
|
||||
|
||||
|
||||
// XInteractionContinuation methods.
|
||||
|
||||
|
||||
|
@ -538,45 +346,6 @@ void SAL_CALL InteractionSupplyAuthentication::setUseSystemCredentials(
|
|||
// InteractionReplaceExistingData Implementation.
|
||||
|
||||
|
||||
// XInterface methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Any SAL_CALL
|
||||
InteractionReplaceExistingData::queryInterface( const uno::Type & rType )
|
||||
{
|
||||
uno::Any aRet = cppu::queryInterface( rType,
|
||||
static_cast< lang::XTypeProvider * >( this ),
|
||||
static_cast< task::XInteractionContinuation * >( this ),
|
||||
static_cast< ucb::XInteractionReplaceExistingData * >( this ) );
|
||||
|
||||
return aRet.hasValue()
|
||||
? aRet : InteractionContinuation::queryInterface( rType );
|
||||
}
|
||||
|
||||
|
||||
// XTypeProvider methods.
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< sal_Int8 > SAL_CALL
|
||||
InteractionReplaceExistingData::getImplementationId()
|
||||
{
|
||||
return css::uno::Sequence<sal_Int8>();
|
||||
}
|
||||
|
||||
|
||||
// virtual
|
||||
uno::Sequence< uno::Type > SAL_CALL InteractionReplaceExistingData::getTypes()
|
||||
{
|
||||
static cppu::OTypeCollection s_aCollection(
|
||||
cppu::UnoType<lang::XTypeProvider>::get(),
|
||||
cppu::UnoType<ucb::XInteractionReplaceExistingData>::get() );
|
||||
|
||||
return s_aCollection.getTypes();
|
||||
}
|
||||
|
||||
|
||||
// XInteractionContinuation methods.
|
||||
|
||||
|
||||
|
@ -588,20 +357,6 @@ void SAL_CALL InteractionReplaceExistingData::select()
|
|||
|
||||
// InteractionAuthFallback Implementation
|
||||
|
||||
// XInterface methods.
|
||||
|
||||
// virtual
|
||||
uno::Any SAL_CALL
|
||||
InteractionAuthFallback::queryInterface( const uno::Type & rType )
|
||||
{
|
||||
uno::Any aRet = cppu::queryInterface( rType,
|
||||
static_cast< task::XInteractionContinuation * >( this ),
|
||||
static_cast< ucb::XInteractionAuthFallback * >( this ));
|
||||
|
||||
return aRet.hasValue()
|
||||
? aRet : InteractionContinuation::queryInterface( rType );
|
||||
}
|
||||
|
||||
// XInteractionContinuation methods.
|
||||
|
||||
// virtual
|
||||
|
|
|
@ -62,25 +62,23 @@ ContinuationFlags SimpleInteractionRequest::getResponse() const
|
|||
rtl::Reference< InteractionContinuation > xSelection = getSelection();
|
||||
if ( xSelection.is() )
|
||||
{
|
||||
InteractionContinuation * pSelection = xSelection.get();
|
||||
|
||||
uno::Reference< task::XInteractionAbort > xAbort(
|
||||
pSelection, uno::UNO_QUERY );
|
||||
xSelection->getXWeak(), uno::UNO_QUERY );
|
||||
if ( xAbort.is() )
|
||||
return ContinuationFlags::Abort;
|
||||
|
||||
uno::Reference< task::XInteractionRetry > xRetry(
|
||||
pSelection, uno::UNO_QUERY );
|
||||
xSelection->getXWeak(), uno::UNO_QUERY );
|
||||
if ( xRetry.is() )
|
||||
return ContinuationFlags::Retry;
|
||||
|
||||
uno::Reference< task::XInteractionApprove > xApprove(
|
||||
pSelection, uno::UNO_QUERY );
|
||||
xSelection->getXWeak(), uno::UNO_QUERY );
|
||||
if ( xApprove.is() )
|
||||
return ContinuationFlags::Approve;
|
||||
|
||||
uno::Reference< task::XInteractionDisapprove > xDisapprove(
|
||||
pSelection, uno::UNO_QUERY );
|
||||
xSelection->getXWeak(), uno::UNO_QUERY );
|
||||
if ( xDisapprove.is() )
|
||||
return ContinuationFlags::Disapprove;
|
||||
|
||||
|
|
|
@ -27,35 +27,21 @@ using namespace com::sun::star;
|
|||
|
||||
namespace ucbhelper {
|
||||
|
||||
using InteractionSupplyName_BASE = cppu::ImplInheritanceHelper<InteractionContinuation,
|
||||
css::ucb::XInteractionSupplyName>;
|
||||
/**
|
||||
* This class implements a standard interaction continuation, namely the
|
||||
* interface XInteractionSupplyName. Instances of this class can be passed
|
||||
* along with an interaction request to indicate the possibility to
|
||||
* supply a new name.
|
||||
*/
|
||||
class InteractionSupplyName : public InteractionContinuation,
|
||||
public css::lang::XTypeProvider,
|
||||
public css::ucb::XInteractionSupplyName
|
||||
class InteractionSupplyName : public InteractionSupplyName_BASE
|
||||
{
|
||||
OUString m_aName;
|
||||
|
||||
public:
|
||||
explicit InteractionSupplyName( InteractionRequest * pRequest )
|
||||
: InteractionContinuation( pRequest ) {}
|
||||
|
||||
// XInterface
|
||||
virtual css::uno::Any SAL_CALL
|
||||
queryInterface( const css::uno::Type & rType ) override;
|
||||
virtual void SAL_CALL acquire()
|
||||
noexcept override;
|
||||
virtual void SAL_CALL release()
|
||||
noexcept override;
|
||||
|
||||
// XTypeProvider
|
||||
virtual css::uno::Sequence< css::uno::Type > SAL_CALL
|
||||
getTypes() override;
|
||||
virtual css::uno::Sequence< sal_Int8 > SAL_CALL
|
||||
getImplementationId() override;
|
||||
: InteractionSupplyName_BASE( pRequest ) {}
|
||||
|
||||
// XInteractionContinuation
|
||||
virtual void SAL_CALL select() override;
|
||||
|
@ -74,44 +60,6 @@ public:
|
|||
const OUString & getName() const { return m_aName; }
|
||||
};
|
||||
|
||||
void SAL_CALL InteractionSupplyName::acquire()
|
||||
noexcept
|
||||
{
|
||||
OWeakObject::acquire();
|
||||
}
|
||||
|
||||
void SAL_CALL InteractionSupplyName::release()
|
||||
noexcept
|
||||
{
|
||||
OWeakObject::release();
|
||||
}
|
||||
|
||||
uno::Any SAL_CALL
|
||||
InteractionSupplyName::queryInterface( const uno::Type & rType )
|
||||
{
|
||||
uno::Any aRet = cppu::queryInterface( rType,
|
||||
static_cast< lang::XTypeProvider * >( this ),
|
||||
static_cast< task::XInteractionContinuation * >( this ),
|
||||
static_cast< ucb::XInteractionSupplyName * >( this ) );
|
||||
|
||||
return aRet.hasValue()
|
||||
? aRet : InteractionContinuation::queryInterface( rType );
|
||||
}
|
||||
|
||||
uno::Sequence< sal_Int8 > SAL_CALL InteractionSupplyName::getImplementationId()
|
||||
{
|
||||
return css::uno::Sequence<sal_Int8>();
|
||||
}
|
||||
|
||||
uno::Sequence< uno::Type > SAL_CALL InteractionSupplyName::getTypes()
|
||||
{
|
||||
static cppu::OTypeCollection s_aCollection(
|
||||
cppu::UnoType<lang::XTypeProvider>::get(),
|
||||
cppu::UnoType<ucb::XInteractionSupplyName>::get() );
|
||||
|
||||
return s_aCollection.getTypes();
|
||||
}
|
||||
|
||||
void SAL_CALL InteractionSupplyName::select()
|
||||
{
|
||||
recordSelection();
|
||||
|
|
|
@ -750,8 +750,7 @@ static bool UCBOpenContentSync(
|
|||
rtl::Reference< ucbhelper::InteractionContinuation > ref
|
||||
= xIR->getSelection();
|
||||
if(ref.is()) {
|
||||
Reference<XInterface> xInt(ref);
|
||||
xRet.set(xInt,UNO_QUERY);
|
||||
xRet.set(ref->getXWeak(), UNO_QUERY);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue