1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_VCL_INC_SALSYS_HXX
21 #define INCLUDED_VCL_INC_SALSYS_HXX
23 #include <tools/gen.hxx>
24 #include <vcl/dllapi.h>
25 #include <rtl/ustring.hxx>
27 // Button combinations for ShowNativeMessageBox
28 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK
= 0;
29 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL
= 1;
30 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE
= 2;
31 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL
= 3;
32 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO
= 4;
33 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL
= 5;
35 // Button identifier for ShowNativeMessageBox
36 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK
= 1;
37 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL
= 2;
38 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT
= 3;
39 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY
= 4;
40 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE
= 5;
41 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES
= 6;
42 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO
= 7;
44 class VCL_PLUGIN_PUBLIC SalSystem
50 // get info about the display
52 /* Gets the number of active screens attached to the display
54 @returns the number of active screens
56 virtual unsigned int GetDisplayScreenCount() = 0;
57 /* Queries whether multiple screens are part of one bigger display
59 @returns true if screens form one big display
60 false if screens are distinct and windows cannot
61 be moved between, or span multiple screens
63 virtual bool IsUnifiedDisplay() { return true; }
64 /* Queries the default screen number. The default screen is the
65 screen on which windows will appear if no special positioning
68 @returns the default screen number
70 virtual unsigned int GetDisplayBuiltInScreen() { return 0; }
71 /* Gets relative position and size of the screens attached to the display
74 The screen number to be queried
76 @returns position: (0,0) in case of IsMultiscreen() == true
77 else position relative to whole display
78 size: size of the screen
80 virtual Rectangle
GetDisplayScreenPosSizePixel( unsigned int nScreen
) = 0;
81 /* Gets the name of a screen
84 The screen number to be queried
86 @returns the name of the screen
88 virtual OUString
GetDisplayScreenName( unsigned int nScreen
) = 0;
90 /* Shows a native message box with the specified title, message and button
94 The title to be shown by the dialog box.
97 The message to be shown by the dialog box.
99 @param nButtonCombination
100 Specify which button combination the message box should display.
101 See button combinations above.
103 @param nDefaultButton
104 Specifies which button has the focus initially.
105 See button identifiers above.
106 The effect of specifying a button that doesn't belong
107 to the specified button combination is undefined.
110 If false, assume initialization of the application failed early and do
111 not try to access any resources.
113 @returns the identifier of the button that was pressed by the user.
114 See button identifier above. If the function fails the
117 virtual int ShowNativeMessageBox( const OUString
& rTitle
,
118 const OUString
& rMessage
,
119 int nButtonCombination
,
121 bool bUseResources
) = 0;
125 SalSystem
* ImplGetSalSystem();
127 #endif // INCLUDED_VCL_INC_SALSYS_HXX
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */