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
;
106 USHORT nRegionMode
; // 0 - URL, 1 - Bereich mit Link 2 - B. ohne Link
112 BOOL bIsZoomedIn
: 1;
113 BOOL bPageCtrlsVisible
: 1;
114 BOOL bGlobalMode
: 1;
116 // --------- methods -----------------------------
117 BOOL
_IsZoomedIn() const {return bIsZoomedIn
;}
124 DECL_LINK( DocListBoxSelectHdl
, ListBox
* );
125 DECL_LINK( ToolBoxSelectHdl
, ToolBox
* );
126 DECL_LINK( ToolBoxClickHdl
, ToolBox
* );
127 DECL_LINK( ToolBoxDropdownClickHdl
, ToolBox
* );
128 DECL_LINK( EditAction
, NumEditAction
* );
129 DECL_LINK( EditGetFocus
, NumEditAction
* );
130 DECL_LINK( DoneLink
, SfxPoolItem
* );
131 DECL_LINK( MenuSelectHdl
, Menu
* );
132 DECL_LINK( ChangePageHdl
, Timer
* );
133 DECL_LINK( PageEditModifyHdl
, Edit
* );
134 DECL_LINK( PopupModeEndHdl
, void * );
135 DECL_LINK( ClosePopupWindow
, SfxPopupWindow
* );
136 void UsePage(SwWrtShell
*);
139 void InitImageList();
140 virtual SfxChildAlignment
141 CheckAlignment(SfxChildAlignment
,SfxChildAlignment
);
142 void SetPopupWindow( SfxPopupWindow
* );
144 using Window::Notify
;
145 using Window::StateChanged
;
149 virtual BOOL
Close();
150 virtual void Resize();
151 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
154 // zum App-Ende rechtzeitig ObjectShellLock loslassen
155 virtual void Notify( SfxBroadcaster
& rBC
, const SfxHint
& rHint
);
157 NumEditAction
& GetPageEdit();
159 void SetGlobalMode(BOOL bSet
) {bGlobalMode
= bSet
;}
163 SwNavigationPI(SfxBindings
*, SfxChildWindowContext
*, Window
*);
166 void GotoPage(); // Seite anspringen; bindbare Funktion
168 void Update() { FillBox(); }
169 void UpdateListBox();
170 void MoveOutline(USHORT nSource
, USHORT nTarget
, BOOL bWithCilds
);
172 virtual void StateChanged( USHORT nSID
, SfxItemState eState
,
173 const SfxPoolItem
* pState
);
175 static String
CreateDropFileName( TransferableDataHelper
& rData
);
176 static void CleanEntry( String
& rEntry
);
178 USHORT
GetRegionDropMode() const {return nRegionMode
;}
179 void SetRegionDropMode(USHORT nNewMode
);
181 sal_Int8
AcceptDrop( const AcceptDropEvent
& rEvt
);
182 sal_Int8
ExecuteDrop( const ExecuteDropEvent
& rEvt
);
184 BOOL
IsGlobalDoc() const;
185 BOOL
IsGlobalMode() const {return bGlobalMode
;}
187 SwView
* GetCreateView() const;
188 void CreateNavigationTool(const Rectangle
& rRect
, BOOL bSetFocus
);
191 class SwNavigationChild
: public SfxChildWindowContext
194 SwNavigationChild( Window
* ,
199 SFX_DECL_CHILDWINDOW_CONTEXT( SwNavigationChild
)