xref: /AOO41X/main/sfx2/inc/sfx2/sfxhelp.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _SFX_HELP_HXX
28 #define _SFX_HELP_HXX
29 
30 #include "sal/config.h"
31 #include "sfx2/dllapi.h"
32 #include "sal/types.h"
33 #include <vcl/help.hxx>
34 #include <tools/string.hxx>
35 
36 class SfxHelp_Impl;
37 class SfxFrame;
38 class SFX2_DLLPUBLIC SfxHelp : public Help
39 {
40     String          aTicket;        // for Plugins
41     String          aUser;
42 	String			aLanguageStr;
43 	String			aCountryStr;
44 	sal_Bool		bIsDebug;
45     SfxHelp_Impl*   pImp;
46 
47 private:
48     SAL_DLLPRIVATE sal_Bool Start_Impl( const String& rURL, const Window* pWindow, const String& rKeyword );
49 	SAL_DLLPRIVATE virtual sal_Bool	SearchKeyword( const XubString& rKeyWord );
50     SAL_DLLPRIVATE virtual sal_Bool Start( const String& rURL, const Window* pWindow );
51     SAL_DLLPRIVATE virtual void OpenHelpAgent( const rtl::OString& sHelpId );
52 	SAL_DLLPRIVATE String GetHelpModuleName_Impl();
53 	SAL_DLLPRIVATE String CreateHelpURL_Impl( const String& aCommandURL, const String& rModuleName );
54 
55 public:
56     SfxHelp();
57     ~SfxHelp();
58 
59     inline void             SetTicket( const String& rTicket )  { aTicket = rTicket; }
60     inline void             SetUser( const String& rUser )      { aUser = rUser; }
61 
62     virtual XubString       GetHelpText( const String&, const Window* pWindow );
63 
64     static String           CreateHelpURL( const String& aCommandURL, const String& rModuleName );
65     using Help::OpenHelpAgent;
66     static void             OpenHelpAgent( SfxFrame* pFrame, const rtl::OString& sHelpId );
67     static String           GetDefaultHelpModule();
68     static ::rtl::OUString  GetCurrentModuleIdentifier();
69 };
70 
71 #endif // #ifndef _SFX_HELP_HXX
72 
73