2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-29 14:02:24 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-10-25 11:46:18 +00:00
|
|
|
|
2013-10-23 19:17:00 +02:00
|
|
|
#ifndef INCLUDED_COMPHELPER_INTERACTION_HXX
|
|
|
|
#define INCLUDED_COMPHELPER_INTERACTION_HXX
|
2000-10-25 11:46:18 +00:00
|
|
|
|
2015-07-10 17:50:12 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2000-10-25 11:46:18 +00:00
|
|
|
#include <com/sun/star/task/XInteractionApprove.hpp>
|
|
|
|
#include <com/sun/star/task/XInteractionDisapprove.hpp>
|
|
|
|
#include <com/sun/star/task/XInteractionAbort.hpp>
|
|
|
|
#include <com/sun/star/task/XInteractionRetry.hpp>
|
2008-06-06 13:34:48 +00:00
|
|
|
#include <com/sun/star/task/XInteractionPassword.hpp>
|
2000-10-25 11:46:18 +00:00
|
|
|
#include <com/sun/star/task/XInteractionRequest.hpp>
|
2013-11-09 13:59:36 -06:00
|
|
|
#include <comphelper/comphelperdllapi.h>
|
2016-01-28 15:44:38 +02:00
|
|
|
#include <vector>
|
2000-10-25 11:46:18 +00:00
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2000-10-25 11:46:18 +00:00
|
|
|
namespace comphelper
|
|
|
|
{
|
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2000-10-31 07:30:37 +00:00
|
|
|
//= OInteraction
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2016-01-28 15:44:38 +02:00
|
|
|
/** template for instantiating concrete interaction handlers<p/>
|
|
|
|
the template argument must be an interface derived from XInteractionContinuation
|
2000-10-25 11:46:18 +00:00
|
|
|
*/
|
2000-10-31 07:30:37 +00:00
|
|
|
template <class INTERACTION>
|
|
|
|
class OInteraction
|
2015-10-06 12:38:33 +02:00
|
|
|
: public ::cppu::WeakImplHelper< INTERACTION >
|
2000-10-25 11:46:18 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-10-06 12:38:33 +02:00
|
|
|
OInteraction() : m_bSelected(false) {}
|
2000-10-25 11:46:18 +00:00
|
|
|
|
2015-10-06 12:38:33 +02:00
|
|
|
/// determines whether or not this handler was selected
|
|
|
|
bool wasSelected() const { return m_bSelected; }
|
|
|
|
|
|
|
|
// XInteractionContinuation
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL select() override;
|
2015-10-06 12:38:33 +02:00
|
|
|
private:
|
|
|
|
bool m_bSelected : 1; /// indicates if the select event occurred
|
2000-10-25 11:46:18 +00:00
|
|
|
};
|
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2000-10-31 07:30:37 +00:00
|
|
|
template <class INTERACTION>
|
2017-01-26 12:28:58 +01:00
|
|
|
void SAL_CALL OInteraction< INTERACTION >::select( )
|
2000-10-31 07:30:37 +00:00
|
|
|
{
|
2015-10-06 12:38:33 +02:00
|
|
|
m_bSelected = true;
|
2000-10-31 07:30:37 +00:00
|
|
|
}
|
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2000-10-31 07:30:37 +00:00
|
|
|
//= OInteractionApprove
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2015-10-19 12:51:29 +02:00
|
|
|
typedef OInteraction< css::task::XInteractionApprove > OInteractionApprove;
|
2000-10-25 11:46:18 +00:00
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2017-03-24 11:41:08 +01:00
|
|
|
//= OInteractionDisapprove
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2015-10-19 12:51:29 +02:00
|
|
|
typedef OInteraction< css::task::XInteractionDisapprove > OInteractionDisapprove;
|
2000-10-25 11:46:18 +00:00
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2000-10-25 11:46:18 +00:00
|
|
|
//= OInteractionAbort
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2015-10-19 12:51:29 +02:00
|
|
|
typedef OInteraction< css::task::XInteractionAbort > OInteractionAbort;
|
2000-10-25 11:46:18 +00:00
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2000-10-25 11:46:18 +00:00
|
|
|
//= OInteractionRetry
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2015-10-19 12:51:29 +02:00
|
|
|
typedef OInteraction< css::task::XInteractionRetry > OInteractionRetry;
|
2000-10-25 11:46:18 +00:00
|
|
|
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2000-10-25 11:46:18 +00:00
|
|
|
//= OInteractionRequest
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2015-10-19 12:51:29 +02:00
|
|
|
typedef ::cppu::WeakImplHelper < css::task::XInteractionRequest
|
2015-07-10 17:50:12 +09:00
|
|
|
> OInteractionRequest_Base;
|
2013-04-29 19:06:50 +02:00
|
|
|
/** implements an interaction request (com.sun.star.task::XInteractionRequest)<p/>
|
2000-10-25 11:46:18 +00:00
|
|
|
at run time, you can freely add any interaction continuation objects
|
|
|
|
*/
|
2019-10-28 21:01:40 +02:00
|
|
|
class COMPHELPER_DLLPUBLIC OInteractionRequest final : public OInteractionRequest_Base
|
2000-10-25 11:46:18 +00:00
|
|
|
{
|
2018-07-19 16:28:37 +02:00
|
|
|
css::uno::Any const
|
2000-10-25 11:46:18 +00:00
|
|
|
m_aRequest; /// the request we represent
|
2016-01-28 15:44:38 +02:00
|
|
|
std::vector< css::uno::Reference< css::task::XInteractionContinuation > >
|
2000-10-25 11:46:18 +00:00
|
|
|
m_aContinuations; /// all registered continuations
|
|
|
|
|
|
|
|
public:
|
2015-10-19 12:51:29 +02:00
|
|
|
OInteractionRequest(const css::uno::Any& _rRequestDescription);
|
|
|
|
OInteractionRequest(const css::uno::Any& rRequestDescription,
|
2016-01-28 15:44:38 +02:00
|
|
|
std::vector<css::uno::Reference<css::task::XInteractionContinuation>> const& rContinuations);
|
2000-10-25 11:46:18 +00:00
|
|
|
|
|
|
|
/// add a new continuation
|
2015-10-19 12:51:29 +02:00
|
|
|
void addContinuation(const css::uno::Reference< css::task::XInteractionContinuation >& _rxContinuation);
|
2000-10-25 11:46:18 +00:00
|
|
|
|
|
|
|
// XInteractionRequest
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual css::uno::Any SAL_CALL getRequest( ) override;
|
|
|
|
virtual css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > SAL_CALL getContinuations( ) override;
|
2000-10-25 11:46:18 +00:00
|
|
|
};
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2000-10-25 11:46:18 +00:00
|
|
|
} // namespace comphelper
|
2014-02-25 19:06:16 +01:00
|
|
|
|
2000-10-25 11:46:18 +00:00
|
|
|
|
2013-10-23 19:17:00 +02:00
|
|
|
#endif // INCLUDED_COMPHELPER_INTERACTION_HXX
|
2000-10-25 11:46:18 +00:00
|
|
|
|
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|