1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_VCL_SYSWIN_HXX
21 #define INCLUDED_VCL_SYSWIN_HXX
23 #include <tools/solar.h>
24 #include <vcl/dllapi.h>
25 #include <vcl/window.hxx>
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
52 // - WindowStateData -
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
79 sal_uInt32 mnValidMask
;
83 unsigned int mnHeight
;
86 unsigned int mnMaximizedWidth
;
87 unsigned int mnMaximizedHeight
;
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
; }
121 // - SystemWindow-Types -
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)
136 class VCL_DLLPUBLIC SystemWindow
: public Window
138 friend class WorkWindow
;
144 Size maRollUpOutSize
;
152 sal_uInt16 mnMenuBarMode
;
154 ImplData
* mpImplData
;
157 using Window::ImplIsInTaskPaneList
;
158 SAL_DLLPRIVATE
bool ImplIsInTaskPaneList( Window
* pWin
);
161 // Default construction is forbidden and not implemented.
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
);
171 // Single argument ctors shall be explicit.
172 explicit SystemWindow( WindowType nType
);
174 void SetWindowStateData( const WindowStateData
& rData
);
177 virtual ~SystemWindow();
178 virtual bool Notify( NotifyEvent
& rNEvt
) SAL_OVERRIDE
;
179 virtual bool PreNotify( NotifyEvent
& rNEvt
) SAL_OVERRIDE
;
181 virtual bool Close();
182 virtual void TitleButtonClick( sal_uInt16 nButton
);
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( bool bSave
= true );
194 bool IsSaveBackgroundEnabled() const;
196 void ShowTitleButton( sal_uInt16 nButton
, bool bVisible
= true );
197 bool IsTitleButtonVisible( sal_uInt16 nButton
) const;
199 void SetPin( bool bPin
);
200 bool IsPinned() const { return mbPinned
; }
204 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::GetDisplayScreenName</code>
232 and of course <code>SystemWindow::SetScreenNumber</code>
235 In case the window is positioned on multiple screens the
236 screen number returned will be of the screen containing the
237 upper left pixel of the frame area (that is of the client
238 area on system decorated windows, or the frame area of
239 undecorated resp. owner decorated windows.
241 @returns the screen number
243 @see SystemWindow::SetScreenNumber
245 unsigned int GetScreenNumber() const;
247 Move the Window to a new screen. The same rules for
248 positioning apply as in <code>SystemWindow::GetScreenNumber</code>
250 The Display Screen number is counted the same way that
251 <code>Application::GetScreenPosSizePixel</code>,
252 <code>Application::GetDisplayScreenName</code>
253 and of course <code>SystemWindow::GetScreenNumber</code>
258 void SetScreenNumber( unsigned int nNewScreen
);
260 void SetApplicationID( const OUString
&rApplicationID
);
262 void SetCloseHdl(const Link
& rLink
);
263 const Link
& GetCloseHdl() const;
266 #endif // INCLUDED_VCL_SYSWIN_HXX
268 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */