fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / vcl / syswin.hxx
blob07661431a94afb2dcb5f093ddde8b48d31902d50
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _SV_SYSWIN_HXX
21 #define _SV_SYSWIN_HXX
23 #include <tools/solar.h>
24 #include <vcl/dllapi.h>
25 #include <vcl/window.hxx>
27 class ModalDialog;
28 class MenuBar;
29 class TaskPaneList;
31 // --------------
32 // - Icon-Types -
33 // --------------
35 #define ICON_LO_DEFAULT 1
36 #define ICON_TEXT_DOCUMENT 2
37 #define ICON_TEXT_TEMPLATE 3
38 #define ICON_SPREADSHEET_DOCUMENT 4
39 #define ICON_SPREADSHEET_TEMPLATE 5
40 #define ICON_DRAWING_DOCUMENT 6
41 #define ICON_DRAWING_TEMPLATE 7
42 #define ICON_PRESENTATION_DOCUMENT 8
43 #define ICON_PRESENTATION_TEMPLATE 9
44 #define ICON_MASTER_DOCUMENT 10
45 #define ICON_TEMPLATE 11
46 #define ICON_DATABASE_DOCUMENT 12
47 #define ICON_MATH_DOCUMENT 13
48 #define ICON_MACROLIBRARY 1
49 #define ICON_SETUP 500
51 // -------------------
52 // - WindowStateData -
53 // -------------------
55 #define WINDOWSTATE_MASK_X ((sal_uLong)0x00000001)
56 #define WINDOWSTATE_MASK_Y ((sal_uLong)0x00000002)
57 #define WINDOWSTATE_MASK_WIDTH ((sal_uLong)0x00000004)
58 #define WINDOWSTATE_MASK_HEIGHT ((sal_uLong)0x00000008)
59 #define WINDOWSTATE_MASK_STATE ((sal_uLong)0x00000010)
60 #define WINDOWSTATE_MASK_MINIMIZED ((sal_uLong)0x00000020)
61 #define WINDOWSTATE_MASK_MAXIMIZED_X ((sal_uLong)0x00000100)
62 #define WINDOWSTATE_MASK_MAXIMIZED_Y ((sal_uLong)0x00000200)
63 #define WINDOWSTATE_MASK_MAXIMIZED_WIDTH ((sal_uLong)0x00000400)
64 #define WINDOWSTATE_MASK_MAXIMIZED_HEIGHT ((sal_uLong)0x00000800)
65 #define WINDOWSTATE_MASK_POS (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y)
66 #define WINDOWSTATE_MASK_ALL (WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT | WINDOWSTATE_MASK_MAXIMIZED_X | WINDOWSTATE_MASK_MAXIMIZED_Y | WINDOWSTATE_MASK_MAXIMIZED_WIDTH | WINDOWSTATE_MASK_MAXIMIZED_HEIGHT | WINDOWSTATE_MASK_STATE | WINDOWSTATE_MASK_MINIMIZED)
68 #define WINDOWSTATE_STATE_NORMAL ((sal_uLong)0x00000001)
69 #define WINDOWSTATE_STATE_MINIMIZED ((sal_uLong)0x00000002)
70 #define WINDOWSTATE_STATE_MAXIMIZED ((sal_uLong)0x00000004)
71 #define WINDOWSTATE_STATE_ROLLUP ((sal_uLong)0x00000008)
72 #define WINDOWSTATE_STATE_MAXIMIZED_HORZ ((sal_uLong)0x00000010)
73 #define WINDOWSTATE_STATE_MAXIMIZED_VERT ((sal_uLong)0x00000020)
74 #define WINDOWSTATE_STATE_SYSTEMMASK ((sal_uLong)0x0000FFFF)
76 class VCL_PLUGIN_PUBLIC WindowStateData
78 private:
79 sal_uInt32 mnValidMask;
80 int mnX;
81 int mnY;
82 unsigned int mnWidth;
83 unsigned int mnHeight;
84 int mnMaximizedX;
85 int mnMaximizedY;
86 unsigned int mnMaximizedWidth;
87 unsigned int mnMaximizedHeight;
88 sal_uInt32 mnState;
90 public:
91 WindowStateData()
93 mnValidMask = mnX = mnY = mnWidth = mnHeight = mnState = 0;
94 mnMaximizedX = mnMaximizedY = mnMaximizedWidth = mnMaximizedHeight = 0;
97 void SetMask( sal_uLong nValidMask ) { mnValidMask = nValidMask; }
98 sal_uInt32 GetMask() const { return mnValidMask; }
100 void SetX( int nX ) { mnX = nX; }
101 int GetX() const { return mnX; }
102 void SetY( int nY ) { mnY = nY; }
103 int GetY() const { return mnY; }
104 void SetWidth( unsigned int nWidth ) { mnWidth = nWidth; }
105 unsigned int GetWidth() const { return mnWidth; }
106 void SetHeight( unsigned int nHeight ) { mnHeight = nHeight; }
107 unsigned int GetHeight() const { return mnHeight; }
108 void SetState( sal_uInt32 nState ) { mnState = nState; }
109 sal_uInt32 GetState() const { return mnState; }
110 void SetMaximizedX( int nRX ) { mnMaximizedX = nRX; }
111 int GetMaximizedX() const { return mnMaximizedX; }
112 void SetMaximizedY( int nRY ) { mnMaximizedY = nRY; }
113 int GetMaximizedY() const { return mnMaximizedY; }
114 void SetMaximizedWidth( unsigned int nRWidth ) { mnMaximizedWidth = nRWidth; }
115 unsigned int GetMaximizedWidth() const { return mnMaximizedWidth; }
116 void SetMaximizedHeight( unsigned int nRHeight ) { mnMaximizedHeight = nRHeight; }
117 unsigned int GetMaximizedHeight() const { return mnMaximizedHeight; }
120 // ----------------------
121 // - SystemWindow-Types -
122 // ----------------------
124 #define MENUBAR_MODE_NORMAL ((sal_uInt16)0)
125 #define MENUBAR_MODE_HIDE ((sal_uInt16)1)
127 #define TITLE_BUTTON_DOCKING ((sal_uInt16)1)
128 #define TITLE_BUTTON_HIDE ((sal_uInt16)2)
129 #define TITLE_BUTTON_MENU ((sal_uInt16)4)
131 // ----------------
132 // - SystemWindow -
133 // ----------------
136 class VCL_DLLPUBLIC SystemWindow : public Window
138 friend class WorkWindow;
139 class ImplData;
141 private:
142 MenuBar* mpMenuBar;
143 Size maOrgSize;
144 Size maRollUpOutSize;
145 Size maMinOutSize;
146 sal_Bool mbPined;
147 sal_Bool mbRollUp;
148 sal_Bool mbRollFunc;
149 sal_Bool mbDockBtn;
150 sal_Bool mbHideBtn;
151 sal_Bool mbSysChild;
152 sal_uInt16 mnMenuBarMode;
153 sal_uInt16 mnIcon;
154 ImplData* mpImplData;
156 public:
157 using Window::ImplIsInTaskPaneList;
158 SAL_DLLPRIVATE sal_Bool ImplIsInTaskPaneList( Window* pWin );
160 private:
161 // Default construction is forbidden and not implemented.
162 SystemWindow();
164 // Copy assignment is forbidden and not implemented.
165 SystemWindow (const SystemWindow &);
166 SystemWindow & operator= (const SystemWindow &);
168 SAL_DLLPRIVATE void ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, long i_nHeight, Window* i_pConfigureWin );
170 protected:
171 // Single argument ctors shall be explicit.
172 explicit SystemWindow( WindowType nType );
174 void SetWindowStateData( const WindowStateData& rData );
176 public:
177 ~SystemWindow();
178 virtual long Notify( NotifyEvent& rNEvt );
179 virtual long PreNotify( NotifyEvent& rNEvt );
181 virtual sal_Bool Close();
182 virtual void TitleButtonClick( sal_uInt16 nButton );
183 virtual void Pin();
184 virtual void Roll();
185 virtual void Resizing( Size& rSize );
187 void SetIcon( sal_uInt16 nIcon );
188 sal_uInt16 GetIcon() const { return mnIcon; }
189 // for systems like MacOSX which can display the URL a document is loaded from
190 // separately from the window title
191 void SetRepresentedURL( const OUString& );
193 void EnableSaveBackground( sal_Bool bSave = sal_True );
194 sal_Bool IsSaveBackgroundEnabled() const;
196 void ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible = sal_True );
197 sal_Bool IsTitleButtonVisible( sal_uInt16 nButton ) const;
199 void SetPin( sal_Bool bPin );
200 sal_Bool IsPined() const { return mbPined; }
202 void RollUp();
203 void RollDown();
204 sal_Bool IsRollUp() const { return mbRollUp; }
206 void SetRollUpOutputSizePixel( const Size& rSize ) { maRollUpOutSize = rSize; }
207 Size GetRollUpOutputSizePixel() const { return maRollUpOutSize; }
209 void SetMinOutputSizePixel( const Size& rSize );
210 const Size& GetMinOutputSizePixel() const { return maMinOutSize; }
211 void SetMaxOutputSizePixel( const Size& rSize );
212 const Size& GetMaxOutputSizePixel() const;
213 Size GetResizeOutputSizePixel() const;
215 void SetWindowState(const OString& rStr);
216 OString GetWindowState(sal_uLong nMask = WINDOWSTATE_MASK_ALL) const;
218 void SetMenuBar( MenuBar* pMenuBar );
219 MenuBar* GetMenuBar() const { return mpMenuBar; }
220 void SetMenuBarMode( sal_uInt16 nMode );
221 sal_uInt16 GetMenuBarMode() const { return mnMenuBarMode; }
223 TaskPaneList* GetTaskPaneList();
224 void GetWindowStateData( WindowStateData& rData ) const;
227 Returns the screen number the window is on
229 The Display Screen number is counted the same way that
230 <code>Application::GetScreenPosSizePixel</code>,
231 <code>Application::GetWorkAreaPosSizePixel</code>,
232 <code>Application::GetDisplayScreenName</code>
233 and of course <code>SystemWindow::SetScreenNumber</code>
234 are counted in.
236 In case the window is positioned on multiple screens the
237 screen number returned will be of the screen containing the
238 upper left pixel of the frame area (that is of the client
239 area on system decorated windows, or the frame area of
240 undecorated resp. owner decorated windows.
242 @returns the screen number
244 @see SystemWindow::SetScreenNumber
246 unsigned int GetScreenNumber() const;
248 Move the Window to a new screen. The same rules for
249 positioning apply as in <code>SystemWindow::GetScreenNumber</code>
251 The Display Screen number is counted the same way that
252 <code>Application::GetScreenPosSizePixel</code>,
253 <code>Application::GetWorkAreaPosSizePixel</code>,
254 <code>Application::GetDisplayScreenName</code>
255 and of course <code>SystemWindow::GetScreenNumber</code>
256 are counted in.
258 @see GetScreenNumber
260 void SetScreenNumber( unsigned int nNewScreen );
262 void SetApplicationID( const OUString &rApplicationID );
264 void SetCloseHdl(const Link& rLink);
265 const Link& GetCloseHdl() const;
268 #endif // _SV_SYSWIN_HXX
270 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */