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_SLIDESHOW_USERPAINTOVERLAY_HXX 25 #define INCLUDED_SLIDESHOW_USERPAINTOVERLAY_HXX 26 27 #include <basegfx/polygon/b2dpolypolygon.hxx> 28 29 #include "unoview.hxx" 30 #include "rgbcolor.hxx" 31 32 #include <boost/utility.hpp> 33 #include <boost/shared_ptr.hpp> 34 #include <vector> 35 36 /* Definition of UserPaintOverlay class */ 37 38 namespace slideshow 39 { 40 namespace internal 41 { 42 class EventMultiplexer; 43 struct SlideShowContext; 44 45 class PaintOverlayHandler; 46 typedef ::boost::shared_ptr< class UserPaintOverlay > UserPaintOverlaySharedPtr; 47 typedef ::std::vector< ::cppcanvas::PolyPolygonSharedPtr> PolyPolygonVector; 48 /** Slide overlay, which can be painted into by the user. 49 50 This class registers itself at the EventMultiplexer, 51 listening for mouse clicks and moves. When the mouse is 52 dragged, a hand sketching in the selected color is shown. 53 */ 54 class UserPaintOverlay : private boost::noncopyable 55 { 56 public: 57 /** Create a UserPaintOverlay 58 59 @param rStrokeColor 60 Color to use for drawing 61 62 @param nStrokeWidth 63 Width of the stroked path 64 */ 65 static UserPaintOverlaySharedPtr create( const RGBColor& rStrokeColor, 66 double nStrokeWidth, 67 const SlideShowContext& rContext, 68 const PolyPolygonVector& rPolygons, 69 bool bActive); 70 ~UserPaintOverlay(); 71 PolyPolygonVector getPolygons(); 72 void drawPolygons(); 73 74 void update_settings( bool bUserPaintEnabled, RGBColor const& aUserPaintColor, double dUserPaintStrokeWidth ); 75 76 77 private: 78 UserPaintOverlay( const RGBColor& rStrokeColor, 79 double nStrokeWidth, 80 const SlideShowContext& rContext, 81 const PolyPolygonVector& rPolygons, 82 bool bActive ); 83 84 ::boost::shared_ptr<PaintOverlayHandler> mpHandler; 85 EventMultiplexer& mrMultiplexer; 86 }; 87 } 88 } 89 90 #endif /* INCLUDED_SLIDESHOW_USERPAINTOVERLAY_HXX */ 91