1*0d63794cSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*0d63794cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*0d63794cSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*0d63794cSAndrew Rist * distributed with this work for additional information 6*0d63794cSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*0d63794cSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*0d63794cSAndrew Rist * "License"); you may not use this file except in compliance 9*0d63794cSAndrew Rist * with the License. You may obtain a copy of the License at 10*0d63794cSAndrew Rist * 11*0d63794cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*0d63794cSAndrew Rist * 13*0d63794cSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*0d63794cSAndrew Rist * software distributed under the License is distributed on an 15*0d63794cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*0d63794cSAndrew Rist * KIND, either express or implied. See the License for the 17*0d63794cSAndrew Rist * specific language governing permissions and limitations 18*0d63794cSAndrew Rist * under the License. 19*0d63794cSAndrew Rist * 20*0d63794cSAndrew Rist *************************************************************/ 21*0d63794cSAndrew Rist 22*0d63794cSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SV_HELP_HXX 25cdf0e10cSrcweir #define _SV_HELP_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <tools/string.hxx> 28cdf0e10cSrcweir #include <vcl/sv.h> 29cdf0e10cSrcweir #include <vcl/dllapi.h> 30cdf0e10cSrcweir 31cdf0e10cSrcweir class Point; 32cdf0e10cSrcweir class Rectangle; 33cdf0e10cSrcweir class Window; 34cdf0e10cSrcweir 35cdf0e10cSrcweir // -------------- 36cdf0e10cSrcweir // - Help-Types - 37cdf0e10cSrcweir // -------------- 38cdf0e10cSrcweir 39cdf0e10cSrcweir #define QUICKHELP_LEFT ((sal_uInt16)0x0001) 40cdf0e10cSrcweir #define QUICKHELP_CENTER ((sal_uInt16)0x0002) 41cdf0e10cSrcweir #define QUICKHELP_RIGHT ((sal_uInt16)0x0004) 42cdf0e10cSrcweir #define QUICKHELP_TOP ((sal_uInt16)0x0008) 43cdf0e10cSrcweir #define QUICKHELP_VCENTER ((sal_uInt16)0x0010) 44cdf0e10cSrcweir #define QUICKHELP_BOTTOM ((sal_uInt16)0x0020) 45cdf0e10cSrcweir #define QUICKHELP_NOAUTOPOS (QUICKHELP_LEFT | QUICKHELP_CENTER | QUICKHELP_RIGHT | QUICKHELP_TOP | QUICKHELP_VCENTER | QUICKHELP_BOTTOM) 46cdf0e10cSrcweir #define QUICKHELP_CTRLTEXT ((sal_uInt16)0x0040) 47cdf0e10cSrcweir /// force the existent tip window to be re-positioned, even if the previous incarnation has the same text. Applies to ShowBallon and ShowQuickHelp. 48cdf0e10cSrcweir #define QUICKHELP_FORCE_REPOSITION ((sal_uInt16)0x0080) 49cdf0e10cSrcweir /// no delay when opening the quick help. Applies to ShowBallon and ShowQuickHelp 50cdf0e10cSrcweir #define QUICKHELP_NO_DELAY ((sal_uInt16)0x0100) 51cdf0e10cSrcweir /// force balloon-style in ShowTip 52cdf0e10cSrcweir #define QUICKHELP_TIP_STYLE_BALLOON ((sal_uInt16)0x0200) 53cdf0e10cSrcweir #define QUICKHELP_NOEVADEPOINTER ((sal_uInt16)0x4000) 54cdf0e10cSrcweir #define QUICKHELP_BIDI_RTL ((sal_uInt16)0x8000) 55cdf0e10cSrcweir 56cdf0e10cSrcweir // By changes you must also change: rsc/vclrsc.hxx 57cdf0e10cSrcweir #define OOO_HELP_INDEX ".help:index" 58cdf0e10cSrcweir #define OOO_HELP_HELPONHELP ".help:helponhelp" 59cdf0e10cSrcweir 60cdf0e10cSrcweir // -------- 61cdf0e10cSrcweir // - Help - 62cdf0e10cSrcweir // -------- 63cdf0e10cSrcweir 64cdf0e10cSrcweir class VCL_DLLPUBLIC Help 65cdf0e10cSrcweir { 66cdf0e10cSrcweir private: 67cdf0e10cSrcweir String maHelpFile; 68cdf0e10cSrcweir 69cdf0e10cSrcweir public: 70cdf0e10cSrcweir Help(); 71cdf0e10cSrcweir virtual ~Help(); 72cdf0e10cSrcweir SetHelpFile(const String & rFileName)73cdf0e10cSrcweir void SetHelpFile( const String& rFileName ) { maHelpFile = rFileName; } GetHelpFile() const74cdf0e10cSrcweir const String& GetHelpFile() const { return maHelpFile; } 75cdf0e10cSrcweir 76cdf0e10cSrcweir virtual sal_Bool Start( const XubString& rHelpId, const Window* pWindow ); 77cdf0e10cSrcweir virtual sal_Bool SearchKeyword( const XubString& rKeyWord ); 78cdf0e10cSrcweir virtual void OpenHelpAgent( const rtl::OString& rHelpId ); 79cdf0e10cSrcweir virtual XubString GetHelpText( const String& aHelpURL, const Window* pWindow ); 80cdf0e10cSrcweir 81cdf0e10cSrcweir static void EnableContextHelp(); 82cdf0e10cSrcweir static void DisableContextHelp(); 83cdf0e10cSrcweir static sal_Bool IsContextHelpEnabled(); 84cdf0e10cSrcweir static sal_Bool StartContextHelp(); 85cdf0e10cSrcweir 86cdf0e10cSrcweir static void EnableExtHelp(); 87cdf0e10cSrcweir static void DisableExtHelp(); 88cdf0e10cSrcweir static sal_Bool IsExtHelpEnabled(); 89cdf0e10cSrcweir static sal_Bool StartExtHelp(); 90cdf0e10cSrcweir static sal_Bool EndExtHelp(); 91cdf0e10cSrcweir static sal_Bool IsExtHelpActive(); 92cdf0e10cSrcweir 93cdf0e10cSrcweir static void EnableBalloonHelp(); 94cdf0e10cSrcweir static void DisableBalloonHelp(); 95cdf0e10cSrcweir static sal_Bool IsBalloonHelpEnabled(); 96cdf0e10cSrcweir static sal_Bool ShowBalloon( Window* pParent, 97cdf0e10cSrcweir const Point& rScreenPos, 98cdf0e10cSrcweir const XubString& rHelpText ); 99cdf0e10cSrcweir static sal_Bool ShowBalloon( Window* pParent, 100cdf0e10cSrcweir const Point& rScreenPos, 101cdf0e10cSrcweir const Rectangle&, 102cdf0e10cSrcweir const XubString& rHelpText ); 103cdf0e10cSrcweir 104cdf0e10cSrcweir static void EnableQuickHelp(); 105cdf0e10cSrcweir static void DisableQuickHelp(); 106cdf0e10cSrcweir static sal_Bool IsQuickHelpEnabled(); 107cdf0e10cSrcweir static sal_Bool ShowQuickHelp( Window* pParent, 108cdf0e10cSrcweir const Rectangle& rScreenRect, 109cdf0e10cSrcweir const XubString& rHelpText, 110cdf0e10cSrcweir const XubString& rLongHelpText, 111cdf0e10cSrcweir sal_uInt16 nStyle = 0 ); ShowQuickHelp(Window * pParent,const Rectangle & rScreenRect,const XubString & rHelpText,sal_uInt16 nStyle=0)112cdf0e10cSrcweir static sal_Bool ShowQuickHelp( Window* pParent, 113cdf0e10cSrcweir const Rectangle& rScreenRect, 114cdf0e10cSrcweir const XubString& rHelpText, 115cdf0e10cSrcweir sal_uInt16 nStyle = 0 ) 116cdf0e10cSrcweir { return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, XubString(), nStyle ); } 117cdf0e10cSrcweir 118cdf0e10cSrcweir static void HideBalloonAndQuickHelp(); 119cdf0e10cSrcweir 120cdf0e10cSrcweir static sal_uLong ShowTip( Window* pParent, 121cdf0e10cSrcweir const Rectangle& rScreenRect, 122cdf0e10cSrcweir const XubString& rText, sal_uInt16 nStyle = 0 ); 123cdf0e10cSrcweir static void UpdateTip( sal_uLong nId, 124cdf0e10cSrcweir Window* pParent, 125cdf0e10cSrcweir const Rectangle& rScreenRect, 126cdf0e10cSrcweir const XubString& rText ); 127cdf0e10cSrcweir static void HideTip( sal_uLong nId ); 128cdf0e10cSrcweir }; 129cdf0e10cSrcweir 130cdf0e10cSrcweir #endif // _SV_HELP_HXX 131