1*2d788491SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*2d788491SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*2d788491SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*2d788491SAndrew Rist * distributed with this work for additional information 6*2d788491SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*2d788491SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*2d788491SAndrew Rist * "License"); you may not use this file except in compliance 9*2d788491SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*2d788491SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*2d788491SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*2d788491SAndrew Rist * software distributed under the License is distributed on an 15*2d788491SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*2d788491SAndrew Rist * KIND, either express or implied. See the License for the 17*2d788491SAndrew Rist * specific language governing permissions and limitations 18*2d788491SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*2d788491SAndrew Rist *************************************************************/ 21*2d788491SAndrew Rist 22*2d788491SAndrew 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 37cdf0e10cSrcweir 38cdf0e10cSrcweir namespace basegfx 39cdf0e10cSrcweir { 40cdf0e10cSrcweir class B2DPolygon; 41cdf0e10cSrcweir class B2DPolyPolygon; 42cdf0e10cSrcweir } 43cdf0e10cSrcweir 44cdf0e10cSrcweir namespace rtl 45cdf0e10cSrcweir { 46cdf0e10cSrcweir class OUString; 47cdf0e10cSrcweir } 48cdf0e10cSrcweir 49cdf0e10cSrcweir /* Definition of BaseGfxFactory class */ 50cdf0e10cSrcweir 51cdf0e10cSrcweir namespace cppcanvas 52cdf0e10cSrcweir { 53cdf0e10cSrcweir /** The BaseGfxFactory creates Canvas objects for various basegfx 54cdf0e10cSrcweir primitives, such as polygons and bitmaps (not yet 55cdf0e10cSrcweir implemented). 56cdf0e10cSrcweir 57cdf0e10cSrcweir Please note that the objects created for a specific Canvas can 58cdf0e10cSrcweir only be drawn on exactly that canvas. You have to regenerate 59cdf0e10cSrcweir them for different canvases. 60cdf0e10cSrcweir */ 61cdf0e10cSrcweir class BaseGfxFactory 62cdf0e10cSrcweir { 63cdf0e10cSrcweir public: 64cdf0e10cSrcweir static BaseGfxFactory& getInstance(); 65cdf0e10cSrcweir 66cdf0e10cSrcweir /** Create a polygon from a ::basegfx::B2DPolygon 67cdf0e10cSrcweir 68cdf0e10cSrcweir The created polygon initially has the same size in user 69cdf0e10cSrcweir coordinate space as the source polygon 70cdf0e10cSrcweir */ 71cdf0e10cSrcweir PolyPolygonSharedPtr createPolyPolygon( const CanvasSharedPtr&, const ::basegfx::B2DPolygon& rPoly ) const; 72cdf0e10cSrcweir PolyPolygonSharedPtr createPolyPolygon( const CanvasSharedPtr&, const ::basegfx::B2DPolyPolygon& rPoly ) const; 73cdf0e10cSrcweir 74cdf0e10cSrcweir /** Create an uninitialized bitmap with the given size 75cdf0e10cSrcweir */ 76cdf0e10cSrcweir BitmapSharedPtr createBitmap( const CanvasSharedPtr&, const ::basegfx::B2ISize& rSize ) const; 77cdf0e10cSrcweir 78cdf0e10cSrcweir /** Create an uninitialized alpha bitmap with the given size 79cdf0e10cSrcweir */ 80cdf0e10cSrcweir BitmapSharedPtr createAlphaBitmap( const CanvasSharedPtr&, const ::basegfx::B2ISize& rSize ) const; 81cdf0e10cSrcweir 82cdf0e10cSrcweir /** Create a text portion with the given content string 83cdf0e10cSrcweir */ 84cdf0e10cSrcweir TextSharedPtr createText( const CanvasSharedPtr&, const ::rtl::OUString& ) const; 85cdf0e10cSrcweir 86cdf0e10cSrcweir private: 87cdf0e10cSrcweir friend struct InitInstance2; 88cdf0e10cSrcweir 89cdf0e10cSrcweir // singleton 90cdf0e10cSrcweir BaseGfxFactory(); 91cdf0e10cSrcweir ~BaseGfxFactory(); 92cdf0e10cSrcweir 93cdf0e10cSrcweir // default: disabled copy/assignment 94cdf0e10cSrcweir BaseGfxFactory(const BaseGfxFactory&); 95cdf0e10cSrcweir BaseGfxFactory& operator=( const BaseGfxFactory& ); 96cdf0e10cSrcweir }; 97cdf0e10cSrcweir 98cdf0e10cSrcweir } 99cdf0e10cSrcweir 100cdf0e10cSrcweir #endif /* _CPPCANVAS_BASEGFXFACTORY_HXX */ 101