bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / ui / presenter / PresenterPreviewCache.hxx
blob5d0ceab5981166b15c54e023af766dd1d3aadf10
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 SD_PRESENTER_PRESENTER_PREVIEW_CACHE_HXX
21 #define SD_PRESENTER_PRESENTER_PREVIEW_CACHE_HXX
23 #include <com/sun/star/drawing/XSlidePreviewCache.hpp>
24 #include <com/sun/star/lang/XInitialization.hpp>
25 #include <com/sun/star/uno/XComponentContext.hpp>
26 #include "cache/SlsPageCache.hxx"
27 #include <cppuhelper/compbase2.hxx>
28 #include <cppuhelper/basemutex.hxx>
29 #include <boost/noncopyable.hpp>
30 #include <boost/shared_ptr.hpp>
32 namespace sd { namespace presenter {
34 namespace {
35 typedef ::cppu::WeakComponentImplHelper2<
36 css::lang::XInitialization,
37 css::drawing::XSlidePreviewCache
38 > PresenterPreviewCacheInterfaceBase;
41 /** Uno API wrapper around the slide preview cache.
43 class PresenterPreviewCache
44 : private ::boost::noncopyable,
45 private ::cppu::BaseMutex,
46 public PresenterPreviewCacheInterfaceBase
48 public:
49 PresenterPreviewCache (const css::uno::Reference<css::uno::XComponentContext>& rxContext);
50 virtual ~PresenterPreviewCache (void);
52 // XInitialize
54 /** Accepts no arguments. All values that are necessary to set up a
55 preview cache can be provided via methods.
57 virtual void SAL_CALL initialize (const css::uno::Sequence<css::uno::Any>& rArguments)
58 throw(css::uno::Exception,css::uno::RuntimeException);
61 // XSlidePreviewCache
63 virtual void SAL_CALL setDocumentSlides (
64 const css::uno::Reference<css::container::XIndexAccess>& rxSlides,
65 const css::uno::Reference<css::uno::XInterface>& rxDocument)
66 throw (css::uno::RuntimeException);
68 virtual void SAL_CALL setVisibleRange (
69 sal_Int32 nFirstVisibleSlideIndex,
70 sal_Int32 nLastVisibleSlideIndex)
71 throw (css::uno::RuntimeException);
73 virtual void SAL_CALL setPreviewSize (
74 const css::geometry::IntegerSize2D& rSize)
75 throw (css::uno::RuntimeException);
77 virtual css::uno::Reference<css::rendering::XBitmap> SAL_CALL
78 getSlidePreview (
79 sal_Int32 nSlideIndex,
80 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas)
81 throw (css::uno::RuntimeException);
83 virtual void SAL_CALL addPreviewCreationNotifyListener (
84 const css::uno::Reference<css::drawing::XSlidePreviewCacheListener>& rxListener)
85 throw (css::uno::RuntimeException);
87 virtual void SAL_CALL removePreviewCreationNotifyListener (
88 const css::uno::Reference<css::drawing::XSlidePreviewCacheListener>& rxListener)
89 throw (css::uno::RuntimeException);
91 virtual void SAL_CALL pause (void)
92 throw (css::uno::RuntimeException);
94 virtual void SAL_CALL resume (void)
95 throw (css::uno::RuntimeException);
97 private:
98 css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
99 class PresenterCacheContext;
100 Size maPreviewSize;
101 ::boost::shared_ptr<PresenterCacheContext> mpCacheContext;
102 ::boost::shared_ptr<sd::slidesorter::cache::PageCache> mpCache;
104 /** This method throws a DisposedException when the object has already been
105 disposed.
107 void ThrowIfDisposed (void) throw (css::lang::DisposedException);
110 } } // end of namespace ::sd::presenter
112 #endif
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */