xref: /aoo41x/main/vcl/inc/win/salsys.h (revision 79aad27f)
1*2123d757SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2123d757SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2123d757SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2123d757SAndrew Rist  * distributed with this work for additional information
6*2123d757SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2123d757SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2123d757SAndrew Rist  * "License"); you may not use this file except in compliance
9*2123d757SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*2123d757SAndrew Rist  *
11*2123d757SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2123d757SAndrew Rist  *
13*2123d757SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2123d757SAndrew Rist  * software distributed under the License is distributed on an
15*2123d757SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2123d757SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2123d757SAndrew Rist  * specific language governing permissions and limitations
18*2123d757SAndrew Rist  * under the License.
19*2123d757SAndrew Rist  *
20*2123d757SAndrew Rist  *************************************************************/
21*2123d757SAndrew Rist 
22*2123d757SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SV_SALSYS_H
25cdf0e10cSrcweir #define _SV_SALSYS_H
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <salsys.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <vector>
30cdf0e10cSrcweir #include <map>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir class WinSalSystem : public SalSystem
33cdf0e10cSrcweir {
34cdf0e10cSrcweir     public:
35cdf0e10cSrcweir     struct DisplayMonitor
36cdf0e10cSrcweir     {
37cdf0e10cSrcweir         rtl::OUString        m_aName;
38cdf0e10cSrcweir         rtl::OUString        m_aDeviceName;
39cdf0e10cSrcweir         Rectangle            m_aArea;
40cdf0e10cSrcweir         Rectangle            m_aWorkArea;
41cdf0e10cSrcweir         sal_Int32            m_nStateFlags;
42cdf0e10cSrcweir 
DisplayMonitorWinSalSystem::DisplayMonitor43cdf0e10cSrcweir         DisplayMonitor() : m_nStateFlags( 0 ) {}
DisplayMonitorWinSalSystem::DisplayMonitor44cdf0e10cSrcweir         DisplayMonitor( const rtl::OUString& rName,
45cdf0e10cSrcweir                         const rtl::OUString& rDevName,
46cdf0e10cSrcweir                         const Rectangle& rArea,
47cdf0e10cSrcweir                         const Rectangle& rWorkArea,
48cdf0e10cSrcweir                         DWORD nStateFlags )
49cdf0e10cSrcweir                         : m_aName( rName ),
50cdf0e10cSrcweir                           m_aDeviceName( rDevName ),
51cdf0e10cSrcweir                           m_aArea( rArea ),
52cdf0e10cSrcweir                           m_aWorkArea( rWorkArea ),
53cdf0e10cSrcweir                           m_nStateFlags( nStateFlags )
54cdf0e10cSrcweir         {
55cdf0e10cSrcweir         }
~DisplayMonitorWinSalSystem::DisplayMonitor56cdf0e10cSrcweir         ~DisplayMonitor() {}
57cdf0e10cSrcweir     };
58cdf0e10cSrcweir     private:
59cdf0e10cSrcweir     std::vector<DisplayMonitor>             m_aMonitors;
60cdf0e10cSrcweir     std::map<rtl::OUString, unsigned int>   m_aDeviceNameToMonitor;
61cdf0e10cSrcweir     unsigned int                            m_nPrimary;
62cdf0e10cSrcweir public:
WinSalSystem()63cdf0e10cSrcweir     WinSalSystem() : m_nPrimary( 0 ) {}
64cdf0e10cSrcweir     virtual ~WinSalSystem();
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     virtual unsigned int GetDisplayScreenCount();
67cdf0e10cSrcweir     virtual bool IsMultiDisplay();
68cdf0e10cSrcweir     virtual unsigned int GetDefaultDisplayNumber();
69cdf0e10cSrcweir     virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
70cdf0e10cSrcweir     virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen );
71cdf0e10cSrcweir     virtual rtl::OUString GetScreenName( unsigned int nScreen );
72cdf0e10cSrcweir     virtual int ShowNativeMessageBox( const String& rTitle,
73cdf0e10cSrcweir                                       const String& rMessage,
74cdf0e10cSrcweir                                       int nButtonCombination,
75cdf0e10cSrcweir                                       int nDefaultButton);
76cdf0e10cSrcweir     bool initMonitors();
77cdf0e10cSrcweir     // discards monitorinfo; used by WM_DISPLAYCHANGED handler
78cdf0e10cSrcweir     void clearMonitors();
getMonitors()79cdf0e10cSrcweir     const std::vector<DisplayMonitor>& getMonitors()
80cdf0e10cSrcweir     { initMonitors(); return m_aMonitors;}
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	sal_Bool handleMonitorCallback( sal_IntPtr /*HMONITOR*/,
83cdf0e10cSrcweir                                 sal_IntPtr /*HDC*/,
84cdf0e10cSrcweir                                 sal_IntPtr /*LPRECT*/ );
85cdf0e10cSrcweir };
86cdf0e10cSrcweir 
87cdf0e10cSrcweir #endif // _SV_SALSYS_H
88cdf0e10cSrcweir 
89