1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <com/sun/star/drawing/XSlidePreviewCache.hpp>
23 #include <com/sun/star/lang/XInitialization.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <tools/gen.hxx>
26 #include <comphelper/compbase.hxx>
29 namespace sd::slidesorter::cache
{ class PageCache
; }
31 namespace sd::presenter
{
33 typedef comphelper::WeakComponentImplHelper
<
34 css::lang::XInitialization
,
35 css::lang::XServiceInfo
,
36 css::drawing::XSlidePreviewCache
37 > PresenterPreviewCacheInterfaceBase
;
39 /** Uno API wrapper around the slide preview cache.
41 class PresenterPreviewCache final
42 : public PresenterPreviewCacheInterfaceBase
45 PresenterPreviewCache ();
46 virtual ~PresenterPreviewCache() override
;
47 PresenterPreviewCache(const PresenterPreviewCache
&) = delete;
48 PresenterPreviewCache
& operator=(const PresenterPreviewCache
&) = delete;
52 /** Accepts no arguments. All values that are necessary to set up a
53 preview cache can be provided via methods.
55 virtual void SAL_CALL
initialize (const css::uno::Sequence
<css::uno::Any
>& rArguments
) override
;
57 OUString SAL_CALL
getImplementationName() override
;
58 sal_Bool SAL_CALL
supportsService(OUString
const & ServiceName
) override
;
59 css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
;
63 virtual void SAL_CALL
setDocumentSlides (
64 const css::uno::Reference
<css::container::XIndexAccess
>& rxSlides
,
65 const css::uno::Reference
<css::uno::XInterface
>& rxDocument
) override
;
67 virtual void SAL_CALL
setVisibleRange (
68 sal_Int32 nFirstVisibleSlideIndex
,
69 sal_Int32 nLastVisibleSlideIndex
) override
;
71 virtual void SAL_CALL
setPreviewSize (
72 const css::geometry::IntegerSize2D
& rSize
) override
;
74 virtual css::uno::Reference
<css::rendering::XBitmap
> SAL_CALL
76 sal_Int32 nSlideIndex
,
77 const css::uno::Reference
<css::rendering::XCanvas
>& rxCanvas
) override
;
79 virtual void SAL_CALL
addPreviewCreationNotifyListener (
80 const css::uno::Reference
<css::drawing::XSlidePreviewCacheListener
>& rxListener
) override
;
82 virtual void SAL_CALL
removePreviewCreationNotifyListener (
83 const css::uno::Reference
<css::drawing::XSlidePreviewCacheListener
>& rxListener
) override
;
85 virtual void SAL_CALL
pause() override
;
87 virtual void SAL_CALL
resume() override
;
90 class PresenterCacheContext
;
92 std::shared_ptr
<PresenterCacheContext
> mpCacheContext
;
93 std::shared_ptr
<sd::slidesorter::cache::PageCache
> mpCache
;
95 /** @throws css::lang::DisposedException when the object has already been
98 void ThrowIfDisposed();
101 } // end of namespace ::sd::presenter
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */