2010-10-27 12:45:03 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-10-04 11:25:41 +01: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 .
|
|
|
|
*/
|
2013-10-28 03:46:16 +01:00
|
|
|
#ifndef INCLUDED_CUI_SOURCE_INC_TRANSFRM_HXX
|
|
|
|
#define INCLUDED_CUI_SOURCE_INC_TRANSFRM_HXX
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
#include <svx/dlgctrl.hxx>
|
2012-09-26 21:20:27 +02:00
|
|
|
#include <svx/dialcontrol.hxx>
|
2016-08-24 15:06:35 +02:00
|
|
|
#include <svx/anchorid.hxx>
|
2009-10-31 00:36:06 +01:00
|
|
|
#include <basegfx/range/b2drange.hxx>
|
|
|
|
|
|
|
|
// predefines
|
|
|
|
class SdrView;
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Transform-Tab-Dialog
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2015-09-24 18:24:43 +02:00
|
|
|
struct SvxSwFrameValidation;
|
2018-05-29 09:32:41 +01:00
|
|
|
class SvxTransformTabDialog : public SfxTabDialogController
|
2009-10-31 00:36:06 +01:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
const SdrView* pView;
|
|
|
|
|
2016-08-24 15:06:35 +02:00
|
|
|
SvxAnchorIds nAnchorCtrls;
|
2015-09-24 18:24:43 +02:00
|
|
|
Link<SvxSwFrameValidation&,void> aValidateLink;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2018-05-29 09:32:41 +01:00
|
|
|
virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
public:
|
2018-05-29 09:32:41 +01:00
|
|
|
SvxTransformTabDialog(weld::Window* pParent, const SfxItemSet* pAttr,
|
|
|
|
const SdrView* pView,
|
|
|
|
SvxAnchorIds nAnchorTypes);
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2018-05-29 09:32:41 +01:00
|
|
|
//link for the Writer to validate positions
|
|
|
|
void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink );
|
2009-10-31 00:36:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* position and size tab page
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
class SvxPositionSizeTabPage : public SvxTabPage
|
|
|
|
{
|
2015-03-20 10:44:16 +02:00
|
|
|
static const sal_uInt16 pPosSizeRanges[];
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
const SfxItemSet& mrOutAttrs;
|
|
|
|
|
|
|
|
const SdrView* mpView;
|
|
|
|
|
|
|
|
// #i75273#
|
|
|
|
basegfx::B2DRange maRange;
|
|
|
|
basegfx::B2DRange maWorkRange;
|
|
|
|
basegfx::B2DPoint maAnchor;
|
|
|
|
|
2016-08-19 09:31:35 +01:00
|
|
|
MapUnit mePoolUnit;
|
2009-10-31 00:36:06 +01:00
|
|
|
FieldUnit meDlgUnit;
|
|
|
|
TriState mnProtectSizeState;
|
|
|
|
bool mbPageDisabled;
|
|
|
|
bool mbProtectDisabled;
|
|
|
|
bool mbSizeDisabled;
|
|
|
|
bool mbAdjustDisabled;
|
2018-07-19 09:52:29 +01:00
|
|
|
bool mbIgnoreAutoGrowWidth;
|
|
|
|
bool mbIgnoreAutoGrowHeight;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2014-04-29 19:05:05 +00:00
|
|
|
// from size
|
2009-10-31 00:36:06 +01:00
|
|
|
// #i75273#
|
|
|
|
double mfOldWidth;
|
|
|
|
double mfOldHeight;
|
2018-09-18 15:00:10 +01:00
|
|
|
RectPoint meRP;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2018-09-18 15:00:10 +01:00
|
|
|
SvxRectCtl m_aCtlPos;
|
|
|
|
SvxRectCtl m_aCtlSize;
|
2018-05-28 16:51:20 +01:00
|
|
|
|
|
|
|
// position
|
|
|
|
std::unique_ptr<weld::Widget> m_xFlPosition;
|
|
|
|
std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX;
|
|
|
|
std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY;
|
|
|
|
std::unique_ptr<weld::CustomWeld> m_xCtlPos;
|
|
|
|
|
|
|
|
// size
|
|
|
|
std::unique_ptr<weld::Widget> m_xFlSize;
|
|
|
|
std::unique_ptr<weld::Label> m_xFtWidth;
|
|
|
|
std::unique_ptr<weld::MetricSpinButton> m_xMtrWidth;
|
|
|
|
std::unique_ptr<weld::Label> m_xFtHeight;
|
|
|
|
std::unique_ptr<weld::MetricSpinButton> m_xMtrHeight;
|
|
|
|
std::unique_ptr<weld::CheckButton> m_xCbxScale;
|
|
|
|
std::unique_ptr<weld::CustomWeld> m_xCtlSize;
|
2014-02-25 18:04:51 +01:00
|
|
|
|
2018-05-28 16:51:20 +01:00
|
|
|
// protect
|
|
|
|
std::unique_ptr<weld::Widget> m_xFlProtect;
|
|
|
|
std::unique_ptr<weld::CheckButton> m_xTsbPosProtect;
|
|
|
|
std::unique_ptr<weld::CheckButton> m_xTsbSizeProtect;
|
|
|
|
|
|
|
|
// adjust
|
|
|
|
std::unique_ptr<weld::Widget> m_xFlAdjust;
|
|
|
|
std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowWidth;
|
|
|
|
std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowHeight;
|
|
|
|
|
|
|
|
DECL_LINK(ChangePosProtectHdl, weld::ToggleButton&, void);
|
|
|
|
DECL_LINK(ChangeSizeProtectHdl, weld::ToggleButton&, void);
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
void SetMinMaxPosition();
|
|
|
|
void GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange);
|
|
|
|
|
2018-05-28 16:51:20 +01:00
|
|
|
DECL_LINK( ChangeWidthHdl, weld::MetricSpinButton&, void );
|
|
|
|
DECL_LINK( ChangeHeightHdl, weld::MetricSpinButton&, void );
|
|
|
|
DECL_LINK( ClickSizeProtectHdl, weld::ToggleButton&, void );
|
|
|
|
DECL_LINK( ClickAutoHdl, weld::ToggleButton&, void );
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
public:
|
2019-09-24 14:10:48 +01:00
|
|
|
SvxPositionSizeTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SvxPositionSizeTabPage() override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2019-09-24 14:10:48 +01:00
|
|
|
static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
|
2015-03-20 10:44:16 +02:00
|
|
|
static const sal_uInt16* GetRanges() { return pPosSizeRanges; }
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool FillItemSet( SfxItemSet* ) override;
|
|
|
|
virtual void Reset( const SfxItemSet * ) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void ActivatePage( const SfxItemSet& rSet ) override;
|
2016-06-05 15:15:56 +02:00
|
|
|
virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2018-09-20 17:09:57 +01:00
|
|
|
virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
void Construct();
|
|
|
|
void SetView( const SdrView* pSdrView ) { mpView = pSdrView; }
|
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void FillUserData() override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
void DisableResize();
|
|
|
|
void DisableProtect();
|
|
|
|
|
|
|
|
void UpdateControlStates();
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
2012-04-15 17:50:21 +02:00
|
|
|
|* rotation angle tab page
|
2009-10-31 00:36:06 +01:00
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
class SvxAngleTabPage : public SvxTabPage
|
|
|
|
{
|
2015-03-20 10:44:16 +02:00
|
|
|
static const sal_uInt16 pAngleRanges[];
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
const SfxItemSet& rOutAttrs;
|
|
|
|
const SdrView* pView;
|
|
|
|
|
|
|
|
// #i75273#
|
|
|
|
basegfx::B2DRange maRange;
|
|
|
|
basegfx::B2DPoint maAnchor;
|
|
|
|
|
2016-08-19 09:31:35 +01:00
|
|
|
MapUnit ePoolUnit;
|
2009-10-31 00:36:06 +01:00
|
|
|
FieldUnit eDlgUnit;
|
2012-09-26 21:20:27 +02:00
|
|
|
|
2018-05-25 16:54:30 +01:00
|
|
|
svx::SvxDialControl m_aCtlAngle;
|
2018-09-18 15:00:10 +01:00
|
|
|
SvxRectCtl m_aCtlRect;
|
2018-05-25 16:54:30 +01:00
|
|
|
|
|
|
|
std::unique_ptr<weld::Widget> m_xFlPosition;
|
|
|
|
std::unique_ptr<weld::MetricSpinButton> m_xMtrPosX;
|
|
|
|
std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY;
|
|
|
|
std::unique_ptr<weld::CustomWeld> m_xCtlRect;
|
|
|
|
std::unique_ptr<weld::Widget> m_xFlAngle;
|
|
|
|
std::unique_ptr<weld::SpinButton> m_xNfAngle;
|
|
|
|
std::unique_ptr<weld::CustomWeld> m_xCtlAngle;
|
|
|
|
|
2009-10-31 00:36:06 +01:00
|
|
|
public:
|
2019-09-24 14:10:48 +01:00
|
|
|
SvxAngleTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SvxAngleTabPage() override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2019-09-24 14:10:48 +01:00
|
|
|
static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
|
2015-03-20 10:44:16 +02:00
|
|
|
static const sal_uInt16* GetRanges() { return pAngleRanges; }
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool FillItemSet( SfxItemSet* ) override;
|
|
|
|
virtual void Reset( const SfxItemSet * ) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void ActivatePage( const SfxItemSet& rSet ) override;
|
2016-06-05 15:15:56 +02:00
|
|
|
virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2018-05-25 16:54:30 +01:00
|
|
|
virtual void PointChanged(weld::DrawingArea* pWindow, RectPoint eRP) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
void Construct();
|
|
|
|
void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
2012-04-15 17:50:21 +02:00
|
|
|
|* slant/corner radius tab page
|
2009-10-31 00:36:06 +01:00
|
|
|
|*
|
|
|
|
\************************************************************************/
|
2018-09-20 16:58:21 +01:00
|
|
|
class SvxSlantTabPage : public SfxTabPage
|
2009-10-31 00:36:06 +01:00
|
|
|
{
|
2015-03-20 10:44:16 +02:00
|
|
|
static const sal_uInt16 pSlantRanges[];
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
const SfxItemSet& rOutAttrs;
|
|
|
|
|
|
|
|
const SdrView* pView;
|
|
|
|
|
2016-08-19 09:31:35 +01:00
|
|
|
MapUnit ePoolUnit;
|
2009-10-31 00:36:06 +01:00
|
|
|
FieldUnit eDlgUnit;
|
2014-02-25 18:04:51 +01:00
|
|
|
|
2018-05-25 16:19:52 +01:00
|
|
|
std::unique_ptr<weld::Widget> m_xFlRadius;
|
|
|
|
std::unique_ptr<weld::MetricSpinButton> m_xMtrRadius;
|
|
|
|
std::unique_ptr<weld::Widget> m_xFlAngle;
|
|
|
|
std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle;
|
|
|
|
std::unique_ptr<weld::Widget> m_aControlGroups[2];
|
|
|
|
std::unique_ptr<weld::Widget> m_aControlGroupX[2];
|
|
|
|
std::unique_ptr<weld::MetricSpinButton> m_aControlX[2];
|
|
|
|
std::unique_ptr<weld::Widget> m_aControlGroupY[2];
|
|
|
|
std::unique_ptr<weld::MetricSpinButton> m_aControlY[2];
|
|
|
|
|
2009-10-31 00:36:06 +01:00
|
|
|
public:
|
2019-09-24 14:10:48 +01:00
|
|
|
SvxSlantTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~SvxSlantTabPage() override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2019-09-24 14:10:48 +01:00
|
|
|
static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* );
|
2015-03-20 10:44:16 +02:00
|
|
|
static const sal_uInt16* GetRanges() { return pSlantRanges; }
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual bool FillItemSet( SfxItemSet* ) override;
|
|
|
|
virtual void Reset( const SfxItemSet * ) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void ActivatePage( const SfxItemSet& rSet ) override;
|
2016-06-05 15:15:56 +02:00
|
|
|
virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
|
2009-10-31 00:36:06 +01:00
|
|
|
|
|
|
|
void Construct();
|
|
|
|
void SetView( const SdrView* pSdrView ) { pView = pSdrView; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-10-28 03:46:16 +01:00
|
|
|
#endif // INCLUDED_CUI_SOURCE_INC_TRANSFRM_HXX
|
2009-10-31 00:36:06 +01:00
|
|
|
|
2010-10-27 12:45:03 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|