xref: /trunk/main/vcl/inc/salsys.hxx (revision ebfcd9af)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SV_SALSYS_HXX
25 #define _SV_SALSYS_HXX
26 
27 #include <tools/string.hxx>
28 #include <tools/gen.hxx>
29 #include <vcl/dllapi.h>
30 
31 
32 /* Button combinations for ShowNativeMessageBox
33 */
34 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK                 = 0;
35 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_OK_CANCEL          = 1;
36 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_ABORT_RETRY_IGNORE = 2;
37 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO_CANCEL      = 3;
38 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_YES_NO             = 4;
39 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTNCOMBI_RETRY_CANCEL       = 5;
40 
41 /* Button identifier for ShowNativeMessageBox
42 */
43 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_OK     = 1;
44 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_CANCEL = 2;
45 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_ABORT  = 3;
46 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_RETRY  = 4;
47 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_IGNORE = 5;
48 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_YES    = 6;
49 const int SALSYSTEM_SHOWNATIVEMSGBOX_BTN_NO     = 7;
50 
51 
52 
53 // -------------
54 // - SalSystem -
55 // -------------
56 
57 class VCL_PLUGIN_PUBLIC SalSystem
58 {
59 public:
SalSystem()60 			SalSystem() {}
61     virtual ~SalSystem();
62 
63     // get info about the display
64 
65 	/*  Gets the number of active screens attached to the display
66 
67         @returns the number of active screens
68     */
69     virtual unsigned int GetDisplayScreenCount() = 0;
70     /*  Queries whether multiple screens are truly separate
71 
72         @returns true if screens are distinct and windows cannot
73                   be moved between them or span multiple of them
74                  false if screens form up one big display
75     */
76     virtual bool IsMultiDisplay() = 0;
77     /*  Queries the default screen number. The default screen is the
78         screen on which windows will appear if no special positioning
79         is made.
80 
81         @returns the default screen number
82     */
83     virtual unsigned int GetDefaultDisplayNumber() = 0;
84     /*  Gets relative position and size of the screens attached to the display
85 
86         @param nScreen
87         The screen number to be queried
88 
89         @returns position: (0,0) in case of IsMultiscreen() == true
90                            else position relative to whole display
91                  size: size of the screen
92     */
93     virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ) = 0;
94     /*  Gets position and size of the work area of a screen attached to the display
95 
96         @param nScreen
97         The screen number to be queried
98 
99         @returns position and size relative to the scree
100     */
101     virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ) = 0;
102 	/* Gets the name of a screen
103 
104        @param nScreen
105        The screen number to be queried
106 
107        @returns the name of the screen
108 	*/
109 	virtual rtl::OUString GetScreenName( unsigned int nScreen ) = 0;
110 
111 	/*  Shows a native message box with the specified title, message and button
112         combination.
113 
114         @param  rTitle
115         The title to be shown by the dialog box.
116 
117         @param  rMessage
118         The message to be shown by the dialog box.
119 
120         @param  nButtonCombination
121         Specify which button combination the message box should display.
122         See button combinations above.
123 
124         @param  nDefaultButton
125         Specifies which button has the focus initially.
126         See button identifiers above.
127         The effect of specifying a button that doesn't belong
128         to the specified button combination is undefined.
129 
130         @returns the identifier of the button that was pressed by the user.
131         See button identifier above. If the function fails the
132         return value is 0.
133     */
134     virtual int ShowNativeMessageBox( const String& rTitle,
135                                       const String& rMessage,
136                                       int nButtonCombination,
137                                       int nDefaultButton) = 0;
138 };
139 
140 SalSystem* ImplGetSalSystem();
141 
142 #endif // _SV_SALSYS_HXX
143