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 _CPPCANVAS_POLYPOLYGON_HXX 25 #define _CPPCANVAS_POLYPOLYGON_HXX 26 27 #include <com/sun/star/uno/Reference.hxx> 28 29 #include <boost/shared_ptr.hpp> 30 #include <cppcanvas/canvasgraphic.hxx> 31 32 namespace basegfx 33 { 34 class B2DPolygon; 35 class B2DPolyPolygon; 36 } 37 38 namespace com { namespace sun { namespace star { namespace rendering 39 { 40 class XPolyPolygon2D; 41 } } } } 42 43 44 /* Definition of PolyPolygon interface */ 45 46 namespace cppcanvas 47 { 48 49 /** This interface defines a PolyPolygon canvas object 50 51 Consider this object part of the view, and not of the model 52 data. Although the given polygon is typically copied and held 53 internally (to facilitate migration to incompatible canvases), 54 ::basegfx::B2DPolygon et al. are ref-counted copy-on-write 55 classes, i.e. memory shouldn't be wasted. On the other hand, 56 the API polygon created internally _does_ necessarily 57 duplicate the data held, but can be easily flushed away via 58 flush(). 59 */ 60 class PolyPolygon : public virtual CanvasGraphic 61 { 62 public: 63 virtual void addPolygon( const ::basegfx::B2DPolygon& rPoly ) = 0; 64 virtual void addPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly ) = 0; 65 66 /** Set polygon fill color 67 */ 68 virtual void setRGBAFillColor( Color::IntSRGBA ) = 0; 69 /** Set polygon line color 70 */ 71 virtual void setRGBALineColor( Color::IntSRGBA ) = 0; 72 /** Get polygon fill color 73 */ 74 virtual Color::IntSRGBA getRGBAFillColor() const = 0; 75 /** Get polygon line color 76 */ 77 virtual Color::IntSRGBA getRGBALineColor() const = 0; 78 79 virtual void setStrokeWidth( const double& rStrokeWidth ) = 0; 80 virtual double getStrokeWidth() const = 0; 81 82 virtual ::com::sun::star::uno::Reference< 83 ::com::sun::star::rendering::XPolyPolygon2D > getUNOPolyPolygon() const = 0; 84 }; 85 86 typedef ::boost::shared_ptr< ::cppcanvas::PolyPolygon > PolyPolygonSharedPtr; 87 } 88 89 #endif /* _CPPCANVAS_POLYPOLYGON_HXX */ 90