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 #ifndef _NAVIPI_HXX 28*cdf0e10cSrcweir #define _NAVIPI_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir // INCLUDE --------------------------------------------------------------- 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir #ifndef _LSTBOX_HXX //autogen 33*cdf0e10cSrcweir #include <vcl/lstbox.hxx> 34*cdf0e10cSrcweir #endif 35*cdf0e10cSrcweir #include <svl/lstner.hxx> 36*cdf0e10cSrcweir #include <svtools/transfer.hxx> 37*cdf0e10cSrcweir #include <sfx2/childwin.hxx> 38*cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx> 39*cdf0e10cSrcweir #include <sfx2/tbxctrl.hxx> 40*cdf0e10cSrcweir #include <conttree.hxx> 41*cdf0e10cSrcweir #include <popbox.hxx> 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir class SwWrtShell; 44*cdf0e10cSrcweir class SwNavigationPI; 45*cdf0e10cSrcweir class SwNavigationChild; 46*cdf0e10cSrcweir class SfxBindings; 47*cdf0e10cSrcweir class NumEditAction; 48*cdf0e10cSrcweir class SwView; 49*cdf0e10cSrcweir class SwNavigationConfig; 50*cdf0e10cSrcweir class SfxObjectShellLock; 51*cdf0e10cSrcweir class SfxChildWindowContext; 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir //----------------------------------------------------------------------- 54*cdf0e10cSrcweir class SwNavigationPI; 55*cdf0e10cSrcweir class SwNavHelpToolBox : public SwHelpToolBox 56*cdf0e10cSrcweir { 57*cdf0e10cSrcweir virtual void MouseButtonDown(const MouseEvent &rEvt); 58*cdf0e10cSrcweir virtual void RequestHelp( const HelpEvent& rHEvt ); 59*cdf0e10cSrcweir public: 60*cdf0e10cSrcweir SwNavHelpToolBox(SwNavigationPI* pParent, const ResId &rResId); 61*cdf0e10cSrcweir }; 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir 64*cdf0e10cSrcweir // CLASS ----------------------------------------------------------------- 65*cdf0e10cSrcweir class SwNavigationPI : public Window, 66*cdf0e10cSrcweir public SfxControllerItem, public SfxListener 67*cdf0e10cSrcweir { 68*cdf0e10cSrcweir friend class SwNavigationChild; 69*cdf0e10cSrcweir friend class SwContentTree; 70*cdf0e10cSrcweir friend class SwGlobalTree; 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir // --------- members ----------------------------- 73*cdf0e10cSrcweir SwNavHelpToolBox aContentToolBox; 74*cdf0e10cSrcweir SwHelpToolBox aGlobalToolBox; 75*cdf0e10cSrcweir ImageList aContentImageList; 76*cdf0e10cSrcweir ImageList aContentImageListH; 77*cdf0e10cSrcweir SwContentTree aContentTree; 78*cdf0e10cSrcweir SwGlobalTree aGlobalTree; 79*cdf0e10cSrcweir ListBox aDocListBox; 80*cdf0e10cSrcweir Timer aPageChgTimer; 81*cdf0e10cSrcweir String sContentFileName; 82*cdf0e10cSrcweir String aContextArr[3]; 83*cdf0e10cSrcweir String aStatusArr[4]; 84*cdf0e10cSrcweir Point aBoxBottomLeft; // Pos., wenn Box unten ist 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir SfxObjectShellLock *pxObjectShell; 87*cdf0e10cSrcweir SwView *pContentView; 88*cdf0e10cSrcweir SwWrtShell *pContentWrtShell; 89*cdf0e10cSrcweir SwView *pActContView; 90*cdf0e10cSrcweir SwView *pCreateView; 91*cdf0e10cSrcweir SfxPopupWindow *pPopupWindow; 92*cdf0e10cSrcweir SfxPopupWindow *pFloatingWindow; 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir SfxChildWindowContext* pContextWin; 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir SwNavigationConfig *pConfig; 97*cdf0e10cSrcweir SfxBindings &rBindings; 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir long nDocLBIniHeight; 100*cdf0e10cSrcweir long nWishWidth; 101*cdf0e10cSrcweir sal_uInt16 nAutoMarkIdx; 102*cdf0e10cSrcweir sal_uInt16 nRegionMode; // 0 - URL, 1 - Bereich mit Link 2 - B. ohne Link 103*cdf0e10cSrcweir short nZoomIn; 104*cdf0e10cSrcweir short nZoomOutInit; 105*cdf0e10cSrcweir short nZoomOut; 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir sal_Bool bSmallMode : 1; 108*cdf0e10cSrcweir sal_Bool bIsZoomedIn : 1; 109*cdf0e10cSrcweir sal_Bool bPageCtrlsVisible : 1; 110*cdf0e10cSrcweir sal_Bool bGlobalMode : 1; 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir // --------- methods ----------------------------- 113*cdf0e10cSrcweir sal_Bool _IsZoomedIn() const {return bIsZoomedIn;} 114*cdf0e10cSrcweir void _ZoomOut(); 115*cdf0e10cSrcweir void _ZoomIn(); 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir void FillBox(); 118*cdf0e10cSrcweir void MakeMark(); 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir DECL_LINK( DocListBoxSelectHdl, ListBox * ); 121*cdf0e10cSrcweir DECL_LINK( ToolBoxSelectHdl, ToolBox * ); 122*cdf0e10cSrcweir DECL_LINK( ToolBoxClickHdl, ToolBox * ); 123*cdf0e10cSrcweir DECL_LINK( ToolBoxDropdownClickHdl, ToolBox* ); 124*cdf0e10cSrcweir DECL_LINK( EditAction, NumEditAction * ); 125*cdf0e10cSrcweir DECL_LINK( EditGetFocus, NumEditAction * ); 126*cdf0e10cSrcweir DECL_LINK( DoneLink, SfxPoolItem * ); 127*cdf0e10cSrcweir DECL_LINK( MenuSelectHdl, Menu * ); 128*cdf0e10cSrcweir DECL_LINK( ChangePageHdl, Timer* ); 129*cdf0e10cSrcweir DECL_LINK( PageEditModifyHdl, Edit* ); 130*cdf0e10cSrcweir DECL_LINK( PopupModeEndHdl, void * ); 131*cdf0e10cSrcweir DECL_LINK( ClosePopupWindow, SfxPopupWindow * ); 132*cdf0e10cSrcweir void UsePage(SwWrtShell *); 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir void MakeVisible(); 135*cdf0e10cSrcweir void InitImageList(); 136*cdf0e10cSrcweir virtual SfxChildAlignment 137*cdf0e10cSrcweir CheckAlignment(SfxChildAlignment,SfxChildAlignment); 138*cdf0e10cSrcweir void SetPopupWindow( SfxPopupWindow* ); 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir using Window::Notify; 141*cdf0e10cSrcweir using Window::StateChanged; 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir protected: 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir virtual sal_Bool Close(); 146*cdf0e10cSrcweir virtual void Resize(); 147*cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt ); 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir // zum App-Ende rechtzeitig ObjectShellLock loslassen 151*cdf0e10cSrcweir virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir NumEditAction& GetPageEdit(); 154*cdf0e10cSrcweir sal_Bool ToggleTree(); 155*cdf0e10cSrcweir void SetGlobalMode(sal_Bool bSet) {bGlobalMode = bSet;} 156*cdf0e10cSrcweir 157*cdf0e10cSrcweir public: 158*cdf0e10cSrcweir 159*cdf0e10cSrcweir SwNavigationPI(SfxBindings*, SfxChildWindowContext*, Window*); 160*cdf0e10cSrcweir ~SwNavigationPI(); 161*cdf0e10cSrcweir 162*cdf0e10cSrcweir void GotoPage(); // Seite anspringen; bindbare Funktion 163*cdf0e10cSrcweir 164*cdf0e10cSrcweir void Update() { FillBox(); } 165*cdf0e10cSrcweir void UpdateListBox(); 166*cdf0e10cSrcweir void MoveOutline(sal_uInt16 nSource, sal_uInt16 nTarget, sal_Bool bWithCilds); 167*cdf0e10cSrcweir 168*cdf0e10cSrcweir virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, 169*cdf0e10cSrcweir const SfxPoolItem* pState ); 170*cdf0e10cSrcweir 171*cdf0e10cSrcweir static String CreateDropFileName( TransferableDataHelper& rData ); 172*cdf0e10cSrcweir static void CleanEntry( String& rEntry ); 173*cdf0e10cSrcweir 174*cdf0e10cSrcweir sal_uInt16 GetRegionDropMode() const {return nRegionMode;} 175*cdf0e10cSrcweir void SetRegionDropMode(sal_uInt16 nNewMode); 176*cdf0e10cSrcweir 177*cdf0e10cSrcweir sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); 178*cdf0e10cSrcweir sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); 179*cdf0e10cSrcweir 180*cdf0e10cSrcweir sal_Bool IsGlobalDoc() const; 181*cdf0e10cSrcweir sal_Bool IsGlobalMode() const {return bGlobalMode;} 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir SwView* GetCreateView() const; 184*cdf0e10cSrcweir void CreateNavigationTool(const Rectangle& rRect, sal_Bool bSetFocus); 185*cdf0e10cSrcweir }; 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir class SwNavigationChild : public SfxChildWindowContext 188*cdf0e10cSrcweir { 189*cdf0e10cSrcweir public: 190*cdf0e10cSrcweir SwNavigationChild( Window* , 191*cdf0e10cSrcweir sal_uInt16 nId, 192*cdf0e10cSrcweir SfxBindings*, 193*cdf0e10cSrcweir SfxChildWinInfo* ); 194*cdf0e10cSrcweir 195*cdf0e10cSrcweir SFX_DECL_CHILDWINDOW_CONTEXT( SwNavigationChild ) 196*cdf0e10cSrcweir }; 197*cdf0e10cSrcweir 198*cdf0e10cSrcweir #endif 199