xref: /trunk/main/vcl/inc/win/salsys.h (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SV_SALSYS_H
29 #define _SV_SALSYS_H
30 
31 #include <salsys.hxx>
32 
33 #include <vector>
34 #include <map>
35 
36 class WinSalSystem : public SalSystem
37 {
38     public:
39     struct DisplayMonitor
40     {
41         rtl::OUString        m_aName;
42         rtl::OUString        m_aDeviceName;
43         Rectangle            m_aArea;
44         Rectangle            m_aWorkArea;
45         sal_Int32            m_nStateFlags;
46 
47         DisplayMonitor() : m_nStateFlags( 0 ) {}
48         DisplayMonitor( const rtl::OUString& rName,
49                         const rtl::OUString& rDevName,
50                         const Rectangle& rArea,
51                         const Rectangle& rWorkArea,
52                         DWORD nStateFlags )
53                         : m_aName( rName ),
54                           m_aDeviceName( rDevName ),
55                           m_aArea( rArea ),
56                           m_aWorkArea( rWorkArea ),
57                           m_nStateFlags( nStateFlags )
58         {
59         }
60         ~DisplayMonitor() {}
61     };
62     private:
63     std::vector<DisplayMonitor>             m_aMonitors;
64     std::map<rtl::OUString, unsigned int>   m_aDeviceNameToMonitor;
65     unsigned int                            m_nPrimary;
66 public:
67     WinSalSystem() : m_nPrimary( 0 ) {}
68     virtual ~WinSalSystem();
69 
70     virtual unsigned int GetDisplayScreenCount();
71     virtual bool IsMultiDisplay();
72     virtual unsigned int GetDefaultDisplayNumber();
73     virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen );
74     virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen );
75     virtual rtl::OUString GetScreenName( unsigned int nScreen );
76     virtual int ShowNativeMessageBox( const String& rTitle,
77                                       const String& rMessage,
78                                       int nButtonCombination,
79                                       int nDefaultButton);
80     bool initMonitors();
81     // discards monitorinfo; used by WM_DISPLAYCHANGED handler
82     void clearMonitors();
83     const std::vector<DisplayMonitor>& getMonitors()
84     { initMonitors(); return m_aMonitors;}
85 
86 	sal_Bool handleMonitorCallback( sal_IntPtr /*HMONITOR*/,
87                                 sal_IntPtr /*HDC*/,
88                                 sal_IntPtr /*LPRECT*/ );
89 };
90 
91 #endif // _SV_SALSYS_H
92 
93