Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _NAVIPI_HXX
29 : : #define _NAVIPI_HXX
30 : :
31 : : // INCLUDE ---------------------------------------------------------------
32 : :
33 : : #include <vcl/lstbox.hxx>
34 : : #include <svl/lstner.hxx>
35 : : #include <svtools/transfer.hxx>
36 : : #include <sfx2/childwin.hxx>
37 : : #include <sfx2/ctrlitem.hxx>
38 : : #include <sfx2/tbxctrl.hxx>
39 : : #include <conttree.hxx>
40 : : #include <popbox.hxx>
41 : :
42 : : class SwWrtShell;
43 : : class SwNavigationPI;
44 : : class SwNavigationChild;
45 : : class SfxBindings;
46 : : class NumEditAction;
47 : : class SwView;
48 : : class SwNavigationConfig;
49 : : class SfxObjectShellLock;
50 : : class SfxChildWindowContext;
51 : : class SwNavigationPI;
52 : :
53 [ # # ]: 0 : class SwNavHelpToolBox : public SwHelpToolBox
54 : : {
55 : : virtual void MouseButtonDown(const MouseEvent &rEvt);
56 : : virtual void RequestHelp( const HelpEvent& rHEvt );
57 : : public:
58 : : SwNavHelpToolBox(SwNavigationPI* pParent, const ResId &rResId);
59 : : };
60 : :
61 : : // CLASS -----------------------------------------------------------------
62 : : class SwNavigationPI : public Window,
63 : : public SfxControllerItem, public SfxListener
64 : : {
65 : : friend class SwNavigationChild;
66 : : friend class SwContentTree;
67 : : friend class SwGlobalTree;
68 : :
69 : : // --------- members -----------------------------
70 : : SwNavHelpToolBox aContentToolBox;
71 : : SwHelpToolBox aGlobalToolBox;
72 : : ImageList aContentImageList;
73 : : SwContentTree aContentTree;
74 : : SwGlobalTree aGlobalTree;
75 : : ListBox aDocListBox;
76 : : Timer aPageChgTimer;
77 : : String sContentFileName;
78 : : String aContextArr[3];
79 : : String aStatusArr[4];
80 : : Point aBoxBottomLeft; // Pos when Box is at bottom
81 : :
82 : : SfxObjectShellLock *pxObjectShell;
83 : : SwView *pContentView;
84 : : SwWrtShell *pContentWrtShell;
85 : : SwView *pActContView;
86 : : SwView *pCreateView;
87 : : SfxPopupWindow *pPopupWindow;
88 : : SfxPopupWindow *pFloatingWindow;
89 : :
90 : : SfxChildWindowContext* pContextWin;
91 : :
92 : : SwNavigationConfig *pConfig;
93 : : SfxBindings &rBindings;
94 : :
95 : : long nDocLBIniHeight;
96 : : long nWishWidth;
97 : : sal_uInt16 nAutoMarkIdx;
98 : : sal_uInt16 nRegionMode; // 0 - URL, 1 - region with link 2 - region without link
99 : : short nZoomIn;
100 : : short nZoomOutInit;
101 : : short nZoomOut;
102 : :
103 : : sal_Bool bSmallMode : 1;
104 : : sal_Bool bIsZoomedIn : 1;
105 : : sal_Bool bPageCtrlsVisible : 1;
106 : : sal_Bool bGlobalMode : 1;
107 : :
108 : : // --------- methods -----------------------------
109 : 0 : sal_Bool _IsZoomedIn() const {return bIsZoomedIn;}
110 : : void _ZoomOut();
111 : : void _ZoomIn();
112 : :
113 : : void FillBox();
114 : : void MakeMark();
115 : :
116 : : DECL_LINK( DocListBoxSelectHdl, ListBox * );
117 : : DECL_LINK( ToolBoxSelectHdl, ToolBox * );
118 : : DECL_LINK( ToolBoxClickHdl, ToolBox * );
119 : : DECL_LINK( ToolBoxDropdownClickHdl, ToolBox* );
120 : : DECL_LINK( EditAction, NumEditAction * );
121 : : DECL_LINK( EditGetFocus, NumEditAction * );
122 : : DECL_LINK( DoneLink, SfxPoolItem * );
123 : : DECL_LINK( MenuSelectHdl, Menu * );
124 : : DECL_LINK( ChangePageHdl, void* );
125 : : DECL_LINK( PageEditModifyHdl, void* );
126 : : DECL_LINK( PopupModeEndHdl, void * );
127 : : DECL_LINK( ClosePopupWindow, SfxPopupWindow * );
128 : : void UsePage(SwWrtShell *);
129 : :
130 : : void MakeVisible();
131 : : void InitImageList();
132 : : virtual SfxChildAlignment
133 : : CheckAlignment(SfxChildAlignment,SfxChildAlignment);
134 : : void SetPopupWindow( SfxPopupWindow* );
135 : :
136 : : using Window::Notify;
137 : : using Window::StateChanged;
138 : :
139 : : protected:
140 : :
141 : : virtual sal_Bool Close();
142 : : virtual void Resize();
143 : : virtual void DataChanged( const DataChangedEvent& rDCEvt );
144 : :
145 : :
146 : : // release ObjectShellLock early enough for app end
147 : : virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
148 : :
149 : : NumEditAction& GetPageEdit();
150 : : sal_Bool ToggleTree();
151 : 0 : void SetGlobalMode(sal_Bool bSet) {bGlobalMode = bSet;}
152 : :
153 : : public:
154 : :
155 : : SwNavigationPI(SfxBindings*, SfxChildWindowContext*, Window*);
156 : : ~SwNavigationPI();
157 : :
158 : : void GotoPage(); // jump to page; bindable function
159 : :
160 : : void Update() { FillBox(); }
161 : : void UpdateListBox();
162 : : void MoveOutline(sal_uInt16 nSource, sal_uInt16 nTarget, sal_Bool bWithCilds);
163 : :
164 : : virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
165 : : const SfxPoolItem* pState );
166 : :
167 : : static String CreateDropFileName( TransferableDataHelper& rData );
168 : : static void CleanEntry( String& rEntry );
169 : :
170 : 0 : sal_uInt16 GetRegionDropMode() const {return nRegionMode;}
171 : : void SetRegionDropMode(sal_uInt16 nNewMode);
172 : :
173 : : sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt );
174 : : sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt );
175 : :
176 : : sal_Bool IsGlobalDoc() const;
177 : 0 : sal_Bool IsGlobalMode() const {return bGlobalMode;}
178 : :
179 : : SwView* GetCreateView() const;
180 : : void CreateNavigationTool(const Rectangle& rRect, sal_Bool bSetFocus);
181 : : };
182 : :
183 [ # # ]: 0 : class SwNavigationChild : public SfxChildWindowContext
184 : : {
185 : : public:
186 : : SwNavigationChild( Window* ,
187 : : sal_uInt16 nId,
188 : : SfxBindings*,
189 : : SfxChildWinInfo* );
190 : :
191 : : SFX_DECL_CHILDWINDOW_CONTEXT( SwNavigationChild )
192 : : };
193 : :
194 : : #endif
195 : :
196 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|