2010-10-27 12:53:26 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +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 .
|
|
|
|
*/
|
2008-04-03 13:09:27 +00:00
|
|
|
|
2013-10-23 22:38:46 +02:00
|
|
|
#ifndef INCLUDED_SD_SOURCE_UI_PRESENTER_SLIDERENDERER_HXX
|
|
|
|
#define INCLUDED_SD_SOURCE_UI_PRESENTER_SLIDERENDERER_HXX
|
2008-04-03 13:09:27 +00:00
|
|
|
|
|
|
|
#include "PreviewRenderer.hxx"
|
|
|
|
#include <com/sun/star/drawing/XDrawPage.hpp>
|
|
|
|
#include <com/sun/star/drawing/XSlideRenderer.hpp>
|
|
|
|
#include <com/sun/star/lang/XInitialization.hpp>
|
2015-03-17 12:25:11 +01:00
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
2008-04-03 13:09:27 +00:00
|
|
|
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
|
2014-01-02 23:52:37 +01:00
|
|
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
|
|
|
|
2008-04-03 13:09:27 +00:00
|
|
|
#include <cppuhelper/basemutex.hxx>
|
2015-03-17 12:25:11 +01:00
|
|
|
#include <cppuhelper/compbase.hxx>
|
2008-04-03 13:09:27 +00:00
|
|
|
#include <boost/noncopyable.hpp>
|
|
|
|
|
|
|
|
namespace sd { namespace presenter {
|
|
|
|
|
|
|
|
namespace {
|
2015-03-17 12:25:11 +01:00
|
|
|
typedef ::cppu::WeakComponentImplHelper <
|
2008-04-03 13:09:27 +00:00
|
|
|
css::drawing::XSlideRenderer,
|
2015-03-17 12:25:11 +01:00
|
|
|
css::lang::XInitialization,
|
|
|
|
css::lang::XServiceInfo
|
2008-04-03 13:09:27 +00:00
|
|
|
> SlideRendererInterfaceBase;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Render single slides into bitmaps.
|
|
|
|
*/
|
|
|
|
class SlideRenderer
|
|
|
|
: private ::boost::noncopyable,
|
|
|
|
protected ::cppu::BaseMutex,
|
|
|
|
public SlideRendererInterfaceBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit SlideRenderer (const css::uno::Reference<css::uno::XComponentContext>& rxContext);
|
2015-04-14 12:44:47 +02:00
|
|
|
virtual ~SlideRenderer();
|
|
|
|
virtual void SAL_CALL disposing() SAL_OVERRIDE;
|
2008-04-03 13:09:27 +00:00
|
|
|
|
|
|
|
// XInitialization
|
|
|
|
|
|
|
|
virtual void SAL_CALL initialize (const css::uno::Sequence<css::uno::Any>& rArguments)
|
2014-03-27 18:12:18 +01:00
|
|
|
throw (css::uno::Exception, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2008-04-03 13:09:27 +00:00
|
|
|
|
2015-03-17 12:25:11 +01:00
|
|
|
OUString SAL_CALL getImplementationName()
|
|
|
|
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
|
|
|
|
|
|
|
sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
|
|
|
|
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
|
|
|
|
|
|
|
css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
|
|
|
|
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
|
|
|
|
2008-04-03 13:09:27 +00:00
|
|
|
// XSlideRenderer
|
|
|
|
|
|
|
|
virtual css::uno::Reference<css::awt::XBitmap> SAL_CALL createPreview (
|
2013-04-02 09:01:37 +02:00
|
|
|
const css::uno::Reference<css::drawing::XDrawPage>& rxSlide,
|
2008-04-03 13:09:27 +00:00
|
|
|
const css::awt::Size& rMaximumPreviewPixelSize,
|
|
|
|
sal_Int16 nSuperSampleFactor)
|
2014-03-27 18:12:18 +01:00
|
|
|
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2008-04-03 13:09:27 +00:00
|
|
|
|
|
|
|
virtual css::uno::Reference<css::rendering::XBitmap> SAL_CALL createPreviewForCanvas (
|
2013-04-02 09:01:37 +02:00
|
|
|
const css::uno::Reference<css::drawing::XDrawPage>& rxSlide,
|
2008-04-03 13:09:27 +00:00
|
|
|
const css::awt::Size& rMaximumPreviewPixelSize,
|
|
|
|
sal_Int16 nSuperSampleFactor,
|
2013-04-02 09:01:37 +02:00
|
|
|
const css::uno::Reference<css::rendering::XCanvas>& rxCanvas)
|
2014-03-27 18:12:18 +01:00
|
|
|
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2008-04-03 13:09:27 +00:00
|
|
|
|
|
|
|
virtual css::awt::Size SAL_CALL calculatePreviewSize (
|
|
|
|
double nSlideAspectRatio,
|
|
|
|
const css::awt::Size& rMaximumPreviewPixelSize)
|
2014-03-27 18:12:18 +01:00
|
|
|
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2008-04-03 13:09:27 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
PreviewRenderer maPreviewRenderer;
|
|
|
|
|
|
|
|
BitmapEx CreatePreview (
|
2013-04-02 09:01:37 +02:00
|
|
|
const css::uno::Reference<css::drawing::XDrawPage>& rxSlide,
|
2008-04-03 13:09:27 +00:00
|
|
|
const css::awt::Size& rMaximumPreviewPixelSize,
|
|
|
|
sal_Int16 nSuperSampleFactor)
|
2014-11-13 21:15:34 +00:00
|
|
|
throw (css::uno::RuntimeException, std::exception);
|
2008-04-03 13:09:27 +00:00
|
|
|
|
|
|
|
/** This method throws a DisposedException when the object has already been
|
|
|
|
disposed.
|
|
|
|
*/
|
2015-04-14 12:44:47 +02:00
|
|
|
void ThrowIfDisposed() throw (css::lang::DisposedException);
|
2008-04-03 13:09:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} } // end of namespace ::sd::presenter
|
|
|
|
|
|
|
|
#endif
|
2010-10-27 12:53:26 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|