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 28 #ifndef _SV_SALSYS_HXX 29 #define _SV_SALSYS_HXX 30 31 #include <tools/string.hxx> 32 #include <tools/gen.hxx> 33 #include <vcl/dllapi.h> 34 35 36 /* Button combinations for ShowNativeMessageBox 37 */ 38 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK = 0; 39 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL = 1; 40 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE = 2; 41 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL = 3; 42 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO = 4; 43 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL = 5; 44 45 /* Button identifier for ShowNativeMessageBox 46 */ 47 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK = 1; 48 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL = 2; 49 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT = 3; 50 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY = 4; 51 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE = 5; 52 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES = 6; 53 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO = 7; 54 55 56 57 // ------------- 58 // - SalSystem - 59 // ------------- 60 61 class VCL_PLUGIN_PUBLIC SalSystem 62 { 63 public: 64 SalSystem() {} 65 virtual ~SalSystem(); 66 67 // get info about the display 68 69 /* Gets the number of active screens attached to the display 70 71 @returns the number of active screens 72 */ 73 virtual unsigned int GetDisplayScreenCount() = 0; 74 /* Queries whether multiple screens are truly separate 75 76 @returns true if screens are distinct and windows cannot 77 be moved between them or span multiple of them 78 false if screens form up one big display 79 */ 80 virtual bool IsMultiDisplay() = 0; 81 /* Queries the default screen number. The default screen is the 82 screen on which windows will appear if no special positioning 83 is made. 84 85 @returns the default screen number 86 */ 87 virtual unsigned int GetDefaultDisplayNumber() = 0; 88 /* Gets relative position and size of the screens attached to the display 89 90 @param nScreen 91 The screen number to be queried 92 93 @returns position: (0,0) in case of IsMultiscreen() == true 94 else position relative to whole display 95 size: size of the screen 96 */ 97 virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ) = 0; 98 /* Gets position and size of the work area of a screen attached to the display 99 100 @param nScreen 101 The screen number to be queried 102 103 @returns position and size relative to the scree 104 */ 105 virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) = 0; 106 /* Gets the name of a screen 107 108 @param nScreen 109 The screen number to be queried 110 111 @returns the name of the screen 112 */ 113 virtual rtl::OUString GetScreenName( unsigned int nScreen ) = 0; 114 115 /* Shows a native message box with the specified title, message and button 116 combination. 117 118 @param rTitle 119 The title to be shown by the dialog box. 120 121 @param rMessage 122 The message to be shown by the dialog box. 123 124 @param nButtonCombination 125 Specify which button combination the message box should display. 126 See button combinations above. 127 128 @param nDefaultButton 129 Specifies which button has the focus initially. 130 See button identifiers above. 131 The effect of specifying a button that doesn't belong 132 to the specified button combination is undefined. 133 134 @returns the identifier of the button that was pressed by the user. 135 See button identifier above. If the function fails the 136 return value is 0. 137 */ 138 virtual int ShowNativeMessageBox( const String& rTitle, 139 const String& rMessage, 140 int nButtonCombination, 141 int nDefaultButton) = 0; 142 }; 143 144 SalSystem* ImplGetSalSystem(); 145 146 #endif // _SV_SALSYS_HXX 147