1*3334a7e6SAndrew Rist /************************************************************** 2*3334a7e6SAndrew Rist * 3*3334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*3334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*3334a7e6SAndrew Rist * distributed with this work for additional information 6*3334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*3334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*3334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 9*3334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 10*3334a7e6SAndrew Rist * 11*3334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*3334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*3334a7e6SAndrew Rist * software distributed under the License is distributed on an 15*3334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*3334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 17*3334a7e6SAndrew Rist * specific language governing permissions and limitations 18*3334a7e6SAndrew Rist * under the License. 19*3334a7e6SAndrew Rist * 20*3334a7e6SAndrew Rist *************************************************************/ 21*3334a7e6SAndrew Rist 22*3334a7e6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _CONTWND_HXX 25cdf0e10cSrcweir #define _CONTWND_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <tools/poly.hxx> 28cdf0e10cSrcweir #include <svx/graphctl.hxx> 29cdf0e10cSrcweir 30cdf0e10cSrcweir /************************************************************************* 31cdf0e10cSrcweir |* 32cdf0e10cSrcweir |* 33cdf0e10cSrcweir |* 34cdf0e10cSrcweir \************************************************************************/ 35cdf0e10cSrcweir 36cdf0e10cSrcweir class ContourWindow : public GraphCtrl 37cdf0e10cSrcweir { 38cdf0e10cSrcweir PolyPolygon aPolyPoly; 39cdf0e10cSrcweir Color aPipetteColor; 40cdf0e10cSrcweir Rectangle aWorkRect; 41cdf0e10cSrcweir Link aPipetteLink; 42cdf0e10cSrcweir Link aPipetteClickLink; 43cdf0e10cSrcweir Link aWorkplaceClickLink; 44cdf0e10cSrcweir sal_Bool bPipetteMode; 45cdf0e10cSrcweir sal_Bool bWorkplaceMode; 46cdf0e10cSrcweir sal_Bool bClickValid; 47cdf0e10cSrcweir 48cdf0e10cSrcweir protected: 49cdf0e10cSrcweir 50cdf0e10cSrcweir virtual void MouseButtonDown(const MouseEvent& rMEvt); 51cdf0e10cSrcweir virtual void MouseMove(const MouseEvent& rMEvt); 52cdf0e10cSrcweir virtual void MouseButtonUp(const MouseEvent& rMEvt); 53cdf0e10cSrcweir virtual void SdrObjCreated( const SdrObject& rObj ); 54cdf0e10cSrcweir virtual void InitSdrModel(); 55cdf0e10cSrcweir virtual void Paint( const Rectangle& rRect ); 56cdf0e10cSrcweir 57cdf0e10cSrcweir void CreatePolyPolygon(); 58cdf0e10cSrcweir 59cdf0e10cSrcweir public: 60cdf0e10cSrcweir 61cdf0e10cSrcweir ContourWindow( Window* pParent, const ResId& rResId ); 62cdf0e10cSrcweir ~ContourWindow(); 63cdf0e10cSrcweir 64cdf0e10cSrcweir void SetPolyPolygon( const PolyPolygon& rPolyPoly ); 65cdf0e10cSrcweir const PolyPolygon& GetPolyPolygon(); 66cdf0e10cSrcweir SetPipetteMode(const sal_Bool bPipette)67cdf0e10cSrcweir void SetPipetteMode( const sal_Bool bPipette ) { bPipetteMode = bPipette; } IsPipetteMode() const68cdf0e10cSrcweir sal_Bool IsPipetteMode() const { return bPipetteMode; } GetPipetteColor() const69cdf0e10cSrcweir const Color& GetPipetteColor() const { return aPipetteColor; } 70cdf0e10cSrcweir IsClickValid() const71cdf0e10cSrcweir sal_Bool IsClickValid() const { return bClickValid; } 72cdf0e10cSrcweir sal_Bool IsContourChanged() const; 73cdf0e10cSrcweir SetWorkplaceMode(const sal_Bool bWorkplace)74cdf0e10cSrcweir void SetWorkplaceMode( const sal_Bool bWorkplace ) { bWorkplaceMode = bWorkplace; } IsWorkplaceMode() const75cdf0e10cSrcweir sal_Bool IsWorkplaceMode() const { return bWorkplaceMode; } GetWorkRect() const76cdf0e10cSrcweir const Rectangle& GetWorkRect() const { return aWorkRect; } 77cdf0e10cSrcweir SetPipetteHdl(const Link & rLink)78cdf0e10cSrcweir void SetPipetteHdl( const Link& rLink ) { aPipetteLink = rLink; } SetPipetteClickHdl(const Link & rLink)79cdf0e10cSrcweir void SetPipetteClickHdl( const Link& rLink ) { aPipetteClickLink = rLink; } 80cdf0e10cSrcweir SetWorkplaceClickHdl(const Link & rLink)81cdf0e10cSrcweir void SetWorkplaceClickHdl( const Link& rLink ) { aWorkplaceClickLink = rLink; } 82cdf0e10cSrcweir }; 83cdf0e10cSrcweir 84cdf0e10cSrcweir 85cdf0e10cSrcweir #endif 86cdf0e10cSrcweir 87