10d63794cSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 30d63794cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 40d63794cSAndrew Rist * or more contributor license agreements. See the NOTICE file 50d63794cSAndrew Rist * distributed with this work for additional information 60d63794cSAndrew Rist * regarding copyright ownership. The ASF licenses this file 70d63794cSAndrew Rist * to you under the Apache License, Version 2.0 (the 80d63794cSAndrew Rist * "License"); you may not use this file except in compliance 90d63794cSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 110d63794cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 130d63794cSAndrew Rist * Unless required by applicable law or agreed to in writing, 140d63794cSAndrew Rist * software distributed under the License is distributed on an 150d63794cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 160d63794cSAndrew Rist * KIND, either express or implied. See the License for the 170d63794cSAndrew Rist * specific language governing permissions and limitations 180d63794cSAndrew Rist * under the License. 19cdf0e10cSrcweir * 200d63794cSAndrew Rist *************************************************************/ 210d63794cSAndrew Rist 220d63794cSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SV_SVAPP_HXX 25cdf0e10cSrcweir #define _SV_SVAPP_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #ifndef _VOS_THREAD_HXX 28cdf0e10cSrcweir #include <vos/thread.hxx> 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir #include <tools/string.hxx> 31cdf0e10cSrcweir #include <tools/link.hxx> 32cdf0e10cSrcweir #include <tools/unqid.hxx> 33cdf0e10cSrcweir #include <vcl/sv.h> 34cdf0e10cSrcweir #include <vcl/dllapi.h> 35cdf0e10cSrcweir #include <vcl/apptypes.hxx> 36cdf0e10cSrcweir #ifndef _VCL_SETTINGS_HXX 37cdf0e10cSrcweir #include <vcl/settings.hxx> 38cdf0e10cSrcweir #endif 39cdf0e10cSrcweir #include <vcl/vclevent.hxx> 40cdf0e10cSrcweir class Link; 41cdf0e10cSrcweir class AllSettings; 42cdf0e10cSrcweir class DataChangedEvent; 43cdf0e10cSrcweir class Accelerator; 44cdf0e10cSrcweir class Help; 45cdf0e10cSrcweir class OutputDevice; 46cdf0e10cSrcweir class Window; 47cdf0e10cSrcweir class WorkWindow; 48cdf0e10cSrcweir class MenuBar; 49cdf0e10cSrcweir class UnoWrapperBase; 50cdf0e10cSrcweir class Reflection; 51cdf0e10cSrcweir class KeyCode; 52cdf0e10cSrcweir class NotifyEvent; 53cdf0e10cSrcweir class KeyEvent; 54cdf0e10cSrcweir class MouseEvent; 55cdf0e10cSrcweir 56cdf0e10cSrcweir namespace vos { class IMutex; } 57cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h> 58cdf0e10cSrcweir #include <com/sun/star/connection/XConnection.hpp> 59cdf0e10cSrcweir 60cdf0e10cSrcweir namespace com { 61cdf0e10cSrcweir namespace sun { 62cdf0e10cSrcweir namespace star { 63cdf0e10cSrcweir namespace lang { 64cdf0e10cSrcweir class XMultiServiceFactory; 65cdf0e10cSrcweir } 66cdf0e10cSrcweir namespace awt { 67cdf0e10cSrcweir class XToolkit; 68cdf0e10cSrcweir class XDisplayConnection; 69cdf0e10cSrcweir } 70cdf0e10cSrcweir } } } 71cdf0e10cSrcweir 72cdf0e10cSrcweir // helper needed by SalLayout implementations as well as svx/source/dialog/svxbmpnumbalueset.cxx 73cdf0e10cSrcweir VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 ); 74cdf0e10cSrcweir 75cdf0e10cSrcweir // -------------------- 76cdf0e10cSrcweir // - SystemWindowMode - 77cdf0e10cSrcweir // -------------------- 78cdf0e10cSrcweir 79cdf0e10cSrcweir #define SYSTEMWINDOW_MODE_NOAUTOMODE ((sal_uInt16)0x0001) 80cdf0e10cSrcweir #define SYSTEMWINDOW_MODE_DIALOG ((sal_uInt16)0x0002) 81cdf0e10cSrcweir 82cdf0e10cSrcweir // ------------- 83cdf0e10cSrcweir // - EventHook - 84cdf0e10cSrcweir // ------------- 85cdf0e10cSrcweir 86cdf0e10cSrcweir typedef long (*VCLEventHookProc)( NotifyEvent& rEvt, void* pData ); 87cdf0e10cSrcweir 88cdf0e10cSrcweir // -------------------- 89cdf0e10cSrcweir // - ApplicationEvent - 90cdf0e10cSrcweir // -------------------- 91cdf0e10cSrcweir 92cdf0e10cSrcweir // Erstmal wieder eingebaut, damit AppEvents auf dem MAC funktionieren 93cdf0e10cSrcweir #ifdef UNX 94cdf0e10cSrcweir // enum Doppelt in daemon.cxx unter unix Achtung !!! 95cdf0e10cSrcweir enum Service { SERVICE_OLE, SERVICE_APPEVENT, SERVICE_IPC }; 96cdf0e10cSrcweir #endif 97cdf0e10cSrcweir 98cdf0e10cSrcweir class VCL_DLLPUBLIC ApplicationAddress 99cdf0e10cSrcweir { 100cdf0e10cSrcweir friend class Application; 101cdf0e10cSrcweir protected: 102cdf0e10cSrcweir UniString aHostName; 103cdf0e10cSrcweir UniString aDisplayName; 104cdf0e10cSrcweir UniString aDomainName; 105cdf0e10cSrcweir int nPID; 106cdf0e10cSrcweir 107cdf0e10cSrcweir public: 108cdf0e10cSrcweir ApplicationAddress(); 109cdf0e10cSrcweir ApplicationAddress( const UniString& rDomain ); 110cdf0e10cSrcweir ApplicationAddress( const UniString& rHost, 111cdf0e10cSrcweir const UniString& rDisp, 112cdf0e10cSrcweir const UniString& rDomain ); 113cdf0e10cSrcweir ApplicationAddress( const UniString& rHost, int nPID ); 114cdf0e10cSrcweir 115cdf0e10cSrcweir const UniString& GetHost() const { return aHostName; } 116cdf0e10cSrcweir const UniString& GetDisplay() const { return aDisplayName; } 117cdf0e10cSrcweir const UniString& GetDomain() const { return aDomainName; } 118cdf0e10cSrcweir int GetPID() const { return nPID; } 119cdf0e10cSrcweir 120cdf0e10cSrcweir sal_Bool IsConnectToSame( const ApplicationAddress& rAdr ) const; 121cdf0e10cSrcweir }; 122cdf0e10cSrcweir 123cdf0e10cSrcweir inline ApplicationAddress::ApplicationAddress() 124cdf0e10cSrcweir { 125cdf0e10cSrcweir nPID = 0; 126cdf0e10cSrcweir } 127cdf0e10cSrcweir 128cdf0e10cSrcweir inline ApplicationAddress::ApplicationAddress( const UniString& rDomain ) 129cdf0e10cSrcweir { 130cdf0e10cSrcweir aDomainName = rDomain; 131cdf0e10cSrcweir nPID = 0; 132cdf0e10cSrcweir } 133cdf0e10cSrcweir 134cdf0e10cSrcweir inline ApplicationAddress::ApplicationAddress( const UniString& rHost, 135cdf0e10cSrcweir const UniString& rDisp, 136cdf0e10cSrcweir const UniString& rDomain ) 137cdf0e10cSrcweir { 138cdf0e10cSrcweir aHostName = rHost; 139cdf0e10cSrcweir aDisplayName = rDisp; 140cdf0e10cSrcweir aDomainName = rDomain; 141cdf0e10cSrcweir nPID = 0; 142cdf0e10cSrcweir } 143cdf0e10cSrcweir 144cdf0e10cSrcweir inline ApplicationAddress::ApplicationAddress( const UniString& rHost, int nPIDPar ) 145cdf0e10cSrcweir { 146cdf0e10cSrcweir aHostName = rHost; 147cdf0e10cSrcweir nPID = nPIDPar; 148cdf0e10cSrcweir } 149cdf0e10cSrcweir 150cdf0e10cSrcweir inline sal_Bool ApplicationAddress::IsConnectToSame( const ApplicationAddress& rAdr ) const 151cdf0e10cSrcweir { 152cdf0e10cSrcweir if ( nPID && ((nPID == rAdr.nPID) && (aHostName.Equals( rAdr.aHostName))) ) 153cdf0e10cSrcweir return sal_True; 154cdf0e10cSrcweir else 155cdf0e10cSrcweir return sal_False; 156cdf0e10cSrcweir } 157cdf0e10cSrcweir 158cdf0e10cSrcweir #define APPEVENT_PARAM_DELIMITER '\n' 159cdf0e10cSrcweir 160cdf0e10cSrcweir #define APPEVENT_OPEN_STRING "Open" 161cdf0e10cSrcweir #define APPEVENT_PRINT_STRING "Print" 162cdf0e10cSrcweir #define APPEVENT_DISKINSERT_STRING "DiskInsert" 163cdf0e10cSrcweir #define APPEVENT_SAVEDOCUMENTS_STRING "SaveDocuments" 164cdf0e10cSrcweir 165cdf0e10cSrcweir class VCL_DLLPUBLIC ApplicationEvent 166cdf0e10cSrcweir { 167cdf0e10cSrcweir private: 168cdf0e10cSrcweir UniString aSenderAppName; // Absender Applikationsname 169cdf0e10cSrcweir ByteString aEvent; // Event 170cdf0e10cSrcweir UniString aData; // Uebertragene Daten 171cdf0e10cSrcweir ApplicationAddress aAppAddr; // Absender Addresse 172cdf0e10cSrcweir 173cdf0e10cSrcweir public: 174cdf0e10cSrcweir ApplicationEvent() {} 175cdf0e10cSrcweir ApplicationEvent( const UniString& rSenderAppName, 176cdf0e10cSrcweir const ApplicationAddress& rAppAddr, 177cdf0e10cSrcweir const ByteString& rEvent, 178cdf0e10cSrcweir const UniString& rData ); 179cdf0e10cSrcweir 180cdf0e10cSrcweir const UniString& GetSenderAppName() const { return aSenderAppName; } 181cdf0e10cSrcweir const ByteString& GetEvent() const { return aEvent; } 182cdf0e10cSrcweir const UniString& GetData() const { return aData; } 183cdf0e10cSrcweir const ApplicationAddress& GetAppAddress() const { return aAppAddr; } 184cdf0e10cSrcweir 185cdf0e10cSrcweir sal_Bool IsOpenEvent() const; 186cdf0e10cSrcweir sal_Bool IsPrintEvent() const; 187cdf0e10cSrcweir sal_Bool IsDiskInsertEvent() const; 188cdf0e10cSrcweir 189cdf0e10cSrcweir sal_uInt16 GetParamCount() const { return aData.GetTokenCount( APPEVENT_PARAM_DELIMITER ); } 190cdf0e10cSrcweir UniString GetParam( sal_uInt16 nParam ) const { return aData.GetToken( nParam, APPEVENT_PARAM_DELIMITER ); } 191cdf0e10cSrcweir }; 192cdf0e10cSrcweir 193cdf0e10cSrcweir inline ApplicationEvent::ApplicationEvent( const UniString& rSenderAppName, 194cdf0e10cSrcweir const ApplicationAddress& rAppAddr, 195cdf0e10cSrcweir const ByteString& rEvent, 196cdf0e10cSrcweir const UniString& rData ) : 197cdf0e10cSrcweir aSenderAppName( rSenderAppName ), 198cdf0e10cSrcweir aEvent( rEvent ), 199cdf0e10cSrcweir aData( rData ), 200cdf0e10cSrcweir aAppAddr( rAppAddr ) 201cdf0e10cSrcweir { 202cdf0e10cSrcweir } 203cdf0e10cSrcweir 204cdf0e10cSrcweir inline sal_Bool ApplicationEvent::IsOpenEvent() const 205cdf0e10cSrcweir { 206cdf0e10cSrcweir if ( aEvent.Equals( APPEVENT_OPEN_STRING )) 207cdf0e10cSrcweir return sal_True; 208cdf0e10cSrcweir else 209cdf0e10cSrcweir return sal_False; 210cdf0e10cSrcweir } 211cdf0e10cSrcweir 212cdf0e10cSrcweir inline sal_Bool ApplicationEvent::IsPrintEvent() const 213cdf0e10cSrcweir { 214cdf0e10cSrcweir if ( aEvent.Equals( APPEVENT_PRINT_STRING )) 215cdf0e10cSrcweir return sal_True; 216cdf0e10cSrcweir else 217cdf0e10cSrcweir return sal_False; 218cdf0e10cSrcweir } 219cdf0e10cSrcweir 220cdf0e10cSrcweir inline sal_Bool ApplicationEvent::IsDiskInsertEvent() const 221cdf0e10cSrcweir { 222cdf0e10cSrcweir if ( aEvent.Equals( APPEVENT_DISKINSERT_STRING )) 223cdf0e10cSrcweir return sal_True; 224cdf0e10cSrcweir else 225cdf0e10cSrcweir return sal_False; 226cdf0e10cSrcweir } 227cdf0e10cSrcweir 228cdf0e10cSrcweir class VCL_DLLPUBLIC PropertyHandler 229cdf0e10cSrcweir { 230cdf0e10cSrcweir public: 231cdf0e10cSrcweir virtual void Property( ApplicationProperty& ) = 0; 232cdf0e10cSrcweir }; 233cdf0e10cSrcweir 234cdf0e10cSrcweir // --------------- 235cdf0e10cSrcweir // - Application - 236cdf0e10cSrcweir // --------------- 237cdf0e10cSrcweir 238cdf0e10cSrcweir class VCL_DLLPUBLIC Application 239cdf0e10cSrcweir { 240cdf0e10cSrcweir public: 241cdf0e10cSrcweir Application(); 242cdf0e10cSrcweir virtual ~Application(); 243cdf0e10cSrcweir 244cdf0e10cSrcweir virtual void Main() = 0; 245cdf0e10cSrcweir 246cdf0e10cSrcweir virtual sal_Bool QueryExit(); 247cdf0e10cSrcweir 248cdf0e10cSrcweir virtual void UserEvent( sal_uLong nEvent, void* pEventData ); 249cdf0e10cSrcweir 250cdf0e10cSrcweir virtual void ActivateExtHelp(); 251cdf0e10cSrcweir virtual void DeactivateExtHelp(); 252cdf0e10cSrcweir 253cdf0e10cSrcweir virtual void ShowStatusText( const XubString& rText ); 254cdf0e10cSrcweir virtual void HideStatusText(); 255cdf0e10cSrcweir 256cdf0e10cSrcweir virtual void ShowHelpStatusText( const XubString& rText ); 257cdf0e10cSrcweir virtual void HideHelpStatusText(); 258cdf0e10cSrcweir 259cdf0e10cSrcweir virtual void FocusChanged(); 260cdf0e10cSrcweir virtual void DataChanged( const DataChangedEvent& rDCEvt ); 261cdf0e10cSrcweir 262cdf0e10cSrcweir virtual void Init(); 263cdf0e10cSrcweir virtual void DeInit(); 264cdf0e10cSrcweir 265cdf0e10cSrcweir static void InitAppRes( const ResId& rResId ); 266cdf0e10cSrcweir 267cdf0e10cSrcweir static sal_uInt16 GetCommandLineParamCount(); 268cdf0e10cSrcweir static XubString GetCommandLineParam( sal_uInt16 nParam ); 269cdf0e10cSrcweir static const XubString& GetAppFileName(); 270cdf0e10cSrcweir 271cdf0e10cSrcweir virtual sal_uInt16 Exception( sal_uInt16 nError ); 272cdf0e10cSrcweir static void Abort( const XubString& rErrorText ); 273cdf0e10cSrcweir 274cdf0e10cSrcweir static void Execute(); 275cdf0e10cSrcweir static void Quit(); 276cdf0e10cSrcweir static void Reschedule( bool bAllEvents = false ); 277cdf0e10cSrcweir static void Yield( bool bAllEvents = false ); 278cdf0e10cSrcweir static void EndYield(); 279cdf0e10cSrcweir static vos::IMutex& GetSolarMutex(); 280cdf0e10cSrcweir static vos::OThread::TThreadIdentifier GetMainThreadIdentifier(); 281cdf0e10cSrcweir static sal_uLong ReleaseSolarMutex(); 282cdf0e10cSrcweir static void AcquireSolarMutex( sal_uLong nCount ); 283cdf0e10cSrcweir static void EnableNoYieldMode( bool i_bNoYield ); 284cdf0e10cSrcweir static void AddPostYieldListener( const Link& i_rListener ); 285cdf0e10cSrcweir static void RemovePostYieldListener( const Link& i_rListener ); 286cdf0e10cSrcweir 287cdf0e10cSrcweir static sal_Bool IsInMain(); 288cdf0e10cSrcweir static sal_Bool IsInExecute(); 289cdf0e10cSrcweir static sal_Bool IsShutDown(); 290cdf0e10cSrcweir static sal_Bool IsInModalMode(); 291cdf0e10cSrcweir static sal_uInt16 GetModalModeCount(); 292cdf0e10cSrcweir 293cdf0e10cSrcweir static sal_uInt16 GetDispatchLevel(); 294cdf0e10cSrcweir static sal_Bool AnyInput( sal_uInt16 nType = INPUT_ANY ); 295cdf0e10cSrcweir static sal_uLong GetLastInputInterval(); 296cdf0e10cSrcweir static sal_Bool IsUICaptured(); 297cdf0e10cSrcweir static sal_Bool IsUserActive( sal_uInt16 nTest = USERACTIVE_ALL ); 298cdf0e10cSrcweir 299cdf0e10cSrcweir virtual void SystemSettingsChanging( AllSettings& rSettings, 300cdf0e10cSrcweir Window* pFrame ); 301cdf0e10cSrcweir static void MergeSystemSettings( AllSettings& rSettings ); 302cdf0e10cSrcweir /** validate that the currently selected system UI font is suitable 303cdf0e10cSrcweir to display the application's UI. 304cdf0e10cSrcweir 305cdf0e10cSrcweir A localized test string will be checked if it can be displayed 306cdf0e10cSrcweir in the currently selected system UI font. If no glyphs are 307cdf0e10cSrcweir missing it can be assumed that the font is proper for display 308cdf0e10cSrcweir of the application's UI. 309cdf0e10cSrcweir 310cdf0e10cSrcweir @returns 311cdf0e10cSrcweir <TRUE/> if the system font is suitable for our UI 312cdf0e10cSrcweir <FALSE/> if the test string could not be displayed with the system font 313cdf0e10cSrcweir */ 314cdf0e10cSrcweir static bool ValidateSystemFont(); 315cdf0e10cSrcweir 316cdf0e10cSrcweir static void SetSettings( const AllSettings& rSettings ); 317cdf0e10cSrcweir static const AllSettings& GetSettings(); 318cdf0e10cSrcweir static void NotifyAllWindows( DataChangedEvent& rDCEvt ); 319cdf0e10cSrcweir 320cdf0e10cSrcweir static void AddEventListener( const Link& rEventListener ); 321cdf0e10cSrcweir static void RemoveEventListener( const Link& rEventListener ); 322cdf0e10cSrcweir static void AddKeyListener( const Link& rKeyListener ); 323cdf0e10cSrcweir static void RemoveKeyListener( const Link& rKeyListener ); 324cdf0e10cSrcweir static void ImplCallEventListeners( sal_uLong nEvent, Window* pWin, void* pData ); 325cdf0e10cSrcweir static void ImplCallEventListeners( VclSimpleEvent* pEvent ); 326cdf0e10cSrcweir static sal_Bool HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent ); 327cdf0e10cSrcweir 328cdf0e10cSrcweir static sal_uLong PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent ); 329cdf0e10cSrcweir static sal_uLong PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent ); 330cdf0e10cSrcweir static void RemoveMouseAndKeyEvents( Window *pWin ); 331cdf0e10cSrcweir static sal_Bool IsProcessedMouseOrKeyEvent( sal_uLong nEventId ); 332cdf0e10cSrcweir 333cdf0e10cSrcweir static sal_uLong PostUserEvent( sal_uLong nEvent, void* pEventData = NULL ); 334cdf0e10cSrcweir static sal_uLong PostUserEvent( const Link& rLink, void* pCaller = NULL ); 335cdf0e10cSrcweir static sal_Bool PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData = NULL ); 336cdf0e10cSrcweir static sal_Bool PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller = NULL ); 337cdf0e10cSrcweir static void RemoveUserEvent( sal_uLong nUserEvent ); 338cdf0e10cSrcweir 339cdf0e10cSrcweir static sal_Bool InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority ); 340cdf0e10cSrcweir static void RemoveIdleHdl( const Link& rLink ); 341cdf0e10cSrcweir 342cdf0e10cSrcweir virtual void AppEvent( const ApplicationEvent& rAppEvent ); 343cdf0e10cSrcweir 344cdf0e10cSrcweir virtual void Property( ApplicationProperty& ); 345cdf0e10cSrcweir void SetPropertyHandler( PropertyHandler* pHandler ); 346cdf0e10cSrcweir 347cdf0e10cSrcweir #ifndef NO_GETAPPWINDOW 348cdf0e10cSrcweir static WorkWindow* GetAppWindow(); 349cdf0e10cSrcweir #endif 350cdf0e10cSrcweir 351cdf0e10cSrcweir static Window* GetFocusWindow(); 352cdf0e10cSrcweir static OutputDevice* GetDefaultDevice(); 353cdf0e10cSrcweir 354cdf0e10cSrcweir static Window* GetFirstTopLevelWindow(); 355cdf0e10cSrcweir static Window* GetNextTopLevelWindow( Window* pWindow ); 356cdf0e10cSrcweir 357cdf0e10cSrcweir static long GetTopWindowCount(); 358cdf0e10cSrcweir static Window* GetTopWindow( long nIndex ); 359cdf0e10cSrcweir static Window* GetActiveTopWindow(); 360cdf0e10cSrcweir 361cdf0e10cSrcweir static void SetAppName( const String& rUniqueName ); 362cdf0e10cSrcweir static String GetAppName(); 363cdf0e10cSrcweir 364cdf0e10cSrcweir static void SetDisplayName( const UniString& rDisplayName ); 365cdf0e10cSrcweir static UniString GetDisplayName(); 366cdf0e10cSrcweir 367cdf0e10cSrcweir static unsigned int GetScreenCount(); 368cdf0e10cSrcweir // IsMultiDisplay returns: 369cdf0e10cSrcweir // true: different screens are separate and windows cannot be moved 370cdf0e10cSrcweir // between them (e.g. Xserver with multiple screens) 371cdf0e10cSrcweir // false: screens form up one large display area 372cdf0e10cSrcweir // windows can be moved between single screens 373cdf0e10cSrcweir // (e.g. Xserver with Xinerama, Windows) 374cdf0e10cSrcweir static bool IsMultiDisplay(); 375cdf0e10cSrcweir static Rectangle GetScreenPosSizePixel( unsigned int nScreen ); 376cdf0e10cSrcweir static Rectangle GetWorkAreaPosSizePixel( unsigned int nScreen ); 377cdf0e10cSrcweir static rtl::OUString GetScreenName( unsigned int nScreen ); 378cdf0e10cSrcweir static unsigned int GetDefaultDisplayNumber(); 379cdf0e10cSrcweir // if IsMultiDisplay() == false the return value will be 380cdf0e10cSrcweir // nearest screen of the target rectangle 381cdf0e10cSrcweir // in case of IsMultiDisplay() == true the return value 382cdf0e10cSrcweir // will always be GetDefaultDisplayNumber() 383cdf0e10cSrcweir static unsigned int GetBestScreen( const Rectangle& ); 384cdf0e10cSrcweir 385cdf0e10cSrcweir static const LocaleDataWrapper& GetAppLocaleDataWrapper(); 386cdf0e10cSrcweir 387cdf0e10cSrcweir static sal_Bool InsertAccel( Accelerator* pAccel ); 388cdf0e10cSrcweir static void RemoveAccel( Accelerator* pAccel ); 389cdf0e10cSrcweir static void FlushAccel(); 390cdf0e10cSrcweir static sal_Bool CallAccel( const KeyCode& rKeyCode, sal_uInt16 nRepeat = 0 ); 391cdf0e10cSrcweir 392cdf0e10cSrcweir static sal_uLong AddHotKey( const KeyCode& rKeyCode, const Link& rLink, void* pData = NULL ); 393cdf0e10cSrcweir static void RemoveHotKey( sal_uLong nId ); 394cdf0e10cSrcweir static sal_uLong AddEventHook( VCLEventHookProc pProc, void* pData = NULL ); 395cdf0e10cSrcweir static void RemoveEventHook( sal_uLong nId ); 396cdf0e10cSrcweir static long CallEventHooks( NotifyEvent& rEvt ); 397cdf0e10cSrcweir static long CallPreNotify( NotifyEvent& rEvt ); 398cdf0e10cSrcweir static long CallEvent( NotifyEvent& rEvt ); 399cdf0e10cSrcweir 400cdf0e10cSrcweir static void SetHelp( Help* pHelp = NULL ); 401cdf0e10cSrcweir static Help* GetHelp(); 402cdf0e10cSrcweir 403cdf0e10cSrcweir static void EnableAutoHelpId( sal_Bool bEnabled = sal_True ); 404cdf0e10cSrcweir static sal_Bool IsAutoHelpIdEnabled(); 405cdf0e10cSrcweir 406cdf0e10cSrcweir static void EnableAutoMnemonic( sal_Bool bEnabled = sal_True ); 407cdf0e10cSrcweir static sal_Bool IsAutoMnemonicEnabled(); 408cdf0e10cSrcweir 409cdf0e10cSrcweir static sal_uLong GetReservedKeyCodeCount(); 410cdf0e10cSrcweir static const KeyCode* GetReservedKeyCode( sal_uLong i ); 411cdf0e10cSrcweir static String GetReservedKeyCodeDescription( sal_uLong i ); 412cdf0e10cSrcweir 413cdf0e10cSrcweir static void SetDefDialogParent( Window* pWindow ); 414cdf0e10cSrcweir static Window* GetDefDialogParent(); 415cdf0e10cSrcweir 416cdf0e10cSrcweir static void EnableDialogCancel( sal_Bool bDialogCancel = sal_True ); 417cdf0e10cSrcweir static sal_Bool IsDialogCancelEnabled(); 418cdf0e10cSrcweir 419cdf0e10cSrcweir static void SetSystemWindowMode( sal_uInt16 nMode ); 420cdf0e10cSrcweir static sal_uInt16 GetSystemWindowMode(); 421cdf0e10cSrcweir 422cdf0e10cSrcweir static void SetDialogScaleX( short nScale ); 423cdf0e10cSrcweir static short GetDialogScaleX(); 424cdf0e10cSrcweir 425cdf0e10cSrcweir static void SetFontPath( const String& rPath ); 426cdf0e10cSrcweir static const String& GetFontPath(); 427cdf0e10cSrcweir 428cdf0e10cSrcweir static UniqueItemId CreateUniqueId(); 429cdf0e10cSrcweir 430cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayConnection > GetDisplayConnection(); 431cdf0e10cSrcweir 432cdf0e10cSrcweir // The global service manager has to be created before! 433cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > GetVCLToolkit(); 434cdf0e10cSrcweir static UnoWrapperBase* GetUnoWrapper( sal_Bool bCreateIfNotExists = sal_True ); 435cdf0e10cSrcweir static void SetUnoWrapper( UnoWrapperBase* pWrapper ); 436cdf0e10cSrcweir 437cdf0e10cSrcweir static void SetFilterHdl( const Link& rLink ); 438cdf0e10cSrcweir static const Link& GetFilterHdl(); 439cdf0e10cSrcweir 440cdf0e10cSrcweir static sal_Bool IsAccessibilityEnabled(); 441cdf0e10cSrcweir 442cdf0e10cSrcweir static void EnableHeadlessMode( sal_Bool bEnable = sal_True ); 443cdf0e10cSrcweir static sal_Bool IsHeadlessModeEnabled(); 44485c309d6SJürgen Schmidt 44585c309d6SJürgen Schmidt static void EnableConversionMode( bool bEnableConv = true ); 44685c309d6SJürgen Schmidt static bool IsConversionModeEnabled(); 44785c309d6SJürgen Schmidt 448cdf0e10cSrcweir 449cdf0e10cSrcweir static void ShowNativeErrorBox(const String& sTitle , 450cdf0e10cSrcweir const String& sMessage); 451df906e24SSteve Yin //IAccessibility2 Implementation 2009----- 452df906e24SSteve Yin static bool EnableAccessInterface(bool bEnable); 453df906e24SSteve Yin static bool IsEnableAccessInterface(); 454df906e24SSteve Yin //-----IAccessibility2 Implementation 2009 455cdf0e10cSrcweir 456cdf0e10cSrcweir // IME Status Window Control: 457cdf0e10cSrcweir 458cdf0e10cSrcweir /** Return true if any IME status window can be toggled on and off 459cdf0e10cSrcweir externally. 460cdf0e10cSrcweir 461cdf0e10cSrcweir Must only be called with the Solar mutex locked. 462cdf0e10cSrcweir */ 463cdf0e10cSrcweir static bool CanToggleImeStatusWindow(); 464cdf0e10cSrcweir 465cdf0e10cSrcweir /** Toggle any IME status window on and off. 466cdf0e10cSrcweir 467cdf0e10cSrcweir This only works if CanToggleImeStatusWinodw returns true (otherwise, 468cdf0e10cSrcweir any calls of this method are ignored). 469cdf0e10cSrcweir 470cdf0e10cSrcweir Must only be called with the Solar mutex locked. 471cdf0e10cSrcweir */ 472cdf0e10cSrcweir static void ShowImeStatusWindow(bool bShow); 473cdf0e10cSrcweir 474cdf0e10cSrcweir /** Return true if any IME status window should be turned on by default 475cdf0e10cSrcweir (this decision can be locale dependent, for example). 476cdf0e10cSrcweir 477cdf0e10cSrcweir Can be called without the Solar mutex locked. 478cdf0e10cSrcweir */ 479cdf0e10cSrcweir static bool GetShowImeStatusWindowDefault(); 480cdf0e10cSrcweir 481cdf0e10cSrcweir /** Returns a string representing the desktop environment 482cdf0e10cSrcweir the process is currently running in. 483cdf0e10cSrcweir */ 484cdf0e10cSrcweir static const ::rtl::OUString& GetDesktopEnvironment(); 485cdf0e10cSrcweir 486cdf0e10cSrcweir /** Add a file to the system shells recent document list if there is any. 487cdf0e10cSrcweir This function may have no effect under Unix because there is no 488cdf0e10cSrcweir standard API among the different desktop managers. 489cdf0e10cSrcweir 490cdf0e10cSrcweir @param rFileUrl 491cdf0e10cSrcweir The file url of the document. 492cdf0e10cSrcweir 493cdf0e10cSrcweir @param rMimeType 494cdf0e10cSrcweir The mime content type of the document specified by aFileUrl. 495cdf0e10cSrcweir If an empty string will be provided "application/octet-stream" 496cdf0e10cSrcweir will be used. 497cdf0e10cSrcweir */ 498cdf0e10cSrcweir static void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); 499cdf0e10cSrcweir 500cdf0e10cSrcweir private: 501cdf0e10cSrcweir 502cdf0e10cSrcweir DECL_STATIC_LINK( Application, PostEventHandler, void* ); 503cdf0e10cSrcweir }; 504cdf0e10cSrcweir 505cdf0e10cSrcweir VCL_DLLPUBLIC Application* GetpApp(); 506cdf0e10cSrcweir 507cdf0e10cSrcweir VCL_DLLPUBLIC sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & ); 508cdf0e10cSrcweir VCL_DLLPUBLIC void DeInitVCL(); 509cdf0e10cSrcweir 510cdf0e10cSrcweir VCL_DLLPUBLIC sal_Bool InitAccessBridge( sal_Bool bAllowCancel, sal_Bool &rCancelled ); 511cdf0e10cSrcweir 512cdf0e10cSrcweir // only allowed to call, if no thread is running. You must call JoinMainLoopThread to free all memory. 513cdf0e10cSrcweir VCL_DLLPUBLIC void CreateMainLoopThread( oslWorkerFunction pWorker, void * pThreadData ); 514cdf0e10cSrcweir VCL_DLLPUBLIC void JoinMainLoopThread(); 515cdf0e10cSrcweir 516cdf0e10cSrcweir inline void Application::EndYield() 517cdf0e10cSrcweir { 518cdf0e10cSrcweir PostUserEvent( Link() ); 519cdf0e10cSrcweir } 520cdf0e10cSrcweir 521df906e24SSteve Yin //IAccessibility2 Implementation 2009----- 522df906e24SSteve Yin #ifdef WNT 523*ad3a95a3SSteve Yin VCL_DLLPUBLIC sal_Bool HasAtHook(); 524df906e24SSteve Yin VCL_DLLPUBLIC bool IsWNTInitAccessBridge(); 525df906e24SSteve Yin bool WNTEnableAccessInterface(bool bEnable); 526*ad3a95a3SSteve Yin 527*ad3a95a3SSteve Yin class VCL_DLLPUBLIC CEnableAccessInterface 528*ad3a95a3SSteve Yin { 529*ad3a95a3SSteve Yin public: 530*ad3a95a3SSteve Yin CEnableAccessInterface(bool bEnable = false) 531*ad3a95a3SSteve Yin { 532*ad3a95a3SSteve Yin m_bIsEnableAccessInterface = Application::IsEnableAccessInterface(); 533*ad3a95a3SSteve Yin Application::EnableAccessInterface(bEnable); 534*ad3a95a3SSteve Yin } 535*ad3a95a3SSteve Yin ~CEnableAccessInterface() 536*ad3a95a3SSteve Yin { 537*ad3a95a3SSteve Yin Application::EnableAccessInterface(m_bIsEnableAccessInterface); 538*ad3a95a3SSteve Yin } 539*ad3a95a3SSteve Yin private: 540*ad3a95a3SSteve Yin bool m_bIsEnableAccessInterface; 541*ad3a95a3SSteve Yin }; 542*ad3a95a3SSteve Yin 543df906e24SSteve Yin VCL_DLLPUBLIC bool TestBridgeRegistered(); 544df906e24SSteve Yin VCL_DLLPUBLIC bool IsBridgeRegistered(); 545df906e24SSteve Yin #endif 546df906e24SSteve Yin //-----IAccessibility2 Implementation 2009 547cdf0e10cSrcweir #endif // _APP_HXX 548