LibreOffice Module filter (master) 1
pdfinteract.cxx
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
21#include "pdfinteract.hxx"
22#include "impdialog.hxx"
23
24#include <com/sun/star/task/XInteractionRequest.hpp>
25#include <com/sun/star/task/PDFExportException.hpp>
28#include <vcl/svapp.hxx>
29
31{
32}
33
35{
36}
37
38void SAL_CALL PDFInteractionHandler::handle( const Reference< task::XInteractionRequest >& i_xRequest )
39{
40 handleInteractionRequest( i_xRequest );
41}
42
43void SAL_CALL PDFInteractionHandler::initialize(const css::uno::Sequence<css::uno::Any>& rArguments)
44{
46 if (aProperties.has("Parent"))
47 aProperties.get("Parent") >>= m_xParent;
48}
49
50sal_Bool SAL_CALL PDFInteractionHandler::handleInteractionRequest( const Reference< task::XInteractionRequest >& i_xRequest )
51{
52 bool bHandled = false;
53
54 Any aRequest( i_xRequest->getRequest() );
55 task::PDFExportException aExc;
56 if( aRequest >>= aExc )
57 {
58 std::set< vcl::PDFWriter::ErrorCode > aCodes;
59 sal_Int32 nCodes = aExc.ErrorCodes.getLength();
60 for( sal_Int32 i = 0; i < nCodes; i++ )
61 aCodes.insert( static_cast<vcl::PDFWriter::ErrorCode>(aExc.ErrorCodes.getConstArray()[i]) );
62
64 aDlg.run();
65 bHandled = true;
66 }
67 return bHandled;
68}
69
70
71
73{
74 return "com.sun.star.comp.PDF.PDFExportInteractionHandler";
75}
76
77
78sal_Bool SAL_CALL PDFInteractionHandler::supportsService( const OUString& rServiceName )
79{
80 return cppu::supportsService( this, rServiceName );
81}
82
83
84css::uno::Sequence< OUString > SAL_CALL PDFInteractionHandler::getSupportedServiceNames( )
85{
86 return { "com.sun.star.filter.pdfexport.PDFExportInteractionHandler" };
87}
88
89extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
91 css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
92{
93 return cppu::acquire(new PDFInteractionHandler());
94}
95
96
97/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PropertiesInfo aProperties
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: pdfinteract.cxx:84
virtual sal_Bool SAL_CALL handleInteractionRequest(const Reference< task::XInteractionRequest > &) override
Definition: pdfinteract.cxx:50
virtual OUString SAL_CALL getImplementationName() override
Definition: pdfinteract.cxx:72
css::uno::Reference< css::awt::XWindow > m_xParent
Definition: pdfinteract.hxx:39
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArguments) override
Definition: pdfinteract.cxx:43
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: pdfinteract.cxx:78
virtual void SAL_CALL handle(const Reference< task::XInteractionRequest > &) override
Definition: pdfinteract.cxx:38
virtual ~PDFInteractionHandler() override
Definition: pdfinteract.cxx:34
virtual short run()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
int i
Definition: gentoken.py:48
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * filter_PDFExportInteractionHandler_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
Definition: pdfinteract.cxx:90
unsigned char sal_Bool