1*353d8f4dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*353d8f4dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*353d8f4dSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*353d8f4dSAndrew Rist * distributed with this work for additional information
6*353d8f4dSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*353d8f4dSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*353d8f4dSAndrew Rist * "License"); you may not use this file except in compliance
9*353d8f4dSAndrew Rist * with the License. You may obtain a copy of the License at
10*353d8f4dSAndrew Rist *
11*353d8f4dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*353d8f4dSAndrew Rist *
13*353d8f4dSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*353d8f4dSAndrew Rist * software distributed under the License is distributed on an
15*353d8f4dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*353d8f4dSAndrew Rist * KIND, either express or implied. See the License for the
17*353d8f4dSAndrew Rist * specific language governing permissions and limitations
18*353d8f4dSAndrew Rist * under the License.
19*353d8f4dSAndrew Rist *
20*353d8f4dSAndrew Rist *************************************************************/
21*353d8f4dSAndrew Rist
22*353d8f4dSAndrew Rist
23cdf0e10cSrcweir #ifndef INCLUDED_SFX_NEWHELP_HXX
24cdf0e10cSrcweir #define INCLUDED_SFX_NEWHELP_HXX
25cdf0e10cSrcweir
26cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
27cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h>
28cdf0e10cSrcweir #include <com/sun/star/frame/XDispatchResultListener.hpp>
29cdf0e10cSrcweir #include <com/sun/star/frame/XDispatch.hpp>
30cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
31cdf0e10cSrcweir
32cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace awt { class XWindow; } } } }
33cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace frame { class XFrame; } } } }
34cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace i18n { class XBreakIterator; } } } }
35cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace text { class XTextRange; } } } }
36cdf0e10cSrcweir
37cdf0e10cSrcweir #include <vcl/window.hxx>
38cdf0e10cSrcweir #include <vcl/toolbox.hxx>
39cdf0e10cSrcweir #include <vcl/tabpage.hxx>
40cdf0e10cSrcweir #include <vcl/splitwin.hxx>
41cdf0e10cSrcweir #include <vcl/tabctrl.hxx>
42cdf0e10cSrcweir #include <vcl/combobox.hxx>
43cdf0e10cSrcweir #include <vcl/fixed.hxx>
44cdf0e10cSrcweir #include <vcl/button.hxx>
45cdf0e10cSrcweir #include <vcl/lstbox.hxx>
46cdf0e10cSrcweir #include <vcl/dialog.hxx>
47cdf0e10cSrcweir #include <svtools/svtreebx.hxx>
48cdf0e10cSrcweir #include <unotools/moduleoptions.hxx>
49cdf0e10cSrcweir
50cdf0e10cSrcweir #include "srchdlg.hxx"
51cdf0e10cSrcweir
52cdf0e10cSrcweir // class OpenStatusListener_Impl -----------------------------------------
53cdf0e10cSrcweir
54cdf0e10cSrcweir class OpenStatusListener_Impl : public ::cppu::WeakImplHelper1< ::com::sun::star::frame::XDispatchResultListener >
55cdf0e10cSrcweir {
56cdf0e10cSrcweir private:
57cdf0e10cSrcweir sal_Bool m_bFinished;
58cdf0e10cSrcweir sal_Bool m_bSuccess;
59cdf0e10cSrcweir Link m_aOpenLink;
60cdf0e10cSrcweir String m_sURL;
61cdf0e10cSrcweir
62cdf0e10cSrcweir public:
OpenStatusListener_Impl()63cdf0e10cSrcweir OpenStatusListener_Impl() : m_bFinished( sal_False ), m_bSuccess( sal_False ) {}
64cdf0e10cSrcweir
65cdf0e10cSrcweir virtual void SAL_CALL dispatchFinished( const ::com::sun::star::frame::DispatchResultEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
66cdf0e10cSrcweir virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
67cdf0e10cSrcweir
IsFinished() const68cdf0e10cSrcweir inline sal_Bool IsFinished() const { return m_bFinished; }
IsSuccessful() const69cdf0e10cSrcweir inline sal_Bool IsSuccessful() const { return m_bSuccess; }
SetURL(const String & rURL)70cdf0e10cSrcweir inline void SetURL( const String& rURL ) { m_sURL = rURL; }
GetURL() const71cdf0e10cSrcweir inline String GetURL() const { return m_sURL; }
SetOpenHdl(const Link & rLink)72cdf0e10cSrcweir inline void SetOpenHdl( const Link& rLink ) { m_aOpenLink = rLink; }
73cdf0e10cSrcweir };
74cdf0e10cSrcweir
75cdf0e10cSrcweir // ContentListBox_Impl ---------------------------------------------------
76cdf0e10cSrcweir
77cdf0e10cSrcweir class ContentListBox_Impl : public SvTreeListBox
78cdf0e10cSrcweir {
79cdf0e10cSrcweir private:
80cdf0e10cSrcweir Image aOpenBookImage;
81cdf0e10cSrcweir Image aClosedBookImage;
82cdf0e10cSrcweir Image aDocumentImage;
83cdf0e10cSrcweir
84cdf0e10cSrcweir void InitRoot();
85cdf0e10cSrcweir void ClearChildren( SvLBoxEntry* pParent );
86cdf0e10cSrcweir
87cdf0e10cSrcweir public:
88cdf0e10cSrcweir ContentListBox_Impl( Window* pParent, const ResId& rResId );
89cdf0e10cSrcweir ~ContentListBox_Impl();
90cdf0e10cSrcweir
91cdf0e10cSrcweir
92cdf0e10cSrcweir virtual void RequestingChilds( SvLBoxEntry* pParent );
93cdf0e10cSrcweir virtual long Notify( NotifyEvent& rNEvt );
94cdf0e10cSrcweir
SetOpenHdl(const Link & rLink)95cdf0e10cSrcweir inline void SetOpenHdl( const Link& rLink ) { SetDoubleClickHdl( rLink ); }
96cdf0e10cSrcweir String GetSelectEntry() const;
97cdf0e10cSrcweir };
98cdf0e10cSrcweir
99cdf0e10cSrcweir // class HelpTabPage_Impl ------------------------------------------------
100cdf0e10cSrcweir
101cdf0e10cSrcweir class SfxHelpIndexWindow_Impl;
102cdf0e10cSrcweir
103cdf0e10cSrcweir class HelpTabPage_Impl : public TabPage
104cdf0e10cSrcweir {
105cdf0e10cSrcweir protected:
106cdf0e10cSrcweir SfxHelpIndexWindow_Impl* m_pIdxWin;
107cdf0e10cSrcweir
108cdf0e10cSrcweir public:
109cdf0e10cSrcweir HelpTabPage_Impl( Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin, const ResId& rResId );
110cdf0e10cSrcweir
111cdf0e10cSrcweir virtual Control* GetLastFocusControl() = 0;
112cdf0e10cSrcweir };
113cdf0e10cSrcweir
114cdf0e10cSrcweir // class ContentTabPage_Impl ---------------------------------------------
115cdf0e10cSrcweir
116cdf0e10cSrcweir class ContentTabPage_Impl : public HelpTabPage_Impl
117cdf0e10cSrcweir {
118cdf0e10cSrcweir private:
119cdf0e10cSrcweir ContentListBox_Impl aContentBox;
120cdf0e10cSrcweir
121cdf0e10cSrcweir public:
122cdf0e10cSrcweir ContentTabPage_Impl( Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin );
123cdf0e10cSrcweir
124cdf0e10cSrcweir virtual void Resize();
125cdf0e10cSrcweir virtual void ActivatePage();
126cdf0e10cSrcweir virtual Control* GetLastFocusControl();
127cdf0e10cSrcweir
SetOpenHdl(const Link & rLink)128cdf0e10cSrcweir inline void SetOpenHdl( const Link& rLink ) { aContentBox.SetOpenHdl( rLink ); }
GetSelectEntry() const129cdf0e10cSrcweir inline String GetSelectEntry() const { return aContentBox.GetSelectEntry(); }
SetFocusOnBox()130cdf0e10cSrcweir inline void SetFocusOnBox() { aContentBox.GrabFocus(); }
131cdf0e10cSrcweir };
132cdf0e10cSrcweir
133cdf0e10cSrcweir // class IndexTabPage_Impl -----------------------------------------------
134cdf0e10cSrcweir
135cdf0e10cSrcweir class IndexBox_Impl : public ComboBox
136cdf0e10cSrcweir {
137cdf0e10cSrcweir public:
138cdf0e10cSrcweir IndexBox_Impl( Window* pParent, const ResId& rResId );
139cdf0e10cSrcweir
140cdf0e10cSrcweir virtual void UserDraw( const UserDrawEvent& rUDEvt );
141cdf0e10cSrcweir virtual long Notify( NotifyEvent& rNEvt );
142cdf0e10cSrcweir
143cdf0e10cSrcweir void SelectExecutableEntry();
144cdf0e10cSrcweir };
145cdf0e10cSrcweir
146cdf0e10cSrcweir class IndexTabPage_Impl : public HelpTabPage_Impl
147cdf0e10cSrcweir {
148cdf0e10cSrcweir private:
149cdf0e10cSrcweir FixedText aExpressionFT;
150cdf0e10cSrcweir IndexBox_Impl aIndexCB;
151cdf0e10cSrcweir PushButton aOpenBtn;
152cdf0e10cSrcweir
153cdf0e10cSrcweir Timer aFactoryTimer;
154cdf0e10cSrcweir Timer aKeywordTimer;
155cdf0e10cSrcweir Link aKeywordLink;
156cdf0e10cSrcweir
157cdf0e10cSrcweir String sFactory;
158cdf0e10cSrcweir String sKeyword;
159cdf0e10cSrcweir
160cdf0e10cSrcweir long nMinWidth;
161cdf0e10cSrcweir sal_Bool bIsActivated;
162cdf0e10cSrcweir
163cdf0e10cSrcweir void InitializeIndex();
164cdf0e10cSrcweir void ClearIndex();
165cdf0e10cSrcweir
166cdf0e10cSrcweir DECL_LINK( OpenHdl, PushButton* );
167cdf0e10cSrcweir DECL_LINK( TimeoutHdl, Timer* );
168cdf0e10cSrcweir
169cdf0e10cSrcweir public:
170cdf0e10cSrcweir IndexTabPage_Impl( Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin );
171cdf0e10cSrcweir ~IndexTabPage_Impl();
172cdf0e10cSrcweir
173cdf0e10cSrcweir virtual void Resize();
174cdf0e10cSrcweir virtual void ActivatePage();
175cdf0e10cSrcweir virtual Control* GetLastFocusControl();
176cdf0e10cSrcweir
177cdf0e10cSrcweir void SetDoubleClickHdl( const Link& rLink );
178cdf0e10cSrcweir void SetFactory( const String& rFactory );
GetFactory() const179cdf0e10cSrcweir inline String GetFactory() const { return sFactory; }
180cdf0e10cSrcweir String GetSelectEntry() const;
SetFocusOnBox()181cdf0e10cSrcweir inline void SetFocusOnBox() { aIndexCB.GrabFocus(); }
HasFocusOnEdit() const182cdf0e10cSrcweir inline sal_Bool HasFocusOnEdit() const { return aIndexCB.HasChildPathFocus(); }
183cdf0e10cSrcweir
SetKeywordHdl(const Link & rLink)184cdf0e10cSrcweir inline void SetKeywordHdl( const Link& rLink ) { aKeywordLink = rLink; }
185cdf0e10cSrcweir void SetKeyword( const String& rKeyword );
186cdf0e10cSrcweir sal_Bool HasKeyword() const;
187cdf0e10cSrcweir sal_Bool HasKeywordIgnoreCase(); //added by BerryJia for fixing Bug98251, 2002-12-11
188cdf0e10cSrcweir void OpenKeyword();
189cdf0e10cSrcweir
SelectExecutableEntry()190cdf0e10cSrcweir inline void SelectExecutableEntry() { aIndexCB.SelectExecutableEntry(); }
191cdf0e10cSrcweir };
192cdf0e10cSrcweir
193cdf0e10cSrcweir // class SearchTabPage_Impl ----------------------------------------------
194cdf0e10cSrcweir
195cdf0e10cSrcweir class SearchBox_Impl : public ComboBox
196cdf0e10cSrcweir {
197cdf0e10cSrcweir private:
198cdf0e10cSrcweir Link aSearchLink;
199cdf0e10cSrcweir
200cdf0e10cSrcweir public:
SearchBox_Impl(Window * pParent,const ResId & rResId)201cdf0e10cSrcweir SearchBox_Impl( Window* pParent, const ResId& rResId ) :
202cdf0e10cSrcweir ComboBox( pParent, rResId ) { SetDropDownLineCount( 5 ); }
203cdf0e10cSrcweir
204cdf0e10cSrcweir virtual long PreNotify( NotifyEvent& rNEvt );
205cdf0e10cSrcweir virtual void Select();
206cdf0e10cSrcweir
SetSearchLink(const Link & rLink)207cdf0e10cSrcweir inline void SetSearchLink( const Link& rLink ) { aSearchLink = rLink; }
208cdf0e10cSrcweir };
209cdf0e10cSrcweir
210cdf0e10cSrcweir class SearchResultsBox_Impl : public ListBox
211cdf0e10cSrcweir {
212cdf0e10cSrcweir public:
SearchResultsBox_Impl(Window * pParent,const ResId & rResId)213cdf0e10cSrcweir SearchResultsBox_Impl( Window* pParent, const ResId& rResId ) : ListBox( pParent, rResId ) {}
214cdf0e10cSrcweir
215cdf0e10cSrcweir virtual long Notify( NotifyEvent& rNEvt );
216cdf0e10cSrcweir };
217cdf0e10cSrcweir
218cdf0e10cSrcweir class SearchTabPage_Impl : public HelpTabPage_Impl
219cdf0e10cSrcweir {
220cdf0e10cSrcweir private:
221cdf0e10cSrcweir FixedText aSearchFT;
222cdf0e10cSrcweir SearchBox_Impl aSearchED;
223cdf0e10cSrcweir PushButton aSearchBtn;
224cdf0e10cSrcweir CheckBox aFullWordsCB;
225cdf0e10cSrcweir CheckBox aScopeCB;
226cdf0e10cSrcweir SearchResultsBox_Impl aResultsLB;
227cdf0e10cSrcweir PushButton aOpenBtn;
228cdf0e10cSrcweir
229cdf0e10cSrcweir Size aMinSize;
230cdf0e10cSrcweir String aFactory;
231cdf0e10cSrcweir
232cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >
233cdf0e10cSrcweir xBreakIterator;
234cdf0e10cSrcweir
235cdf0e10cSrcweir void ClearSearchResults();
236cdf0e10cSrcweir void RememberSearchText( const String& rSearchText );
237cdf0e10cSrcweir
238cdf0e10cSrcweir DECL_LINK( SearchHdl, PushButton* );
239cdf0e10cSrcweir DECL_LINK( OpenHdl, PushButton* );
240cdf0e10cSrcweir DECL_LINK( ModifyHdl, Edit* );
241cdf0e10cSrcweir
242cdf0e10cSrcweir public:
243cdf0e10cSrcweir SearchTabPage_Impl( Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin );
244cdf0e10cSrcweir ~SearchTabPage_Impl();
245cdf0e10cSrcweir
246cdf0e10cSrcweir virtual void Resize();
247cdf0e10cSrcweir virtual void ActivatePage();
248cdf0e10cSrcweir virtual Control* GetLastFocusControl();
249cdf0e10cSrcweir
250cdf0e10cSrcweir void SetDoubleClickHdl( const Link& rLink );
SetFactory(const String & rFactory)251cdf0e10cSrcweir inline void SetFactory( const String& rFactory ) { aFactory = rFactory; }
252cdf0e10cSrcweir String GetSelectEntry() const;
253cdf0e10cSrcweir void ClearPage();
SetFocusOnBox()254cdf0e10cSrcweir inline void SetFocusOnBox() { aResultsLB.GrabFocus(); }
HasFocusOnEdit() const255cdf0e10cSrcweir inline sal_Bool HasFocusOnEdit() const { return aSearchED.HasChildPathFocus(); }
GetSearchText() const256cdf0e10cSrcweir inline String GetSearchText() const { return aSearchED.GetText(); }
IsFullWordSearch() const257cdf0e10cSrcweir inline sal_Bool IsFullWordSearch() const { return aFullWordsCB.IsChecked(); }
258cdf0e10cSrcweir sal_Bool OpenKeyword( const String& rKeyword );
259cdf0e10cSrcweir };
260cdf0e10cSrcweir
261cdf0e10cSrcweir // class BookmarksTabPage_Impl -------------------------------------------
262cdf0e10cSrcweir
263cdf0e10cSrcweir class BookmarksBox_Impl : public ListBox
264cdf0e10cSrcweir {
265cdf0e10cSrcweir private:
266cdf0e10cSrcweir void DoAction( sal_uInt16 nAction );
267cdf0e10cSrcweir
268cdf0e10cSrcweir public:
269cdf0e10cSrcweir BookmarksBox_Impl( Window* pParent, const ResId& rResId );
270cdf0e10cSrcweir ~BookmarksBox_Impl();
271cdf0e10cSrcweir
272cdf0e10cSrcweir virtual long Notify( NotifyEvent& rNEvt );
273cdf0e10cSrcweir };
274cdf0e10cSrcweir
275cdf0e10cSrcweir class BookmarksTabPage_Impl : public HelpTabPage_Impl
276cdf0e10cSrcweir {
277cdf0e10cSrcweir private:
278cdf0e10cSrcweir FixedText aBookmarksFT;
279cdf0e10cSrcweir BookmarksBox_Impl aBookmarksBox;
280cdf0e10cSrcweir PushButton aBookmarksPB;
281cdf0e10cSrcweir
282cdf0e10cSrcweir long nMinWidth;
283cdf0e10cSrcweir
284cdf0e10cSrcweir DECL_LINK( OpenHdl, PushButton* );
285cdf0e10cSrcweir
286cdf0e10cSrcweir public:
287cdf0e10cSrcweir BookmarksTabPage_Impl( Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin );
288cdf0e10cSrcweir
289cdf0e10cSrcweir virtual void Resize();
290cdf0e10cSrcweir virtual void ActivatePage();
291cdf0e10cSrcweir virtual Control* GetLastFocusControl();
292cdf0e10cSrcweir
293cdf0e10cSrcweir void SetDoubleClickHdl( const Link& rLink );
294cdf0e10cSrcweir String GetSelectEntry() const;
295cdf0e10cSrcweir void AddBookmarks( const String& rTitle, const String& rURL );
SetFocusOnBox()296cdf0e10cSrcweir inline void SetFocusOnBox() { aBookmarksBox.GrabFocus(); }
297cdf0e10cSrcweir };
298cdf0e10cSrcweir
299cdf0e10cSrcweir // class SfxHelpIndexWindow_Impl -----------------------------------------
300cdf0e10cSrcweir
301cdf0e10cSrcweir class SfxHelpWindow_Impl;
302cdf0e10cSrcweir
303cdf0e10cSrcweir class SfxHelpIndexWindow_Impl : public Window
304cdf0e10cSrcweir {
305cdf0e10cSrcweir private:
306cdf0e10cSrcweir ListBox aActiveLB;
307cdf0e10cSrcweir FixedLine aActiveLine;
308cdf0e10cSrcweir
309cdf0e10cSrcweir TabControl aTabCtrl;
310cdf0e10cSrcweir Timer aTimer;
311cdf0e10cSrcweir
312cdf0e10cSrcweir Link aSelectFactoryLink;
313cdf0e10cSrcweir Link aPageDoubleClickLink;
314cdf0e10cSrcweir Link aIndexKeywordLink;
315cdf0e10cSrcweir String sKeyword;
316cdf0e10cSrcweir
317cdf0e10cSrcweir SfxHelpWindow_Impl* pParentWin;
318cdf0e10cSrcweir
319cdf0e10cSrcweir ContentTabPage_Impl* pCPage;
320cdf0e10cSrcweir IndexTabPage_Impl* pIPage;
321cdf0e10cSrcweir SearchTabPage_Impl* pSPage;
322cdf0e10cSrcweir BookmarksTabPage_Impl* pBPage;
323cdf0e10cSrcweir
324cdf0e10cSrcweir long nMinWidth;
325cdf0e10cSrcweir bool bWasCursorLeftOrRight;
326cdf0e10cSrcweir bool bIsInitDone;
327cdf0e10cSrcweir
328cdf0e10cSrcweir void Initialize();
329cdf0e10cSrcweir void SetActiveFactory();
330cdf0e10cSrcweir HelpTabPage_Impl* GetCurrentPage( sal_uInt16& rCurId );
331cdf0e10cSrcweir
332cdf0e10cSrcweir inline ContentTabPage_Impl* GetContentPage();
333cdf0e10cSrcweir inline IndexTabPage_Impl* GetIndexPage();
334cdf0e10cSrcweir inline SearchTabPage_Impl* GetSearchPage();
335cdf0e10cSrcweir inline BookmarksTabPage_Impl* GetBookmarksPage();
336cdf0e10cSrcweir
337cdf0e10cSrcweir DECL_LINK( ActivatePageHdl, TabControl* );
338cdf0e10cSrcweir DECL_LINK( SelectHdl, ListBox* );
339cdf0e10cSrcweir DECL_LINK( InitHdl, Timer* );
340cdf0e10cSrcweir DECL_LINK( SelectFactoryHdl, Timer* );
341cdf0e10cSrcweir DECL_LINK( KeywordHdl, IndexTabPage_Impl* );
342cdf0e10cSrcweir
343cdf0e10cSrcweir public:
344cdf0e10cSrcweir SfxHelpIndexWindow_Impl( SfxHelpWindow_Impl* pParent );
345cdf0e10cSrcweir ~SfxHelpIndexWindow_Impl();
346cdf0e10cSrcweir
347cdf0e10cSrcweir virtual void Resize();
348cdf0e10cSrcweir virtual long PreNotify( NotifyEvent& rNEvt );
349cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt );
350cdf0e10cSrcweir
351cdf0e10cSrcweir void SetDoubleClickHdl( const Link& rLink );
SetSelectFactoryHdl(const Link & rLink)352cdf0e10cSrcweir inline void SetSelectFactoryHdl( const Link& rLink ) { aSelectFactoryLink = rLink; }
353cdf0e10cSrcweir void SetFactory( const String& rFactory, sal_Bool bActive );
GetFactory() const354cdf0e10cSrcweir inline String GetFactory() const { return pIPage->GetFactory(); }
355cdf0e10cSrcweir String GetSelectEntry() const;
356cdf0e10cSrcweir void AddBookmarks( const String& rTitle, const String& rURL );
357cdf0e10cSrcweir bool IsValidFactory( const String& _rFactory );
GetActiveFactoryTitle() const358cdf0e10cSrcweir inline String GetActiveFactoryTitle() const { return aActiveLB.GetSelectEntry(); }
UpdateTabControl()359cdf0e10cSrcweir inline void UpdateTabControl() { aTabCtrl.Invalidate(); }
360cdf0e10cSrcweir void ClearSearchPage();
361cdf0e10cSrcweir void GrabFocusBack();
362cdf0e10cSrcweir sal_Bool HasFocusOnEdit() const;
363cdf0e10cSrcweir String GetSearchText() const;
364cdf0e10cSrcweir sal_Bool IsFullWordSearch() const;
365cdf0e10cSrcweir void OpenKeyword( const String& rKeyword );
366cdf0e10cSrcweir void SelectExecutableEntry();
367cdf0e10cSrcweir inline bool WasCursorLeftOrRight();
368cdf0e10cSrcweir };
369cdf0e10cSrcweir
370cdf0e10cSrcweir // inlines ---------------------------------------------------------------
371cdf0e10cSrcweir
GetContentPage()372cdf0e10cSrcweir ContentTabPage_Impl* SfxHelpIndexWindow_Impl::GetContentPage()
373cdf0e10cSrcweir {
374cdf0e10cSrcweir if ( !pCPage )
375cdf0e10cSrcweir {
376cdf0e10cSrcweir pCPage = new ContentTabPage_Impl( &aTabCtrl, this );
377cdf0e10cSrcweir pCPage->SetOpenHdl( aPageDoubleClickLink );
378cdf0e10cSrcweir }
379cdf0e10cSrcweir return pCPage;
380cdf0e10cSrcweir }
GetIndexPage()381cdf0e10cSrcweir IndexTabPage_Impl* SfxHelpIndexWindow_Impl::GetIndexPage()
382cdf0e10cSrcweir {
383cdf0e10cSrcweir if ( !pIPage )
384cdf0e10cSrcweir {
385cdf0e10cSrcweir pIPage = new IndexTabPage_Impl( &aTabCtrl, this );
386cdf0e10cSrcweir pIPage->SetDoubleClickHdl( aPageDoubleClickLink );
387cdf0e10cSrcweir pIPage->SetKeywordHdl( aIndexKeywordLink );
388cdf0e10cSrcweir }
389cdf0e10cSrcweir return pIPage;
390cdf0e10cSrcweir }
391cdf0e10cSrcweir
GetSearchPage()392cdf0e10cSrcweir SearchTabPage_Impl* SfxHelpIndexWindow_Impl::GetSearchPage()
393cdf0e10cSrcweir {
394cdf0e10cSrcweir if ( !pSPage )
395cdf0e10cSrcweir {
396cdf0e10cSrcweir pSPage = new SearchTabPage_Impl( &aTabCtrl, this );
397cdf0e10cSrcweir pSPage->SetDoubleClickHdl( aPageDoubleClickLink );
398cdf0e10cSrcweir }
399cdf0e10cSrcweir return pSPage;
400cdf0e10cSrcweir }
401cdf0e10cSrcweir
GetBookmarksPage()402cdf0e10cSrcweir BookmarksTabPage_Impl* SfxHelpIndexWindow_Impl::GetBookmarksPage()
403cdf0e10cSrcweir {
404cdf0e10cSrcweir if ( !pBPage )
405cdf0e10cSrcweir {
406cdf0e10cSrcweir pBPage = new BookmarksTabPage_Impl( &aTabCtrl, this );
407cdf0e10cSrcweir pBPage->SetDoubleClickHdl( aPageDoubleClickLink );
408cdf0e10cSrcweir }
409cdf0e10cSrcweir return pBPage;
410cdf0e10cSrcweir }
411cdf0e10cSrcweir
WasCursorLeftOrRight()412cdf0e10cSrcweir bool SfxHelpIndexWindow_Impl::WasCursorLeftOrRight()
413cdf0e10cSrcweir {
414cdf0e10cSrcweir bool bRet = bWasCursorLeftOrRight;
415cdf0e10cSrcweir bWasCursorLeftOrRight = false;
416cdf0e10cSrcweir return bRet;
417cdf0e10cSrcweir }
418cdf0e10cSrcweir
419cdf0e10cSrcweir // class TextWin_Impl ----------------------------------------------------
420cdf0e10cSrcweir
421cdf0e10cSrcweir class TextWin_Impl : public DockingWindow
422cdf0e10cSrcweir {
423cdf0e10cSrcweir public:
424cdf0e10cSrcweir TextWin_Impl( Window* pParent );
425cdf0e10cSrcweir virtual ~TextWin_Impl();
426cdf0e10cSrcweir
427cdf0e10cSrcweir virtual long Notify( NotifyEvent& rNEvt );
428cdf0e10cSrcweir };
429cdf0e10cSrcweir
430cdf0e10cSrcweir // class SfxHelpTextWindow_Impl ------------------------------------------
431cdf0e10cSrcweir
432cdf0e10cSrcweir class SvtMiscOptions;
433cdf0e10cSrcweir class SfxHelpWindow_Impl;
434cdf0e10cSrcweir
435cdf0e10cSrcweir class SfxHelpTextWindow_Impl : public Window
436cdf0e10cSrcweir {
437cdf0e10cSrcweir private:
438cdf0e10cSrcweir ToolBox aToolBox;
439cdf0e10cSrcweir CheckBox aOnStartupCB;
440cdf0e10cSrcweir Timer aSelectTimer;
441cdf0e10cSrcweir Image aIndexOnImage;
442cdf0e10cSrcweir Image aIndexOffImage;
443cdf0e10cSrcweir String aIndexOnText;
444cdf0e10cSrcweir String aIndexOffText;
445cdf0e10cSrcweir String aSearchText;
446cdf0e10cSrcweir String aOnStartupText;
447cdf0e10cSrcweir ::rtl::OUString sCurrentFactory;
448cdf0e10cSrcweir
449cdf0e10cSrcweir SfxHelpWindow_Impl* pHelpWin;
450cdf0e10cSrcweir Window* pTextWin;
451cdf0e10cSrcweir sfx2::SearchDialog* pSrchDlg;
452cdf0e10cSrcweir ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame >
453cdf0e10cSrcweir xFrame;
454cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >
455cdf0e10cSrcweir xBreakIterator;
456cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
457cdf0e10cSrcweir xConfiguration;
458cdf0e10cSrcweir long nMinPos;
459cdf0e10cSrcweir sal_Bool bIsDebug;
460cdf0e10cSrcweir sal_Bool bIsIndexOn;
461cdf0e10cSrcweir sal_Bool bIsInClose;
462cdf0e10cSrcweir sal_Bool bIsFullWordSearch;
463cdf0e10cSrcweir
464cdf0e10cSrcweir sal_Bool HasSelection() const;
465cdf0e10cSrcweir void InitToolBoxImages();
466cdf0e10cSrcweir void InitOnStartupBox( bool bOnlyText );
467cdf0e10cSrcweir void SetOnStartupBoxPosition();
468cdf0e10cSrcweir
469cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >
470cdf0e10cSrcweir GetBreakIterator();
471cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >
472cdf0e10cSrcweir getCursor() const;
473cdf0e10cSrcweir bool isHandledKey( const KeyCode& _rKeyCode );
474cdf0e10cSrcweir
475cdf0e10cSrcweir DECL_LINK( SelectHdl, Timer* );
476cdf0e10cSrcweir DECL_LINK( NotifyHdl, SvtMiscOptions* );
477cdf0e10cSrcweir DECL_LINK( FindHdl, sfx2::SearchDialog* );
478cdf0e10cSrcweir DECL_LINK( CloseHdl, sfx2::SearchDialog* );
479cdf0e10cSrcweir DECL_LINK( CheckHdl, CheckBox* );
480cdf0e10cSrcweir
481cdf0e10cSrcweir public:
482cdf0e10cSrcweir SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent );
483cdf0e10cSrcweir ~SfxHelpTextWindow_Impl();
484cdf0e10cSrcweir
485cdf0e10cSrcweir virtual void Resize();
486cdf0e10cSrcweir virtual long PreNotify( NotifyEvent& rNEvt );
487cdf0e10cSrcweir virtual void GetFocus();
488cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt );
489cdf0e10cSrcweir
490cdf0e10cSrcweir inline ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame >
getFrame() const491cdf0e10cSrcweir getFrame() const { return xFrame; }
492cdf0e10cSrcweir
SetSelectHdl(const Link & rLink)493cdf0e10cSrcweir inline void SetSelectHdl( const Link& rLink ) { aToolBox.SetSelectHdl( rLink ); }
494cdf0e10cSrcweir void ToggleIndex( sal_Bool bOn );
495cdf0e10cSrcweir void SelectSearchText( const String& rSearchText, sal_Bool _bIsFullWordSearch );
496cdf0e10cSrcweir void SetPageStyleHeaderOff() const;
GetToolBox()497cdf0e10cSrcweir inline ToolBox& GetToolBox() { return aToolBox; }
498cdf0e10cSrcweir void CloseFrame();
499cdf0e10cSrcweir void DoSearch();
500cdf0e10cSrcweir };
501cdf0e10cSrcweir
502cdf0e10cSrcweir // class SfxHelpWindow_Impl ----------------------------------------------
503cdf0e10cSrcweir
504cdf0e10cSrcweir class HelpInterceptor_Impl;
505cdf0e10cSrcweir class HelpListener_Impl;
506cdf0e10cSrcweir class SfxHelpWindow_Impl : public SplitWindow
507cdf0e10cSrcweir {
508cdf0e10cSrcweir private:
509cdf0e10cSrcweir friend class SfxHelpIndexWindow_Impl;
510cdf0e10cSrcweir
511cdf0e10cSrcweir ::com::sun::star::uno::Reference < ::com::sun::star::awt::XWindow >
512cdf0e10cSrcweir xWindow;
513cdf0e10cSrcweir ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchResultListener >
514cdf0e10cSrcweir xOpenListener;
515cdf0e10cSrcweir ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame >
516cdf0e10cSrcweir xFrame;
517cdf0e10cSrcweir
518cdf0e10cSrcweir SfxHelpIndexWindow_Impl* pIndexWin;
519cdf0e10cSrcweir SfxHelpTextWindow_Impl* pTextWin;
520cdf0e10cSrcweir HelpInterceptor_Impl* pHelpInterceptor;
521cdf0e10cSrcweir HelpListener_Impl* pHelpListener;
522cdf0e10cSrcweir
523cdf0e10cSrcweir sal_Int32 nExpandWidth;
524cdf0e10cSrcweir sal_Int32 nCollapseWidth;
525cdf0e10cSrcweir sal_Int32 nHeight;
526cdf0e10cSrcweir long nIndexSize;
527cdf0e10cSrcweir long nTextSize;
528cdf0e10cSrcweir sal_Bool bIndex;
529cdf0e10cSrcweir sal_Bool bGrabFocusToToolBox;
530cdf0e10cSrcweir Point aWinPos;
531cdf0e10cSrcweir String sTitle;
532cdf0e10cSrcweir String sKeyword;
533cdf0e10cSrcweir
534cdf0e10cSrcweir virtual void Resize();
535cdf0e10cSrcweir virtual void Split();
536cdf0e10cSrcweir virtual void GetFocus();
537cdf0e10cSrcweir
538cdf0e10cSrcweir void MakeLayout();
539cdf0e10cSrcweir void InitSizes();
540cdf0e10cSrcweir void LoadConfig();
541cdf0e10cSrcweir void SaveConfig();
542cdf0e10cSrcweir void ShowStartPage();
543cdf0e10cSrcweir
544cdf0e10cSrcweir DECL_LINK( SelectHdl, ToolBox* );
545cdf0e10cSrcweir DECL_LINK( OpenHdl, SfxHelpIndexWindow_Impl* );
546cdf0e10cSrcweir DECL_LINK( SelectFactoryHdl, SfxHelpIndexWindow_Impl* );
547cdf0e10cSrcweir DECL_LINK( ChangeHdl, HelpListener_Impl* );
548cdf0e10cSrcweir
549cdf0e10cSrcweir public:
550cdf0e10cSrcweir SfxHelpWindow_Impl( const ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame >& rFrame,
551cdf0e10cSrcweir Window* pParent, WinBits nBits );
552cdf0e10cSrcweir ~SfxHelpWindow_Impl();
553cdf0e10cSrcweir
554cdf0e10cSrcweir virtual long PreNotify( NotifyEvent& rNEvt );
555cdf0e10cSrcweir
556cdf0e10cSrcweir void setContainerWindow(
557cdf0e10cSrcweir ::com::sun::star::uno::Reference < ::com::sun::star::awt::XWindow > xWin );
558cdf0e10cSrcweir inline ::com::sun::star::uno::Reference < ::com::sun::star::frame::XFrame >
getTextFrame() const559cdf0e10cSrcweir getTextFrame() const { return pTextWin->getFrame(); }
560cdf0e10cSrcweir inline ::com::sun::star::uno::Reference < ::com::sun::star::frame::XDispatchResultListener >
getOpenListener() const561cdf0e10cSrcweir getOpenListener() const { return xOpenListener; }
562cdf0e10cSrcweir
563cdf0e10cSrcweir void SetFactory( const String& rFactory );
564cdf0e10cSrcweir void SetHelpURL( const String& rURL );
565cdf0e10cSrcweir void DoAction( sal_uInt16 nActionId );
566cdf0e10cSrcweir void CloseWindow();
567cdf0e10cSrcweir
568cdf0e10cSrcweir void UpdateToolbox();
OpenKeyword(const String & rKeyword)569cdf0e10cSrcweir inline void OpenKeyword( const String& rKeyword ) { pIndexWin->OpenKeyword( rKeyword ); }
GetFactory() const570cdf0e10cSrcweir inline String GetFactory() const { return pIndexWin->GetFactory(); }
571cdf0e10cSrcweir
572cdf0e10cSrcweir sal_Bool HasHistoryPredecessor() const; // forward to interceptor
573cdf0e10cSrcweir sal_Bool HasHistorySuccessor() const; // forward to interceptor
574cdf0e10cSrcweir
575cdf0e10cSrcweir void openDone(const ::rtl::OUString& sURL ,
576cdf0e10cSrcweir sal_Bool bSuccess);
577cdf0e10cSrcweir
578cdf0e10cSrcweir static sal_Bool splitHelpURL(const ::rtl::OUString& sHelpURL,
579cdf0e10cSrcweir ::rtl::OUString& sFactory,
580cdf0e10cSrcweir ::rtl::OUString& sContent,
581cdf0e10cSrcweir ::rtl::OUString& sAnchor );
582cdf0e10cSrcweir
583cdf0e10cSrcweir static ::rtl::OUString buildHelpURL(const ::rtl::OUString& sFactory ,
584cdf0e10cSrcweir const ::rtl::OUString& sContent ,
585cdf0e10cSrcweir const ::rtl::OUString& sAnchor ,
586cdf0e10cSrcweir sal_Bool bUseQuestionMark);
587cdf0e10cSrcweir
588cdf0e10cSrcweir void loadHelpContent(const ::rtl::OUString& sHelpURL ,
589cdf0e10cSrcweir sal_Bool bAddToHistory = sal_True);
590cdf0e10cSrcweir };
591cdf0e10cSrcweir
592cdf0e10cSrcweir class SfxAddHelpBookmarkDialog_Impl : public ModalDialog
593cdf0e10cSrcweir {
594cdf0e10cSrcweir private:
595cdf0e10cSrcweir FixedText aTitleFT;
596cdf0e10cSrcweir Edit aTitleED;
597cdf0e10cSrcweir OKButton aOKBtn;
598cdf0e10cSrcweir CancelButton aEscBtn;
599cdf0e10cSrcweir HelpButton aHelpBtn;
600cdf0e10cSrcweir
601cdf0e10cSrcweir public:
602cdf0e10cSrcweir SfxAddHelpBookmarkDialog_Impl( Window* pParent, sal_Bool bRename = sal_True );
603cdf0e10cSrcweir ~SfxAddHelpBookmarkDialog_Impl();
604cdf0e10cSrcweir
605cdf0e10cSrcweir void SetTitle( const String& rTitle );
GetTitle() const606cdf0e10cSrcweir inline String GetTitle() const { return aTitleED.GetText(); }
607cdf0e10cSrcweir };
608cdf0e10cSrcweir
609cdf0e10cSrcweir #endif // #ifndef INCLUDED_SFX_NEWHELP_HXX
610cdf0e10cSrcweir
611