LibreOffice Module dbaccess (master) 1
dbinteraction.hxx
Go to the documentation of this file.
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#pragma once
21
24
25#include <com/sun/star/awt/XWindow.hpp>
26#include <com/sun/star/lang/XInitialization.hpp>
27#include <com/sun/star/lang/XServiceInfo.hpp>
28#include <com/sun/star/task/XInteractionHandler2.hpp>
29#include <com/sun/star/sdb/ParametersRequest.hpp>
30#include <com/sun/star/sdb/DocumentSaveRequest.hpp>
31
32namespace com::sun::star::uno { class XComponentContext; }
33
34namespace dbtools
35{
36 class SQLExceptionInfo;
37}
38
39namespace dbaui
40{
41
42 // BasicInteractionHandler
43 typedef ::cppu::WeakImplHelper< css::lang::XServiceInfo
44 , css::lang::XInitialization
45 , css::task::XInteractionHandler2
60 {
61 css::uno::Reference< css::awt::XWindow > m_xParentWindow;
62 const css::uno::Reference< css::uno::XComponentContext >
65
66 public:
68 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
69 const bool i_bFallbackToGeneric
70 );
71
72 // XInitialization
73 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& rArgs ) override;
74
75 // XInteractionHandler2
76 virtual sal_Bool SAL_CALL handleInteractionRequest( const css::uno::Reference< css::task::XInteractionRequest >& Request ) override;
77
78 // XInteractionHandler
79 virtual void SAL_CALL handle( const css::uno::Reference< css::task::XInteractionRequest >& Request ) override;
80
81 protected:
82 bool
83 impl_handle_throw( const css::uno::Reference< css::task::XInteractionRequest >& i_Request );
84
86 static void implHandle(
87 const ::dbtools::SQLExceptionInfo& _rSqlInfo,
88 const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > >& _rContinuations);
89
92 const css::sdb::ParametersRequest& _rParamRequest,
93 const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > >& _rContinuations);
94
97 const css::sdb::DocumentSaveRequest& _rParamRequest,
98 const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > >& _rContinuations);
99
102 const css::uno::Reference< css::task::XInteractionRequest >& _rxRequest );
103
106 {
113 };
118 static sal_Int32 getContinuation(
119 Continuation _eCont,
120 const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > >& _rContinuations);
121 };
122
123 // SQLExceptionInteractionHandler
125 {
126 public:
128 const css::uno::Reference< css::uno::XComponentContext >& rxContext
129 )
130 :BasicInteractionHandler( rxContext, false )
131 {
132 }
133
134 // XServiceInfo
136 };
137
138 // SQLExceptionInteractionHandler
153 {
154 public:
156 const css::uno::Reference< css::uno::XComponentContext >& rxContext
157 )
158 :BasicInteractionHandler( rxContext, true )
159 {
160 }
161
162 // XServiceInfo
164 };
165
166} // namespace dbaui
167
168/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
implements an <type scope="com.sun.star.task">XInteractionHandler</type> for database related interac...
void implHandle(const css::sdb::DocumentSaveRequest &_rParamRequest, const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &_rContinuations)
handle document save requests
const css::uno::Reference< css::uno::XComponentContext > m_xContext
void implHandle(const css::sdb::ParametersRequest &_rParamRequest, const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &_rContinuations)
handle parameter requests
static void implHandle(const ::dbtools::SQLExceptionInfo &_rSqlInfo, const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &_rContinuations)
handle SQLExceptions (and derived classes)
bool impl_handle_throw(const css::uno::Reference< css::task::XInteractionRequest > &i_Request)
css::uno::Reference< css::awt::XWindow > m_xParentWindow
virtual void SAL_CALL handle(const css::uno::Reference< css::task::XInteractionRequest > &Request) override
static sal_Int32 getContinuation(Continuation _eCont, const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &_rContinuations)
check if a given continuation sequence contains a given continuation type
bool implHandleUnknown(const css::uno::Reference< css::task::XInteractionRequest > &_rxRequest)
handles requests which are not SDB-specific
Continuation
known continuation types
virtual sal_Bool SAL_CALL handleInteractionRequest(const css::uno::Reference< css::task::XInteractionRequest > &Request) override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArgs) override
BasicInteractionHandler(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const bool i_bFallbackToGeneric)
an implementation for the legacy css.sdb.InteractionHandler
LegacyInteractionHandler(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
SQLExceptionInteractionHandler(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
::cppu::WeakImplHelper< css::lang::XServiceInfo, css::lang::XInitialization, css::task::XInteractionHandler2 > BasicInteractionHandler_Base
unsigned char sal_Bool