update dev300-m58
[ooovba.git] / sw / source / ui / inc / navipi.hxx
blob0d065db25329d71c755ebb4563e37944506a3459
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: navipi.hxx,v $
10 * $Revision: 1.16 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _NAVIPI_HXX
31 #define _NAVIPI_HXX
33 // INCLUDE ---------------------------------------------------------------
35 #ifndef _LSTBOX_HXX //autogen
36 #include <vcl/lstbox.hxx>
37 #endif
38 #include <svtools/lstner.hxx>
39 #include <svtools/transfer.hxx>
40 #include <sfx2/childwin.hxx>
41 #include <sfx2/ctrlitem.hxx>
42 #include <sfx2/tbxctrl.hxx>
43 #include <conttree.hxx>
44 #include <popbox.hxx>
46 class SwWrtShell;
47 class SwNavigationPI;
48 class SwNavigationChild;
49 class SfxBindings;
50 class NumEditAction;
51 class SwView;
52 class SwNavigationConfig;
53 class SfxObjectShellLock;
54 class SfxChildWindowContext;
56 //-----------------------------------------------------------------------
57 class SwNavigationPI;
58 class SwNavHelpToolBox : public SwHelpToolBox
60 virtual void MouseButtonDown(const MouseEvent &rEvt);
61 virtual void RequestHelp( const HelpEvent& rHEvt );
62 public:
63 SwNavHelpToolBox(SwNavigationPI* pParent, const ResId &rResId);
67 // CLASS -----------------------------------------------------------------
68 class SwNavigationPI : public Window,
69 public SfxControllerItem, public SfxListener
71 friend class SwNavigationChild;
72 friend class SwContentTree;
73 friend class SwGlobalTree;
75 // --------- members -----------------------------
76 SwNavHelpToolBox aContentToolBox;
77 SwHelpToolBox aGlobalToolBox;
78 ImageList aContentImageList;
79 ImageList aContentImageListH;
80 SwContentTree aContentTree;
81 SwGlobalTree aGlobalTree;
82 ListBox aDocListBox;
83 Timer aPageChgTimer;
84 String sContentFileName;
85 String aContextArr[3];
86 String aStatusArr[4];
87 Point aBoxBottomLeft; // Pos., wenn Box unten ist
89 SfxObjectShellLock *pxObjectShell;
90 SwView *pContentView;
91 SwWrtShell *pContentWrtShell;
92 SwView *pActContView;
93 SwView *pCreateView;
94 SfxPopupWindow *pPopupWindow;
95 SfxPopupWindow *pFloatingWindow;
97 SfxChildWindowContext* pContextWin;
99 SwNavigationConfig *pConfig;
100 SfxBindings &rBindings;
102 long nDocLBIniHeight;
103 long nWishWidth;
104 USHORT nAutoMarkIdx;
105 USHORT nRegionMode; // 0 - URL, 1 - Bereich mit Link 2 - B. ohne Link
106 short nZoomIn;
107 short nZoomOutInit;
108 short nZoomOut;
110 BOOL bSmallMode : 1;
111 BOOL bIsZoomedIn : 1;
112 BOOL bPageCtrlsVisible : 1;
113 BOOL bGlobalMode : 1;
115 // --------- methods -----------------------------
116 BOOL _IsZoomedIn() const {return bIsZoomedIn;}
117 void _ZoomOut();
118 void _ZoomIn();
120 void FillBox();
121 void MakeMark();
123 DECL_LINK( DocListBoxSelectHdl, ListBox * );
124 DECL_LINK( ToolBoxSelectHdl, ToolBox * );
125 DECL_LINK( ToolBoxClickHdl, ToolBox * );
126 DECL_LINK( ToolBoxDropdownClickHdl, ToolBox* );
127 DECL_LINK( EditAction, NumEditAction * );
128 DECL_LINK( EditGetFocus, NumEditAction * );
129 DECL_LINK( DoneLink, SfxPoolItem * );
130 DECL_LINK( MenuSelectHdl, Menu * );
131 DECL_LINK( ChangePageHdl, Timer* );
132 DECL_LINK( PageEditModifyHdl, Edit* );
133 DECL_LINK( PopupModeEndHdl, void * );
134 DECL_LINK( ClosePopupWindow, SfxPopupWindow * );
135 void UsePage(SwWrtShell *);
137 void MakeVisible();
138 void InitImageList();
139 virtual SfxChildAlignment
140 CheckAlignment(SfxChildAlignment,SfxChildAlignment);
141 void SetPopupWindow( SfxPopupWindow* );
143 using Window::Notify;
144 using Window::StateChanged;
146 protected:
148 virtual BOOL Close();
149 virtual void Resize();
150 virtual void DataChanged( const DataChangedEvent& rDCEvt );
153 // zum App-Ende rechtzeitig ObjectShellLock loslassen
154 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
156 NumEditAction& GetPageEdit();
157 BOOL ToggleTree();
158 void SetGlobalMode(BOOL bSet) {bGlobalMode = bSet;}
160 public:
162 SwNavigationPI(SfxBindings*, SfxChildWindowContext*, Window*);
163 ~SwNavigationPI();
165 void GotoPage(); // Seite anspringen; bindbare Funktion
167 void Update() { FillBox(); }
168 void UpdateListBox();
169 void MoveOutline(USHORT nSource, USHORT nTarget, BOOL bWithCilds);
171 virtual void StateChanged( USHORT nSID, SfxItemState eState,
172 const SfxPoolItem* pState );
174 static String CreateDropFileName( TransferableDataHelper& rData );
175 static void CleanEntry( String& rEntry );
177 USHORT GetRegionDropMode() const {return nRegionMode;}
178 void SetRegionDropMode(USHORT nNewMode);
180 sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
181 sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
183 BOOL IsGlobalDoc() const;
184 BOOL IsGlobalMode() const {return bGlobalMode;}
186 SwView* GetCreateView() const;
187 void CreateNavigationTool(const Rectangle& rRect, BOOL bSetFocus);
190 class SwNavigationChild : public SfxChildWindowContext
192 public:
193 SwNavigationChild( Window* ,
194 USHORT nId,
195 SfxBindings*,
196 SfxChildWinInfo* );
198 SFX_DECL_CHILDWINDOW_CONTEXT( SwNavigationChild )
201 #endif