2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-21 22:06:52 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-10-28 03:41:20 +01:00
|
|
|
#ifndef INCLUDED_SVX_SOURCE_DIALOG_CONTWND_HXX
|
|
|
|
#define INCLUDED_SVX_SOURCE_DIALOG_CONTWND_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2004-01-06 14:24:11 +00:00
|
|
|
#include <tools/poly.hxx>
|
2007-06-27 15:56:31 +00:00
|
|
|
#include <svx/graphctl.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
class ContourWindow : public GraphCtrl
|
|
|
|
{
|
2014-09-28 07:51:19 +02:00
|
|
|
tools::PolyPolygon aPolyPoly;
|
2000-09-18 16:07:07 +00:00
|
|
|
Color aPipetteColor;
|
|
|
|
Rectangle aWorkRect;
|
2015-04-30 10:20:00 +02:00
|
|
|
Link<> aPipetteLink;
|
|
|
|
Link<> aPipetteClickLink;
|
|
|
|
Link<> aWorkplaceClickLink;
|
2014-04-14 16:15:22 +02:00
|
|
|
bool bPipetteMode;
|
|
|
|
bool bWorkplaceMode;
|
|
|
|
bool bClickValid;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2014-03-27 18:12:18 +01:00
|
|
|
virtual void MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE;
|
|
|
|
virtual void MouseMove(const MouseEvent& rMEvt) SAL_OVERRIDE;
|
|
|
|
virtual void MouseButtonUp(const MouseEvent& rMEvt) SAL_OVERRIDE;
|
|
|
|
virtual void SdrObjCreated( const SdrObject& rObj ) SAL_OVERRIDE;
|
|
|
|
virtual void InitSdrModel() SAL_OVERRIDE;
|
2015-04-28 11:00:54 +09:00
|
|
|
virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE;
|
2014-09-05 12:51:01 +01:00
|
|
|
virtual Size GetOptimalSize() const SAL_OVERRIDE;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
void CreatePolyPolygon();
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
ContourWindow(vcl::Window* pParent, WinBits nBits);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-09-28 07:51:19 +02:00
|
|
|
void SetPolyPolygon( const tools::PolyPolygon& rPolyPoly );
|
|
|
|
const tools::PolyPolygon& GetPolyPolygon();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-04-14 16:15:22 +02:00
|
|
|
void SetPipetteMode( const bool bPipette ) { bPipetteMode = bPipette; }
|
|
|
|
bool IsPipetteMode() const { return bPipetteMode; }
|
2000-09-18 16:07:07 +00:00
|
|
|
const Color& GetPipetteColor() const { return aPipetteColor; }
|
|
|
|
|
2014-04-14 16:15:22 +02:00
|
|
|
bool IsClickValid() const { return bClickValid; }
|
2013-03-15 10:56:55 +09:00
|
|
|
bool IsContourChanged() const;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-04-14 16:15:22 +02:00
|
|
|
void SetWorkplaceMode( const bool bWorkplace ) { bWorkplaceMode = bWorkplace; }
|
|
|
|
bool IsWorkplaceMode() const { return bWorkplaceMode; }
|
2000-09-18 16:07:07 +00:00
|
|
|
const Rectangle& GetWorkRect() const { return aWorkRect; }
|
|
|
|
|
2015-04-30 10:20:00 +02:00
|
|
|
void SetPipetteHdl( const Link<>& rLink ) { aPipetteLink = rLink; }
|
|
|
|
void SetPipetteClickHdl( const Link<>& rLink ) { aPipetteClickLink = rLink; }
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-04-30 10:20:00 +02:00
|
|
|
void SetWorkplaceClickHdl( const Link<>& rLink ) { aWorkplaceClickLink = rLink; }
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-27 13:11:31 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|