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