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_H 25 #define _SV_SALSYS_H 26 27 #include <salsys.hxx> 28 29 #include <vector> 30 #include <map> 31 32 class WinSalSystem : public SalSystem 33 { 34 public: 35 struct DisplayMonitor 36 { 37 rtl::OUString m_aName; 38 rtl::OUString m_aDeviceName; 39 Rectangle m_aArea; 40 Rectangle m_aWorkArea; 41 sal_Int32 m_nStateFlags; 42 DisplayMonitorWinSalSystem::DisplayMonitor43 DisplayMonitor() : m_nStateFlags( 0 ) {} DisplayMonitorWinSalSystem::DisplayMonitor44 DisplayMonitor( const rtl::OUString& rName, 45 const rtl::OUString& rDevName, 46 const Rectangle& rArea, 47 const Rectangle& rWorkArea, 48 DWORD nStateFlags ) 49 : m_aName( rName ), 50 m_aDeviceName( rDevName ), 51 m_aArea( rArea ), 52 m_aWorkArea( rWorkArea ), 53 m_nStateFlags( nStateFlags ) 54 { 55 } ~DisplayMonitorWinSalSystem::DisplayMonitor56 ~DisplayMonitor() {} 57 }; 58 private: 59 std::vector<DisplayMonitor> m_aMonitors; 60 std::map<rtl::OUString, unsigned int> m_aDeviceNameToMonitor; 61 unsigned int m_nPrimary; 62 public: WinSalSystem()63 WinSalSystem() : m_nPrimary( 0 ) {} 64 virtual ~WinSalSystem(); 65 66 virtual unsigned int GetDisplayScreenCount(); 67 virtual bool IsMultiDisplay(); 68 virtual unsigned int GetDefaultDisplayNumber(); 69 virtual Rectangle GetDisplayScreenPosSizePixel( unsigned int nScreen ); 70 virtual Rectangle GetDisplayWorkAreaPosSizePixel( unsigned int nScreen ); 71 virtual rtl::OUString GetScreenName( unsigned int nScreen ); 72 virtual int ShowNativeMessageBox( const String& rTitle, 73 const String& rMessage, 74 int nButtonCombination, 75 int nDefaultButton); 76 bool initMonitors(); 77 // discards monitorinfo; used by WM_DISPLAYCHANGED handler 78 void clearMonitors(); getMonitors()79 const std::vector<DisplayMonitor>& getMonitors() 80 { initMonitors(); return m_aMonitors;} 81 82 sal_Bool handleMonitorCallback( sal_IntPtr /*HMONITOR*/, 83 sal_IntPtr /*HDC*/, 84 sal_IntPtr /*LPRECT*/ ); 85 }; 86 87 #endif // _SV_SALSYS_H 88 89