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