1*1d2dbeb0SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*1d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*1d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*1d2dbeb0SAndrew Rist * distributed with this work for additional information 6*1d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*1d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*1d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance 9*1d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at 10*1d2dbeb0SAndrew Rist * 11*1d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*1d2dbeb0SAndrew Rist * 13*1d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*1d2dbeb0SAndrew Rist * software distributed under the License is distributed on an 15*1d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*1d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the 17*1d2dbeb0SAndrew Rist * specific language governing permissions and limitations 18*1d2dbeb0SAndrew Rist * under the License. 19*1d2dbeb0SAndrew Rist * 20*1d2dbeb0SAndrew Rist *************************************************************/ 21*1d2dbeb0SAndrew Rist 22*1d2dbeb0SAndrew Rist 23cdf0e10cSrcweir #ifndef _NAVIPI_HXX 24cdf0e10cSrcweir #define _NAVIPI_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir // INCLUDE --------------------------------------------------------------- 27cdf0e10cSrcweir 28cdf0e10cSrcweir #ifndef _LSTBOX_HXX //autogen 29cdf0e10cSrcweir #include <vcl/lstbox.hxx> 30cdf0e10cSrcweir #endif 31cdf0e10cSrcweir #include <svl/lstner.hxx> 32cdf0e10cSrcweir #include <svtools/transfer.hxx> 33cdf0e10cSrcweir #include <sfx2/childwin.hxx> 34cdf0e10cSrcweir #include <sfx2/ctrlitem.hxx> 35cdf0e10cSrcweir #include <sfx2/tbxctrl.hxx> 36cdf0e10cSrcweir #include <conttree.hxx> 37cdf0e10cSrcweir #include <popbox.hxx> 38cdf0e10cSrcweir 39cdf0e10cSrcweir class SwWrtShell; 40cdf0e10cSrcweir class SwNavigationPI; 41cdf0e10cSrcweir class SwNavigationChild; 42cdf0e10cSrcweir class SfxBindings; 43cdf0e10cSrcweir class NumEditAction; 44cdf0e10cSrcweir class SwView; 45cdf0e10cSrcweir class SwNavigationConfig; 46cdf0e10cSrcweir class SfxObjectShellLock; 47cdf0e10cSrcweir class SfxChildWindowContext; 48cdf0e10cSrcweir 49cdf0e10cSrcweir //----------------------------------------------------------------------- 50cdf0e10cSrcweir class SwNavigationPI; 51cdf0e10cSrcweir class SwNavHelpToolBox : public SwHelpToolBox 52cdf0e10cSrcweir { 53cdf0e10cSrcweir virtual void MouseButtonDown(const MouseEvent &rEvt); 54cdf0e10cSrcweir virtual void RequestHelp( const HelpEvent& rHEvt ); 55cdf0e10cSrcweir public: 56cdf0e10cSrcweir SwNavHelpToolBox(SwNavigationPI* pParent, const ResId &rResId); 57cdf0e10cSrcweir }; 58cdf0e10cSrcweir 59cdf0e10cSrcweir 60cdf0e10cSrcweir // CLASS ----------------------------------------------------------------- 61cdf0e10cSrcweir class SwNavigationPI : public Window, 62cdf0e10cSrcweir public SfxControllerItem, public SfxListener 63cdf0e10cSrcweir { 64cdf0e10cSrcweir friend class SwNavigationChild; 65cdf0e10cSrcweir friend class SwContentTree; 66cdf0e10cSrcweir friend class SwGlobalTree; 67cdf0e10cSrcweir 68cdf0e10cSrcweir // --------- members ----------------------------- 69cdf0e10cSrcweir SwNavHelpToolBox aContentToolBox; 70cdf0e10cSrcweir SwHelpToolBox aGlobalToolBox; 71cdf0e10cSrcweir ImageList aContentImageList; 72cdf0e10cSrcweir ImageList aContentImageListH; 73cdf0e10cSrcweir SwContentTree aContentTree; 74cdf0e10cSrcweir SwGlobalTree aGlobalTree; 75cdf0e10cSrcweir ListBox aDocListBox; 76cdf0e10cSrcweir Timer aPageChgTimer; 77cdf0e10cSrcweir String sContentFileName; 78cdf0e10cSrcweir String aContextArr[3]; 79cdf0e10cSrcweir String aStatusArr[4]; 80cdf0e10cSrcweir Point aBoxBottomLeft; // Pos., wenn Box unten ist 81cdf0e10cSrcweir 82cdf0e10cSrcweir SfxObjectShellLock *pxObjectShell; 83cdf0e10cSrcweir SwView *pContentView; 84cdf0e10cSrcweir SwWrtShell *pContentWrtShell; 85cdf0e10cSrcweir SwView *pActContView; 86cdf0e10cSrcweir SwView *pCreateView; 87cdf0e10cSrcweir SfxPopupWindow *pPopupWindow; 88cdf0e10cSrcweir SfxPopupWindow *pFloatingWindow; 89cdf0e10cSrcweir 90cdf0e10cSrcweir SfxChildWindowContext* pContextWin; 91cdf0e10cSrcweir 92cdf0e10cSrcweir SwNavigationConfig *pConfig; 93cdf0e10cSrcweir SfxBindings &rBindings; 94cdf0e10cSrcweir 95cdf0e10cSrcweir long nDocLBIniHeight; 96cdf0e10cSrcweir long nWishWidth; 97cdf0e10cSrcweir sal_uInt16 nAutoMarkIdx; 98cdf0e10cSrcweir sal_uInt16 nRegionMode; // 0 - URL, 1 - Bereich mit Link 2 - B. ohne Link 99cdf0e10cSrcweir short nZoomIn; 100cdf0e10cSrcweir short nZoomOutInit; 101cdf0e10cSrcweir short nZoomOut; 102cdf0e10cSrcweir 103cdf0e10cSrcweir sal_Bool bSmallMode : 1; 104cdf0e10cSrcweir sal_Bool bIsZoomedIn : 1; 105cdf0e10cSrcweir sal_Bool bPageCtrlsVisible : 1; 106cdf0e10cSrcweir sal_Bool bGlobalMode : 1; 107cdf0e10cSrcweir 108cdf0e10cSrcweir // --------- methods ----------------------------- _IsZoomedIn() const109cdf0e10cSrcweir sal_Bool _IsZoomedIn() const {return bIsZoomedIn;} 110cdf0e10cSrcweir void _ZoomOut(); 111cdf0e10cSrcweir void _ZoomIn(); 112cdf0e10cSrcweir 113cdf0e10cSrcweir void FillBox(); 114cdf0e10cSrcweir void MakeMark(); 115cdf0e10cSrcweir 116cdf0e10cSrcweir DECL_LINK( DocListBoxSelectHdl, ListBox * ); 117cdf0e10cSrcweir DECL_LINK( ToolBoxSelectHdl, ToolBox * ); 118cdf0e10cSrcweir DECL_LINK( ToolBoxClickHdl, ToolBox * ); 119cdf0e10cSrcweir DECL_LINK( ToolBoxDropdownClickHdl, ToolBox* ); 120cdf0e10cSrcweir DECL_LINK( EditAction, NumEditAction * ); 121cdf0e10cSrcweir DECL_LINK( EditGetFocus, NumEditAction * ); 122cdf0e10cSrcweir DECL_LINK( DoneLink, SfxPoolItem * ); 123cdf0e10cSrcweir DECL_LINK( MenuSelectHdl, Menu * ); 124cdf0e10cSrcweir DECL_LINK( ChangePageHdl, Timer* ); 125cdf0e10cSrcweir DECL_LINK( PageEditModifyHdl, Edit* ); 126cdf0e10cSrcweir DECL_LINK( PopupModeEndHdl, void * ); 127cdf0e10cSrcweir DECL_LINK( ClosePopupWindow, SfxPopupWindow * ); 128cdf0e10cSrcweir void UsePage(SwWrtShell *); 129cdf0e10cSrcweir 130cdf0e10cSrcweir void MakeVisible(); 131cdf0e10cSrcweir void InitImageList(); 132cdf0e10cSrcweir virtual SfxChildAlignment 133cdf0e10cSrcweir CheckAlignment(SfxChildAlignment,SfxChildAlignment); 134cdf0e10cSrcweir void SetPopupWindow( SfxPopupWindow* ); 135cdf0e10cSrcweir 136cdf0e10cSrcweir using Window::Notify; 137cdf0e10cSrcweir using Window::StateChanged; 138cdf0e10cSrcweir 139cdf0e10cSrcweir protected: 140cdf0e10cSrcweir 141cdf0e10cSrcweir virtual sal_Bool Close(); 142cdf0e10cSrcweir virtual void Resize(); 143cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt ); 144cdf0e10cSrcweir 145cdf0e10cSrcweir 146cdf0e10cSrcweir // zum App-Ende rechtzeitig ObjectShellLock loslassen 147cdf0e10cSrcweir virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 148cdf0e10cSrcweir 149cdf0e10cSrcweir NumEditAction& GetPageEdit(); 150cdf0e10cSrcweir sal_Bool ToggleTree(); SetGlobalMode(sal_Bool bSet)151cdf0e10cSrcweir void SetGlobalMode(sal_Bool bSet) {bGlobalMode = bSet;} 152cdf0e10cSrcweir 153cdf0e10cSrcweir public: 154cdf0e10cSrcweir 155cdf0e10cSrcweir SwNavigationPI(SfxBindings*, SfxChildWindowContext*, Window*); 156cdf0e10cSrcweir ~SwNavigationPI(); 157cdf0e10cSrcweir 158cdf0e10cSrcweir void GotoPage(); // Seite anspringen; bindbare Funktion 159cdf0e10cSrcweir Update()160cdf0e10cSrcweir void Update() { FillBox(); } 161cdf0e10cSrcweir void UpdateListBox(); 162cdf0e10cSrcweir void MoveOutline(sal_uInt16 nSource, sal_uInt16 nTarget, sal_Bool bWithCilds); 163cdf0e10cSrcweir 164cdf0e10cSrcweir virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, 165cdf0e10cSrcweir const SfxPoolItem* pState ); 166cdf0e10cSrcweir 167cdf0e10cSrcweir static String CreateDropFileName( TransferableDataHelper& rData ); 168cdf0e10cSrcweir static void CleanEntry( String& rEntry ); 169cdf0e10cSrcweir GetRegionDropMode() const170cdf0e10cSrcweir sal_uInt16 GetRegionDropMode() const {return nRegionMode;} 171cdf0e10cSrcweir void SetRegionDropMode(sal_uInt16 nNewMode); 172cdf0e10cSrcweir 173cdf0e10cSrcweir sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); 174cdf0e10cSrcweir sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); 175cdf0e10cSrcweir 176cdf0e10cSrcweir sal_Bool IsGlobalDoc() const; IsGlobalMode() const177cdf0e10cSrcweir sal_Bool IsGlobalMode() const {return bGlobalMode;} 178cdf0e10cSrcweir 179cdf0e10cSrcweir SwView* GetCreateView() const; 180cdf0e10cSrcweir void CreateNavigationTool(const Rectangle& rRect, sal_Bool bSetFocus); 181cdf0e10cSrcweir }; 182cdf0e10cSrcweir 183cdf0e10cSrcweir class SwNavigationChild : public SfxChildWindowContext 184cdf0e10cSrcweir { 185cdf0e10cSrcweir public: 186cdf0e10cSrcweir SwNavigationChild( Window* , 187cdf0e10cSrcweir sal_uInt16 nId, 188cdf0e10cSrcweir SfxBindings*, 189cdf0e10cSrcweir SfxChildWinInfo* ); 190cdf0e10cSrcweir 191cdf0e10cSrcweir SFX_DECL_CHILDWINDOW_CONTEXT( SwNavigationChild ) 192cdf0e10cSrcweir }; 193cdf0e10cSrcweir 194cdf0e10cSrcweir #endif 195