1 /* vim: se cin sw=2 ts=2 et : */
2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef __mozilla_widget_TaskbarTabPreview_h__
9 #define __mozilla_widget_TaskbarTabPreview_h__
11 #include "nsITaskbarTabPreview.h"
12 #include "TaskbarPreview.h"
17 class TaskbarTabPreview
: public nsITaskbarTabPreview
, public TaskbarPreview
{
18 virtual ~TaskbarTabPreview();
21 TaskbarTabPreview(ITaskbarList4
* aTaskbar
,
22 nsITaskbarPreviewController
* aController
, HWND aHWND
,
24 virtual nsresult
Init() override
;
27 NS_DECL_NSITASKBARTABPREVIEW
28 NS_FORWARD_NSITASKBARPREVIEW(TaskbarPreview::)
31 virtual nsresult
ShowActive(bool active
);
32 virtual HWND
& PreviewWindow();
33 virtual LRESULT
WndProc(UINT nMsg
, WPARAM wParam
, LPARAM lParam
);
34 static LRESULT CALLBACK
GlobalWndProc(HWND hWnd
, UINT nMsg
, WPARAM wParam
,
37 virtual nsresult
UpdateTaskbarProperties();
38 virtual nsresult
Enable();
39 virtual nsresult
Disable();
40 virtual void DetachFromNSWindow();
42 // WindowHook procedure for hooking mWnd
43 static bool MainWindowHook(void* aContext
, HWND hWnd
, UINT nMsg
,
44 WPARAM wParam
, LPARAM lParam
, LRESULT
* aResult
);
46 // Bug 520807 - we need to update the proxy window style based on the main
47 // window's style to workaround a bug with the way the DWM displays the
49 void UpdateProxyWindowStyle();
51 nsresult
UpdateTitle();
52 nsresult
UpdateIcon();
53 nsresult
UpdateNext();
55 // Handle to the toplevel proxy window
58 nsCOMPtr
<imgIContainer
> mIconImage
;
59 // Cached Windows icon of mIconImage
61 // Preview that follows this preview in the taskbar (left-to-right order)
62 nsCOMPtr
<nsITaskbarTabPreview
> mNext
;
63 // True if this preview has been registered with the taskbar
68 } // namespace mozilla
70 #endif /* __mozilla_widget_TaskbarTabPreview_h__ */