12d788491SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
32d788491SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
42d788491SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
52d788491SAndrew Rist  * distributed with this work for additional information
62d788491SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
72d788491SAndrew Rist  * to you under the Apache License, Version 2.0 (the
82d788491SAndrew Rist  * "License"); you may not use this file except in compliance
92d788491SAndrew Rist  * with the License.  You may obtain a copy of the License at
102d788491SAndrew Rist  *
112d788491SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
122d788491SAndrew Rist  *
132d788491SAndrew Rist  * Unless required by applicable law or agreed to in writing,
142d788491SAndrew Rist  * software distributed under the License is distributed on an
152d788491SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
162d788491SAndrew Rist  * KIND, either express or implied.  See the License for the
172d788491SAndrew Rist  * specific language governing permissions and limitations
182d788491SAndrew Rist  * under the License.
192d788491SAndrew Rist  *
202d788491SAndrew Rist  *************************************************************/
212d788491SAndrew Rist 
222d788491SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _CPPCANVAS_BASEGFXFACTORY_HXX
25cdf0e10cSrcweir #define _CPPCANVAS_BASEGFXFACTORY_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <cppcanvas/canvas.hxx>
28cdf0e10cSrcweir #include <cppcanvas/bitmapcanvas.hxx>
29cdf0e10cSrcweir #include <cppcanvas/spritecanvas.hxx>
30cdf0e10cSrcweir #include <cppcanvas/polypolygon.hxx>
31cdf0e10cSrcweir #include <cppcanvas/bitmap.hxx>
32cdf0e10cSrcweir #include <cppcanvas/renderer.hxx>
33cdf0e10cSrcweir #include <cppcanvas/text.hxx>
34cdf0e10cSrcweir #include <cppcanvas/sprite.hxx>
35cdf0e10cSrcweir #include <basegfx/vector/b2isize.hxx>
36cdf0e10cSrcweir 
37*b63233d8Sdamjan #include <cppcanvas/cppcanvasdllapi.h>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir namespace basegfx
40cdf0e10cSrcweir {
41cdf0e10cSrcweir     class B2DPolygon;
42cdf0e10cSrcweir     class B2DPolyPolygon;
43cdf0e10cSrcweir }
44cdf0e10cSrcweir 
45cdf0e10cSrcweir namespace rtl
46cdf0e10cSrcweir {
47cdf0e10cSrcweir     class OUString;
48cdf0e10cSrcweir }
49cdf0e10cSrcweir 
50cdf0e10cSrcweir /* Definition of BaseGfxFactory class */
51cdf0e10cSrcweir 
52cdf0e10cSrcweir namespace cppcanvas
53cdf0e10cSrcweir {
54cdf0e10cSrcweir     /** The BaseGfxFactory creates Canvas objects for various basegfx
55cdf0e10cSrcweir         primitives, such as polygons and bitmaps (not yet
56cdf0e10cSrcweir         implemented).
57cdf0e10cSrcweir 
58cdf0e10cSrcweir         Please note that the objects created for a specific Canvas can
59cdf0e10cSrcweir         only be drawn on exactly that canvas. You have to regenerate
60cdf0e10cSrcweir         them for different canvases.
61cdf0e10cSrcweir      */
62*b63233d8Sdamjan     class CPPCANVAS_DLLPUBLIC BaseGfxFactory
63cdf0e10cSrcweir     {
64cdf0e10cSrcweir     public:
65cdf0e10cSrcweir         static BaseGfxFactory& getInstance();
66cdf0e10cSrcweir 
67cdf0e10cSrcweir         /** Create a polygon from a ::basegfx::B2DPolygon
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 			The created polygon initially has the same size in user
70cdf0e10cSrcweir 			coordinate space as the source polygon
71cdf0e10cSrcweir          */
72cdf0e10cSrcweir         PolyPolygonSharedPtr 	createPolyPolygon( const CanvasSharedPtr&, const ::basegfx::B2DPolygon& rPoly ) const;
73cdf0e10cSrcweir         PolyPolygonSharedPtr 	createPolyPolygon( const CanvasSharedPtr&, const ::basegfx::B2DPolyPolygon& rPoly ) const;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir         /** Create an uninitialized bitmap with the given size
76cdf0e10cSrcweir          */
77cdf0e10cSrcweir         BitmapSharedPtr 		createBitmap( const CanvasSharedPtr&, const ::basegfx::B2ISize& rSize ) const;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir         /** Create an uninitialized alpha bitmap with the given size
80cdf0e10cSrcweir          */
81cdf0e10cSrcweir         BitmapSharedPtr 		createAlphaBitmap( const CanvasSharedPtr&, const ::basegfx::B2ISize& rSize ) const;
82cdf0e10cSrcweir 
83cdf0e10cSrcweir         /** Create a text portion with the given content string
84cdf0e10cSrcweir          */
85cdf0e10cSrcweir         TextSharedPtr 			createText( const CanvasSharedPtr&, const ::rtl::OUString& ) const;
86cdf0e10cSrcweir 
87cdf0e10cSrcweir     private:
88cdf0e10cSrcweir         friend struct InitInstance2;
89cdf0e10cSrcweir 
90cdf0e10cSrcweir         // singleton
91cdf0e10cSrcweir         BaseGfxFactory();
92cdf0e10cSrcweir         ~BaseGfxFactory();
93cdf0e10cSrcweir 
94cdf0e10cSrcweir         // default: disabled copy/assignment
95cdf0e10cSrcweir         BaseGfxFactory(const BaseGfxFactory&);
96cdf0e10cSrcweir         BaseGfxFactory& operator=( const BaseGfxFactory& );
97cdf0e10cSrcweir     };
98cdf0e10cSrcweir 
99cdf0e10cSrcweir }
100cdf0e10cSrcweir 
101cdf0e10cSrcweir #endif /* _CPPCANVAS_BASEGFXFACTORY_HXX */
102