1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _CONTIMP_HXX_ 28 #define _CONTIMP_HXX_ 29 30 #ifndef _CONTDLG_HXX 31 #include <svx/contdlg.hxx> 32 #endif 33 #include "contwnd.hxx" 34 #include <vcl/toolbox.hxx> 35 #include <vcl/status.hxx> 36 37 #define CONT_RESID(nId) ResId( nId, DIALOG_MGR() ) 38 39 /************************************************************************* 40 |* 41 |* 42 |* 43 \************************************************************************/ 44 45 class SvxSuperContourDlg : public SvxContourDlg 46 { 47 using SvxContourDlg::GetPolyPolygon; 48 49 Graphic aGraphic; 50 Graphic aUndoGraphic; 51 Graphic aRedoGraphic; 52 Graphic aUpdateGraphic; 53 PolyPolygon aUpdatePolyPoly; 54 Timer aUpdateTimer; 55 Timer aCreateTimer; 56 Size aLastSize; 57 void* pUpdateEditingObject; 58 void* pCheckObj; 59 SvxContourDlgItem aContourItem; 60 ToolBox aTbx1; 61 MetricField aMtfTolerance; 62 ContourWindow aContourWnd; 63 StatusBar aStbStatus; 64 sal_uIntPtr nGrfChanged; 65 sal_Bool bExecState; 66 sal_Bool bPipetteMode; 67 sal_Bool bWorkplaceMode; 68 sal_Bool bUpdateGraphicLinked; 69 sal_Bool bGraphicLinked; 70 ImageList maImageList; 71 ImageList maImageListH; 72 73 virtual void Resize(); 74 virtual sal_Bool Close(); 75 76 void DoAutoCreate(); 77 void ReducePoints( const long nTol = 8 ); 78 79 DECL_LINK( Tbx1ClickHdl, ToolBox* ); 80 DECL_LINK( MousePosHdl, ContourWindow* ); 81 DECL_LINK( GraphSizeHdl, ContourWindow* ); 82 DECL_LINK( UpdateHdl, Timer* ); 83 DECL_LINK( CreateHdl, Timer* ); 84 DECL_LINK( StateHdl, ContourWindow* ); 85 DECL_LINK( PipetteHdl, ContourWindow* ); 86 DECL_LINK( PipetteClickHdl, ContourWindow* ); 87 DECL_LINK( WorkplaceClickHdl, ContourWindow* ); 88 DECL_LINK( MiscHdl, void* ); 89 90 public: 91 92 SvxSuperContourDlg( SfxBindings *pBindings, SfxChildWindow *pCW, 93 Window* pParent, const ResId& rResId ); 94 ~SvxSuperContourDlg(); 95 96 void SetExecState( sal_Bool bEnable ); 97 98 void SetGraphic( const Graphic& rGraphic ); 99 void SetGraphicLinked( sal_Bool bLinked ) { bGraphicLinked = bLinked; } 100 const Graphic& GetGraphic() const { return aGraphic; } 101 sal_Bool IsGraphicChanged() const { return nGrfChanged > 0UL; } 102 103 void SetPolyPolygon( const PolyPolygon& rPolyPoly ); 104 PolyPolygon GetPolyPolygon( sal_Bool bRescaleToGraphic = sal_True ); 105 106 void SetEditingObject( void* pObj ) { pCheckObj = pObj; } 107 const void* GetEditingObject() const { return pCheckObj; } 108 109 sal_Bool IsUndoPossible() const; 110 sal_Bool IsRedoPossible() const; 111 112 void UpdateGraphic( const Graphic& rGraphic, sal_Bool bGraphicLinked, 113 const PolyPolygon* pPolyPoly = NULL, 114 void* pEditingObj = NULL ); 115 116 /** switches the toolbox images depending on the actuall high contrast display mode state */ 117 void ApplyImageList(); 118 119 /** virtual method from Window is used to detect change in high contrast display mode 120 to switch the toolbox images */ 121 virtual void DataChanged( const DataChangedEvent& rDCEvt ); 122 123 }; 124 125 126 #endif // _CONTIMP_HXX_ 127 128