bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / presenter / PresenterPreviewCache.hxx
blob3388d4ac3382648d42da4e22958d069c91ccfa61
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_SD_SOURCE_UI_PRESENTER_PRESENTERPREVIEWCACHE_HXX
21 #define INCLUDED_SD_SOURCE_UI_PRESENTER_PRESENTERPREVIEWCACHE_HXX
23 #include <com/sun/star/drawing/XSlidePreviewCache.hpp>
24 #include <com/sun/star/lang/XInitialization.hpp>
25 #include <tools/gen.hxx>
26 #include <cppuhelper/compbase.hxx>
27 #include <cppuhelper/basemutex.hxx>
28 #include <memory>
30 namespace sd { namespace slidesorter { namespace cache { class PageCache; } } }
32 namespace sd { namespace presenter {
34 typedef ::cppu::WeakComponentImplHelper<
35 css::lang::XInitialization,
36 css::drawing::XSlidePreviewCache
37 > PresenterPreviewCacheInterfaceBase;
39 /** Uno API wrapper around the slide preview cache.
41 class PresenterPreviewCache
42 : private ::cppu::BaseMutex,
43 public PresenterPreviewCacheInterfaceBase
45 public:
46 PresenterPreviewCache ();
47 virtual ~PresenterPreviewCache() override;
48 PresenterPreviewCache(const PresenterPreviewCache&) = delete;
49 PresenterPreviewCache& operator=(const PresenterPreviewCache&) = delete;
51 // XInitialize
53 /** Accepts no arguments. All values that are necessary to set up a
54 preview cache can be provided via methods.
56 virtual void SAL_CALL initialize (const css::uno::Sequence<css::uno::Any>& rArguments) override;
58 // XSlidePreviewCache
60 virtual void SAL_CALL setDocumentSlides (
61 const css::uno::Reference<css::container::XIndexAccess>& rxSlides,
62 const css::uno::Reference<css::uno::XInterface>& rxDocument) override;
64 virtual void SAL_CALL setVisibleRange (
65 sal_Int32 nFirstVisibleSlideIndex,
66 sal_Int32 nLastVisibleSlideIndex) override;
68 virtual void SAL_CALL setPreviewSize (
69 const css::geometry::IntegerSize2D& rSize) override;
71 virtual css::uno::Reference<css::rendering::XBitmap> SAL_CALL
72 getSlidePreview (
73 sal_Int32 nSlideIndex,
74 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas) override;
76 virtual void SAL_CALL addPreviewCreationNotifyListener (
77 const css::uno::Reference<css::drawing::XSlidePreviewCacheListener>& rxListener) override;
79 virtual void SAL_CALL removePreviewCreationNotifyListener (
80 const css::uno::Reference<css::drawing::XSlidePreviewCacheListener>& rxListener) override;
82 virtual void SAL_CALL pause() override;
84 virtual void SAL_CALL resume() override;
86 private:
87 class PresenterCacheContext;
88 Size maPreviewSize;
89 std::shared_ptr<PresenterCacheContext> mpCacheContext;
90 std::shared_ptr<sd::slidesorter::cache::PageCache> mpCache;
92 /** @throws css::lang::DisposedException when the object has already been
93 disposed.
95 void ThrowIfDisposed();
98 } } // end of namespace ::sd::presenter
100 #endif
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */