1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: navipi.hxx,v $
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 ************************************************************************/
33 // INCLUDE ---------------------------------------------------------------
35 #ifndef _LSTBOX_HXX //autogen
36 #include <vcl/lstbox.hxx>
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>
48 class SwNavigationChild
;
52 class SwNavigationConfig
;
53 class SfxObjectShellLock
;
54 class SfxChildWindowContext
;
56 //-----------------------------------------------------------------------
58 class SwNavHelpToolBox
: public SwHelpToolBox
60 virtual void MouseButtonDown(const MouseEvent
&rEvt
);
61 virtual void RequestHelp( const HelpEvent
& rHEvt
);
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
;
84 String sContentFileName
;
85 String aContextArr
[3];
87 Point aBoxBottomLeft
; // Pos., wenn Box unten ist
89 SfxObjectShellLock
*pxObjectShell
;
91 SwWrtShell
*pContentWrtShell
;
94 SfxPopupWindow
*pPopupWindow
;
95 SfxPopupWindow
*pFloatingWindow
;
97 SfxChildWindowContext
* pContextWin
;
99 SwNavigationConfig
*pConfig
;
100 SfxBindings
&rBindings
;
102 long nDocLBIniHeight
;
105 USHORT nRegionMode
; // 0 - URL, 1 - Bereich mit Link 2 - B. ohne Link
111 BOOL bIsZoomedIn
: 1;
112 BOOL bPageCtrlsVisible
: 1;
113 BOOL bGlobalMode
: 1;
115 // --------- methods -----------------------------
116 BOOL
_IsZoomedIn() const {return bIsZoomedIn
;}
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
*);
138 void InitImageList();
139 virtual SfxChildAlignment
140 CheckAlignment(SfxChildAlignment
,SfxChildAlignment
);
141 void SetPopupWindow( SfxPopupWindow
* );
143 using Window::Notify
;
144 using Window::StateChanged
;
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();
158 void SetGlobalMode(BOOL bSet
) {bGlobalMode
= bSet
;}
162 SwNavigationPI(SfxBindings
*, SfxChildWindowContext
*, Window
*);
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
193 SwNavigationChild( Window
* ,
198 SFX_DECL_CHILDWINDOW_CONTEXT( SwNavigationChild
)