Bug 1861709 replace AudioCallbackDriver::ThreadRunning() assertions that mean to...
[gecko.git] / widget / windows / TaskbarTabPreview.h
blob9a15760557e909d0326c2ab66f53a23d27211a03
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"
14 namespace mozilla {
15 namespace widget {
17 class TaskbarTabPreview : public nsITaskbarTabPreview, public TaskbarPreview {
18 virtual ~TaskbarTabPreview();
20 public:
21 TaskbarTabPreview(ITaskbarList4* aTaskbar,
22 nsITaskbarPreviewController* aController, HWND aHWND,
23 nsIDocShell* aShell);
24 virtual nsresult Init() override;
26 NS_DECL_ISUPPORTS
27 NS_DECL_NSITASKBARTABPREVIEW
28 NS_FORWARD_NSITASKBARPREVIEW(TaskbarPreview::)
30 private:
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,
35 LPARAM lParam);
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
48 // previews.
49 void UpdateProxyWindowStyle();
51 nsresult UpdateTitle();
52 nsresult UpdateIcon();
53 nsresult UpdateNext();
55 // Handle to the toplevel proxy window
56 HWND mProxyWindow;
57 nsString mTitle;
58 nsCOMPtr<imgIContainer> mIconImage;
59 // Cached Windows icon of mIconImage
60 HICON mIcon;
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
64 bool mRegistered;
67 } // namespace widget
68 } // namespace mozilla
70 #endif /* __mozilla_widget_TaskbarTabPreview_h__ */