1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef SD_NAVIGATOR_HXX 29*cdf0e10cSrcweir #define SD_NAVIGATOR_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <vcl/window.hxx> 32*cdf0e10cSrcweir #include <vcl/lstbox.hxx> 33*cdf0e10cSrcweir #ifndef _TOOLBOX_HXX //autogen 34*cdf0e10cSrcweir #include <vcl/toolbox.hxx> 35*cdf0e10cSrcweir #endif 36*cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx> 37*cdf0e10cSrcweir #include "sdtreelb.hxx" 38*cdf0e10cSrcweir #include "pres.hxx" 39*cdf0e10cSrcweir 40*cdf0e10cSrcweir #define NAVSTATE_NONE 0x00000000 41*cdf0e10cSrcweir 42*cdf0e10cSrcweir #define NAVBTN_PEN_ENABLED 0x00000010 43*cdf0e10cSrcweir #define NAVBTN_PEN_DISABLED 0x00000020 44*cdf0e10cSrcweir #define NAVBTN_PEN_CHECKED 0x00000040 45*cdf0e10cSrcweir #define NAVBTN_PEN_UNCHECKED 0x00000080 46*cdf0e10cSrcweir 47*cdf0e10cSrcweir #define NAVTLB_UPDATE 0x00000100 48*cdf0e10cSrcweir 49*cdf0e10cSrcweir #define NAVBTN_FIRST_ENABLED 0x00001000 50*cdf0e10cSrcweir #define NAVBTN_FIRST_DISABLED 0x00002000 51*cdf0e10cSrcweir #define NAVBTN_PREV_ENABLED 0x00004000 52*cdf0e10cSrcweir #define NAVBTN_PREV_DISABLED 0x00008000 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir #define NAVBTN_LAST_ENABLED 0x00010000 55*cdf0e10cSrcweir #define NAVBTN_LAST_DISABLED 0x00020000 56*cdf0e10cSrcweir #define NAVBTN_NEXT_ENABLED 0x00040000 57*cdf0e10cSrcweir #define NAVBTN_NEXT_DISABLED 0x00080000 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir // forward 60*cdf0e10cSrcweir namespace sd { 61*cdf0e10cSrcweir class DrawDocShell; 62*cdf0e10cSrcweir class NavigatorChildWindow; 63*cdf0e10cSrcweir class View; 64*cdf0e10cSrcweir } 65*cdf0e10cSrcweir class Menu; 66*cdf0e10cSrcweir class SdNavigatorControllerItem; 67*cdf0e10cSrcweir class SdPageNameControllerItem; 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir //------------------------------------------------------------------------ 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir class NavDocInfo 72*cdf0e10cSrcweir { 73*cdf0e10cSrcweir public: 74*cdf0e10cSrcweir NavDocInfo() { mpDocShell = NULL; } 75*cdf0e10cSrcweir 76*cdf0e10cSrcweir sal_Bool HasName() { return( (sal_Bool) bName ); } 77*cdf0e10cSrcweir sal_Bool IsActive() { return( (sal_Bool) bActive ); } 78*cdf0e10cSrcweir 79*cdf0e10cSrcweir void SetName( sal_Bool bOn = sal_True ) { bName = bOn; } 80*cdf0e10cSrcweir void SetActive( sal_Bool bOn = sal_True ) { bActive = bOn; } 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir private: 83*cdf0e10cSrcweir friend class SdNavigatorWin; 84*cdf0e10cSrcweir sal_Bool bName : 1; 85*cdf0e10cSrcweir sal_Bool bActive : 1; 86*cdf0e10cSrcweir ::sd::DrawDocShell* mpDocShell; 87*cdf0e10cSrcweir }; 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir //------------------------------------------------------------------------ 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir class SdNavigatorWin 92*cdf0e10cSrcweir : public Window 93*cdf0e10cSrcweir { 94*cdf0e10cSrcweir public: 95*cdf0e10cSrcweir SdNavigatorWin( 96*cdf0e10cSrcweir ::Window* pParent, 97*cdf0e10cSrcweir ::sd::NavigatorChildWindow* pChildWinContext, 98*cdf0e10cSrcweir const SdResId& rSdResId, 99*cdf0e10cSrcweir SfxBindings* pBindings ); 100*cdf0e10cSrcweir virtual ~SdNavigatorWin(); 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir virtual void KeyInput( const KeyEvent& rKEvt ); 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir void InitTreeLB( const SdDrawDocument* pDoc ); 105*cdf0e10cSrcweir void RefreshDocumentLB( const String* pDocName = NULL ); 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir sal_Bool InsertFile(const String& rFileName); 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir NavigatorDragType GetNavigatorDragType(); 110*cdf0e10cSrcweir void SetNavigatorDragType(NavigatorDragType eType) { meDragType = eType; } 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir protected: 113*cdf0e10cSrcweir virtual void Resize(); 114*cdf0e10cSrcweir virtual long Notify(NotifyEvent& rNEvt); 115*cdf0e10cSrcweir 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir private: 118*cdf0e10cSrcweir friend class ::sd::NavigatorChildWindow; 119*cdf0e10cSrcweir friend class SdNavigatorControllerItem; 120*cdf0e10cSrcweir friend class SdPageNameControllerItem; 121*cdf0e10cSrcweir 122*cdf0e10cSrcweir ToolBox maToolbox; 123*cdf0e10cSrcweir SdPageObjsTLB maTlbObjects; 124*cdf0e10cSrcweir ListBox maLbDocs; 125*cdf0e10cSrcweir 126*cdf0e10cSrcweir ::sd::NavigatorChildWindow* mpChildWinContext; 127*cdf0e10cSrcweir Size maSize; 128*cdf0e10cSrcweir Size maMinSize; 129*cdf0e10cSrcweir // Size maFltWinSize; 130*cdf0e10cSrcweir sal_Bool mbDocImported; 131*cdf0e10cSrcweir String maDropFileName; 132*cdf0e10cSrcweir NavigatorDragType meDragType; 133*cdf0e10cSrcweir List* mpDocList; 134*cdf0e10cSrcweir SfxBindings* mpBindings; 135*cdf0e10cSrcweir SdNavigatorControllerItem* mpNavigatorCtrlItem; 136*cdf0e10cSrcweir SdPageNameControllerItem* mpPageNameCtrlItem; 137*cdf0e10cSrcweir 138*cdf0e10cSrcweir ImageList maImageList; 139*cdf0e10cSrcweir ImageList maImageListH; 140*cdf0e10cSrcweir 141*cdf0e10cSrcweir /** This flag controls whether all shapes or only the named shapes are 142*cdf0e10cSrcweir shown. 143*cdf0e10cSrcweir */ 144*cdf0e10cSrcweir bool mbShowAllShapes; 145*cdf0e10cSrcweir 146*cdf0e10cSrcweir sal_uInt16 GetDragTypeSdResId( NavigatorDragType eDT, sal_Bool bImage = sal_False ); 147*cdf0e10cSrcweir NavDocInfo* GetDocInfo(); 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir DECL_LINK( GetFocusObjectsHdl, void * ); 150*cdf0e10cSrcweir DECL_LINK( SelectToolboxHdl, void * ); 151*cdf0e10cSrcweir DECL_LINK( ClickToolboxHdl, ToolBox * ); 152*cdf0e10cSrcweir DECL_LINK( DropdownClickToolBoxHdl, ToolBox * ); 153*cdf0e10cSrcweir DECL_LINK( ClickPageHdl, void * ); 154*cdf0e10cSrcweir DECL_LINK( ClickObjectHdl, void * ); 155*cdf0e10cSrcweir DECL_LINK( SelectDocumentHdl, void * ); 156*cdf0e10cSrcweir DECL_LINK( MenuSelectHdl, Menu * ); 157*cdf0e10cSrcweir DECL_LINK( ShapeFilterCallback, Menu * ); 158*cdf0e10cSrcweir 159*cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt ); 160*cdf0e10cSrcweir void SetDragImage(); 161*cdf0e10cSrcweir void ApplyImageList(); 162*cdf0e10cSrcweir }; 163*cdf0e10cSrcweir 164*cdf0e10cSrcweir 165*cdf0e10cSrcweir 166*cdf0e10cSrcweir 167*cdf0e10cSrcweir /************************************************************************* 168*cdf0e10cSrcweir |* 169*cdf0e10cSrcweir |* ControllerItem fuer Navigator 170*cdf0e10cSrcweir |* 171*cdf0e10cSrcweir \************************************************************************/ 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir class SdNavigatorControllerItem : public SfxControllerItem 174*cdf0e10cSrcweir { 175*cdf0e10cSrcweir public: 176*cdf0e10cSrcweir SdNavigatorControllerItem( sal_uInt16, SdNavigatorWin*, SfxBindings* ); 177*cdf0e10cSrcweir 178*cdf0e10cSrcweir protected: 179*cdf0e10cSrcweir virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState, 180*cdf0e10cSrcweir const SfxPoolItem* pState ); 181*cdf0e10cSrcweir 182*cdf0e10cSrcweir private: 183*cdf0e10cSrcweir SdNavigatorWin* pNavigatorWin; 184*cdf0e10cSrcweir }; 185*cdf0e10cSrcweir 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir 188*cdf0e10cSrcweir /************************************************************************* 189*cdf0e10cSrcweir |* 190*cdf0e10cSrcweir |* ControllerItem fuer Navigator zum Anzeigen der Seite in der TreeLB 191*cdf0e10cSrcweir |* 192*cdf0e10cSrcweir \************************************************************************/ 193*cdf0e10cSrcweir 194*cdf0e10cSrcweir class SdPageNameControllerItem : public SfxControllerItem 195*cdf0e10cSrcweir { 196*cdf0e10cSrcweir public: 197*cdf0e10cSrcweir SdPageNameControllerItem( sal_uInt16, SdNavigatorWin*, SfxBindings* ); 198*cdf0e10cSrcweir 199*cdf0e10cSrcweir protected: 200*cdf0e10cSrcweir virtual void StateChanged( sal_uInt16 nSId, SfxItemState eState, 201*cdf0e10cSrcweir const SfxPoolItem* pState ); 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir private: 204*cdf0e10cSrcweir SdNavigatorWin* pNavigatorWin; 205*cdf0e10cSrcweir }; 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir #endif 208