Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef _SV_SALSYS_HXX
21 : #define _SV_SALSYS_HXX
22 :
23 : #include <tools/gen.hxx>
24 : #include <vcl/dllapi.h>
25 :
26 : namespace rtl
27 : {
28 : class OUString;
29 : }
30 :
31 : /* Button combinations for ShowNativeMessageBox
32 : */
33 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK = 0;
34 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL = 1;
35 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE = 2;
36 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL = 3;
37 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO = 4;
38 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL = 5;
39 :
40 : /* Button identifier for ShowNativeMessageBox
41 : */
42 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK = 1;
43 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL = 2;
44 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT = 3;
45 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY = 4;
46 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE = 5;
47 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES = 6;
48 : const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO = 7;
49 :
50 :
51 : // -------------
52 : // - SalSystem -
53 : // -------------
54 : class VCL_PLUGIN_PUBLIC SalSystem
55 : {
56 : public:
57 3 : SalSystem() {}
58 : virtual ~SalSystem();
59 :
60 : // get info about the display
61 :
62 : /* Gets the number of active screens attached to the display
63 :
64 : @returns the number of active screens
65 : */
66 : virtual unsigned int GetDisplayScreenCount() = 0;
67 : /* Queries whether multiple screens are part of one bigger display
68 :
69 : @returns true if screens form one big display
70 : false if screens are distinct and windows cannot
71 : be moved between, or span multiple screens
72 : */
73 284 : virtual bool IsUnifiedDisplay() { return true; }
74 : /* Queries the default screen number. The default screen is the
75 : screen on which windows will appear if no special positioning
76 : is made.
77 :
78 : @returns the default screen number
79 : */
80 0 : virtual unsigned int GetDisplayBuiltInScreen() { return 0; }
81 : /* Gets relative position and size of the screens attached to the display
82 :
83 : @param nScreen
84 : The screen number to be queried
85 :
86 : @returns position: (0,0) in case of IsMultiscreen() == true
87 : else position relative to whole display
88 : size: size of the screen
89 : */
90 : virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ) = 0;
91 : /* Gets position and size of the work area of a screen attached to the display
92 :
93 : @param nScreen
94 : The screen number to be queried
95 :
96 : @returns position and size relative to the scree
97 : */
98 : virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ) = 0;
99 : /* Gets the name of a screen
100 :
101 : @param nScreen
102 : The screen number to be queried
103 :
104 : @returns the name of the screen
105 : */
106 : virtual rtl::OUString GetDisplayScreenName( unsigned int nScreen ) = 0;
107 :
108 : /* Shows a native message box with the specified title, message and button
109 : combination.
110 :
111 : @param rTitle
112 : The title to be shown by the dialog box.
113 :
114 : @param rMessage
115 : The message to be shown by the dialog box.
116 :
117 : @param nButtonCombination
118 : Specify which button combination the message box should display.
119 : See button combinations above.
120 :
121 : @param nDefaultButton
122 : Specifies which button has the focus initially.
123 : See button identifiers above.
124 : The effect of specifying a button that doesn't belong
125 : to the specified button combination is undefined.
126 :
127 : @param bUseResources
128 : If false, assume initialization of the application failed early and do
129 : not try to access any resources.
130 :
131 : @returns the identifier of the button that was pressed by the user.
132 : See button identifier above. If the function fails the
133 : return value is 0.
134 : */
135 : virtual int ShowNativeMessageBox( const rtl::OUString& rTitle,
136 : const rtl::OUString& rMessage,
137 : int nButtonCombination,
138 : int nDefaultButton,
139 : bool bUseResources ) = 0;
140 : };
141 :
142 : SalSystem* ImplGetSalSystem();
143 :
144 : #endif // _SV_SALSYS_HXX
145 :
146 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|