Update ooo320-m1
[ooovba.git] / sd / source / ui / presenter / CanvasUpdateRequester.hxx
blob34f38a3c95344e4fcf4fe27fbd16e5548c4b2cf0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: CanvasUpdateRequester.hxx,v $
11 * $Revision: 1.3 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef SD_PRESENTER_CANVAS_UPDATE_REQUESTER_HEADER
33 #define SD_PRESENTER_CANVAS_UPDATE_REQUESTER_HEADER
35 #include "precompiled_sd.hxx"
37 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
38 #include <boost/noncopyable.hpp>
39 #include <boost/shared_ptr.hpp>
40 #include <sal/types.h>
41 #include <tools/solar.h>
42 #include <tools/link.hxx>
43 #include <vector>
45 namespace css = ::com::sun::star;
47 namespace sd { namespace presenter {
49 /** Each UpdateRequester handles update requests (calls to
50 XCanvas::updateScreen()) for one shared canvas (a canvas that has one or
51 more PresenterCanvas wrappers). Multiple calls are collected and lead
52 to a single call to updateScreen.
54 class CanvasUpdateRequester : private ::boost::noncopyable
56 public:
57 /** Return the Canvas UpdateRequester object for the given shared
58 canvas. A new object is created when it does not already exist.
60 static ::boost::shared_ptr<CanvasUpdateRequester> Instance (
61 const css::uno::Reference<css::rendering::XSpriteCanvas>& rxCanvas);
63 void RequestUpdate (const sal_Bool bUpdateAll);
65 private:
66 CanvasUpdateRequester (const css::uno::Reference<css::rendering::XSpriteCanvas>& rxCanvas);
67 ~CanvasUpdateRequester (void);
68 class Deleter; friend class Deleter;
70 typedef ::std::vector<
71 ::std::pair<
72 css::uno::Reference<css::rendering::XSpriteCanvas>,
73 ::boost::shared_ptr<CanvasUpdateRequester> > > RequesterMap;
74 static RequesterMap maRequesterMap;
76 css::uno::Reference<css::rendering::XSpriteCanvas> mxCanvas;
77 ULONG mnUserEventId;
78 sal_Bool mbUpdateFlag;
79 DECL_LINK(Callback, void*);
82 } } // end of namespace ::sd::presenter
84 #endif