Bug 1861709 replace AudioCallbackDriver::ThreadRunning() assertions that mean to...
[gecko.git] / widget / windows / TaskbarWindowPreview.h
blob97c074197c688cd6d002f34453feb83a1a8c46d9
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_TaskbarWindowPreview_h__
9 #define __mozilla_widget_TaskbarWindowPreview_h__
11 #include "nsITaskbarWindowPreview.h"
12 #include "nsITaskbarProgress.h"
13 #include "nsITaskbarOverlayIconController.h"
14 #include "TaskbarPreview.h"
15 #include "nsWeakReference.h"
17 namespace mozilla {
18 namespace widget {
20 class TaskbarPreviewButton;
21 class TaskbarWindowPreview : public TaskbarPreview,
22 public nsITaskbarWindowPreview,
23 public nsITaskbarProgress,
24 public nsITaskbarOverlayIconController,
25 public nsSupportsWeakReference {
26 virtual ~TaskbarWindowPreview();
28 public:
29 TaskbarWindowPreview(ITaskbarList4* aTaskbar,
30 nsITaskbarPreviewController* aController, HWND aHWND,
31 nsIDocShell* aShell);
32 virtual nsresult Init() override;
34 NS_DECL_ISUPPORTS
35 NS_DECL_NSITASKBARWINDOWPREVIEW
36 NS_DECL_NSITASKBARPROGRESS
37 NS_DECL_NSITASKBAROVERLAYICONCONTROLLER
38 NS_FORWARD_NSITASKBARPREVIEW(TaskbarPreview::)
40 virtual LRESULT WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam) override;
42 private:
43 virtual nsresult ShowActive(bool active) override;
44 virtual HWND& PreviewWindow() override;
46 virtual nsresult UpdateTaskbarProperties() override;
47 virtual nsresult Enable() override;
48 virtual nsresult Disable() override;
49 virtual void DetachFromNSWindow() override;
50 nsresult UpdateButton(uint32_t index);
51 nsresult UpdateButtons();
53 // Is custom drawing enabled?
54 bool mCustomDrawing;
55 // Have we made any buttons?
56 bool mHaveButtons;
57 // Windows button format
58 THUMBBUTTON mThumbButtons[nsITaskbarWindowPreview::NUM_TOOLBAR_BUTTONS];
59 // Pointers to our button class (cached instances)
60 nsWeakPtr mWeakButtons[nsITaskbarWindowPreview::NUM_TOOLBAR_BUTTONS];
62 // Called to update ITaskbarList4 dependent properties
63 nsresult UpdateTaskbarProgress();
64 nsresult UpdateOverlayIcon();
66 // The taskbar progress
67 TBPFLAG mState;
68 ULONGLONG mCurrentValue;
69 ULONGLONG mMaxValue;
71 // Taskbar overlay icon
72 HICON mOverlayIcon;
73 nsString mIconDescription;
75 // WindowHook procedure for hooking mWnd for taskbar progress and icon stuff
76 static bool TaskbarWindowHook(void* aContext, HWND hWnd, UINT nMsg,
77 WPARAM wParam, LPARAM lParam, LRESULT* aResult);
79 friend class TaskbarPreviewButton;
82 } // namespace widget
83 } // namespace mozilla
85 #endif /* __mozilla_widget_TaskbarWindowPreview_h__ */