1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_CANVAS_SPRITESURFACE_HXX
25 #define INCLUDED_CANVAS_SPRITESURFACE_HXX
26 
27 #include <canvas/base/sprite.hxx>
28 
29 namespace canvas
30 {
31 	/* Definition of the SpriteSurface interface */
32 
33     /** Canvas surface containing sprites
34 
35     	Every canvas surface that contains sprites must implement this
36     	interface, when employing the canvas base framework. The
37     	methods provided here are used from the individual sprites to
38     	notify the canvas about necessary screen updates.
39      */
40     class SpriteSurface : public ::com::sun::star::uno::XInterface
41     {
42     public:
43         typedef ::rtl::Reference< SpriteSurface > Reference;
44 
45         /// Sprites should call this from XSprite::show()
46         virtual void showSprite( const Sprite::Reference& rSprite ) = 0;
47 
48         /// Sprites should call this from XSprite::hide()
49         virtual void hideSprite( const Sprite::Reference& rSprite ) = 0;
50 
51         /// Sprites should call this from XSprite::move()
52         virtual void moveSprite( const Sprite::Reference&		rSprite,
53                                  const ::basegfx::B2DPoint& 	rOldPos,
54                                  const ::basegfx::B2DPoint&		rNewPos,
55                                  const ::basegfx::B2DVector& 	rSpriteSize ) = 0;
56 
57         /** Sprites should call this when some part of the content has
58         	changed.
59 
60             That includes show/hide, i.e. for show, both showSprite()
61             and updateSprite() must be called.
62         */
63         virtual void updateSprite( const Sprite::Reference& 	rSprite,
64                                    const ::basegfx::B2DPoint& 	rPos,
65                                    const ::basegfx::B2DRange&	rUpdateArea ) = 0;
66     };
67 }
68 
69 #endif /* INCLUDED_CANVAS_SPRITESURFACE_HXX */
70