/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * 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 . */ #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_FRMPAGE_HXX #define INCLUDED_SW_SOURCE_UIBASE_INC_FRMPAGE_HXX #include #include #include #include #include #include #include #include #include #include #include namespace sfx2{class FileDialogHelper;} class SwWrtShell; struct FrameMap; // OD 12.11.2003 #i22341# struct SwPosition; // frame dialog class SwFramePage: public SfxTabPage { // size VclPtr m_pWidthFT; VclPtr m_pWidthAutoFT; PercentField m_aWidthED; VclPtr m_pRelWidthCB; VclPtr m_pRelWidthRelationLB; VclPtr m_pAutoWidthCB; VclPtr m_pHeightFT; VclPtr m_pHeightAutoFT; PercentField m_aHeightED; VclPtr m_pRelHeightCB; VclPtr m_pRelHeightRelationLB; VclPtr m_pAutoHeightCB; VclPtr m_pFixedRatioCB; VclPtr m_pRealSizeBT; // anchor VclPtr m_pAnchorFrame; VclPtr m_pAnchorAtPageRB; VclPtr m_pAnchorAtParaRB; VclPtr m_pAnchorAtCharRB; VclPtr m_pAnchorAsCharRB; VclPtr m_pAnchorAtFrameRB; // position VclPtr m_pHorizontalFT; VclPtr m_pHorizontalDLB; VclPtr m_pAtHorzPosFT; VclPtr m_pAtHorzPosED; VclPtr m_pHoriRelationFT; VclPtr m_pHoriRelationLB; VclPtr m_pMirrorPagesCB; VclPtr m_pVerticalFT; VclPtr m_pVerticalDLB; VclPtr m_pAtVertPosFT; VclPtr m_pAtVertPosED; VclPtr m_pVertRelationFT; VclPtr m_pVertRelationLB; // #i18732# - check box for new option 'FollowTextFlow' VclPtr m_pFollowTextFlowCB; // example VclPtr m_pExampleWN; //'string provider' SvxSwFramePosString m_aFramePosString; bool m_bAtHorzPosModified; bool m_bAtVertPosModified; bool m_bFormat; bool m_bNew; bool m_bNoModifyHdl; bool m_bIsVerticalFrame; //current frame is in vertical environment - strings are exchanged // --> OD 2009-08-31 #mongolianlayout# bool m_bIsVerticalL2R; bool m_bIsInRightToLeft; // current frame is in right-to-left environment - strings are exchanged bool m_bHtmlMode; sal_uInt16 m_nHtmlMode; OUString m_sDlgType; Size m_aGrfSize; SwTwips m_nUpperBorder; SwTwips m_nLowerBorder; double m_fWidthHeightRatio; //width-to-height ratio to support the KeepRatio button // OD 12.11.2003 #i22341# - keep content position of character for // to character anchored objects. const SwPosition* mpToCharContentPos; // old alignment sal_Int16 m_nOldH; sal_Int16 m_nOldHRel; sal_Int16 m_nOldV; sal_Int16 m_nOldVRel; FrameMap* m_pVMap; FrameMap* m_pHMap; bool m_bAllowVertPositioning; bool m_bIsMathOLE; bool m_bIsMathBaselineAlignment; virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; DECL_LINK(RangeModifyLoseFocusHdl, Control&, void); DECL_LINK(RangeModifyClickHdl, Button*, void); void RangeModifyHdl(); DECL_LINK(AnchorTypeHdl, Button*, void); DECL_LINK( PosHdl, ListBox&, void ); DECL_LINK( RelHdl, ListBox&, void ); void InitPos(RndStdIds eId, sal_Int16 nH, sal_Int16 nHRel, sal_Int16 nV, sal_Int16 nVRel, long nX, long nY); DECL_LINK(RealSizeHdl, Button *, void); DECL_LINK( RelSizeClickHdl, Button *, void ); DECL_LINK(MirrorHdl, Button *, void); DECL_LINK( AutoWidthClickHdl, Button *, void); DECL_LINK( AutoHeightClickHdl, Button *, void); // update example void UpdateExample(); DECL_LINK( ModifyHdl, Edit&, void ); void Init(const SfxItemSet& rSet, bool bReset = false); // OD 12.11.2003 #i22341# - adjustment to handle maps, that are ambigous // in the alignment. sal_Int32 FillPosLB( const FrameMap* _pMap, const sal_Int16 _nAlign, const sal_Int16 _nRel, ListBox& _rLB ); // OD 14.11.2003 #i22341# - adjustment to handle maps, that are ambigous // in their string entries. void FillRelLB( const FrameMap* _pMap, const sal_uInt16 _nLBSelPos, const sal_Int16 _nAlign, const sal_Int16 _nRel, ListBox& _rLB, FixedText& _rFT ); sal_Int32 GetMapPos( const FrameMap *pMap, ListBox &rAlignLB ); static sal_Int16 GetAlignment(FrameMap *pMap, sal_Int32 nMapPos, ListBox &rAlignLB, ListBox &rRelationLB); static sal_Int16 GetRelation(FrameMap *pMap, ListBox &rRelationLB); RndStdIds GetAnchor(); void setOptimalFrameWidth(); void setOptimalRelWidth(); void EnableGraficMode(); // hides auto check boxes and re-org controls for "Real Size" button SwWrtShell *getFrameDlgParentShell(); using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; static const sal_uInt16 aPageRg[]; public: SwFramePage(vcl::Window *pParent, const SfxItemSet &rSet); virtual ~SwFramePage() override; virtual void dispose() override; static VclPtr Create(vcl::Window *pParent, const SfxItemSet *rSet); static const sal_uInt16* GetRanges() { return aPageRg; } virtual bool FillItemSet(SfxItemSet *rSet) override; virtual void Reset(const SfxItemSet *rSet) override; void SetNewFrame(bool bNewFrame) { m_bNew = bNewFrame; } void SetFormatUsed(bool bFormat); void SetFrameType(const OUString &rType) { m_sDlgType = rType; } inline bool IsInGraficMode() { return m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog"; } void EnableVerticalPositioning( bool bEnable ); }; class SwGrfExtPage: public SfxTabPage { // mirror VclPtr m_pMirror; VclPtr m_pMirrorVertBox; VclPtr m_pMirrorHorzBox; VclPtr m_pAllPagesRB; VclPtr m_pLeftPagesRB; VclPtr m_pRightPagesRB; VclPtr m_pBmpWin; VclPtr m_pConnectED; VclPtr m_pBrowseBT; OUString aFilterName; OUString aGrfName, aNewGrfName; ::sfx2::FileDialogHelper* pGrfDlg; bool bHtmlMode; // handler for mirroring DECL_LINK(MirrorHdl, Button*, void); DECL_LINK(BrowseHdl, Button*, void); virtual void ActivatePage(const SfxItemSet& rSet) override; virtual ~SwGrfExtPage() override; virtual void dispose() override; using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; public: SwGrfExtPage(vcl::Window *pParent, const SfxItemSet &rSet); static VclPtr Create(vcl::Window *pParent, const SfxItemSet *rSet); virtual bool FillItemSet(SfxItemSet *rSet) override; virtual void Reset(const SfxItemSet *rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; }; class SwFrameURLPage : public SfxTabPage { // hyperlink VclPtr pURLED; VclPtr pSearchPB; VclPtr pNameED; VclPtr pFrameCB; // image map VclPtr pServerCB; VclPtr pClientCB; DECL_LINK(InsertFileHdl, Button*, void); using SfxTabPage::ActivatePage; using SfxTabPage::DeactivatePage; public: SwFrameURLPage(vcl::Window *pParent, const SfxItemSet &rSet); virtual ~SwFrameURLPage() override; virtual void dispose() override; static VclPtr Create(vcl::Window *pParent, const SfxItemSet *rSet); virtual bool FillItemSet(SfxItemSet *rSet) override; virtual void Reset(const SfxItemSet *rSet) override; }; class SwFrameAddPage : public SfxTabPage { VclPtr m_pNameFrame; VclPtr m_pNameFT; VclPtr m_pNameED; VclPtr m_pAltNameFT; VclPtr m_pAltNameED; VclPtr m_pPrevFT; VclPtr m_pPrevLB; VclPtr m_pNextFT; VclPtr m_pNextLB; VclPtr m_pProtectFrame; VclPtr m_pProtectContentCB; VclPtr m_pProtectFrameCB; VclPtr m_pProtectSizeCB; VclPtr m_pContentAlignFrame; VclPtr m_pVertAlignLB; VclPtr m_pPropertiesFrame; VclPtr m_pEditInReadonlyCB; VclPtr m_pPrintFrameCB; VclPtr m_pTextFlowFT; VclPtr m_pTextFlowLB; SwWrtShell* m_pWrtSh; OUString m_sDlgType; bool m_bHtmlMode; bool m_bFormat; bool m_bNew; DECL_LINK(EditModifyHdl, Edit&, void); DECL_LINK(ChainModifyHdl, ListBox&, void); static const sal_uInt16 aAddPgRg[]; public: SwFrameAddPage(vcl::Window *pParent, const SfxItemSet &rSet); virtual ~SwFrameAddPage() override; virtual void dispose() override; static VclPtr Create(vcl::Window *pParent, const SfxItemSet *rSet); static const sal_uInt16* GetRanges() { return aAddPgRg; } virtual bool FillItemSet(SfxItemSet *rSet) override; virtual void Reset(const SfxItemSet *rSet) override; void SetFormatUsed(bool bFormat); void SetFrameType(const OUString &rType) { m_sDlgType = rType; } void SetNewFrame(bool bNewFrame) { m_bNew = bNewFrame; } void SetShell(SwWrtShell* pSh) { m_pWrtSh = pSh; } }; #endif // INCLUDED_SW_SOURCE_UIBASE_INC_FRMPAGE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */