|
1 /* vim: se cin sw=2 ts=2 et : */ |
|
2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
3 * |
|
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/. */ |
|
7 |
|
8 #ifndef __mozilla_widget_TaskbarTabPreview_h__ |
|
9 #define __mozilla_widget_TaskbarTabPreview_h__ |
|
10 |
|
11 #include "nsITaskbarTabPreview.h" |
|
12 #include "TaskbarPreview.h" |
|
13 |
|
14 namespace mozilla { |
|
15 namespace widget { |
|
16 |
|
17 class TaskbarTabPreview : public nsITaskbarTabPreview, |
|
18 public TaskbarPreview |
|
19 { |
|
20 public: |
|
21 TaskbarTabPreview(ITaskbarList4 *aTaskbar, nsITaskbarPreviewController *aController, HWND aHWND, nsIDocShell *aShell); |
|
22 virtual ~TaskbarTabPreview(); |
|
23 |
|
24 NS_DECL_ISUPPORTS |
|
25 NS_DECL_NSITASKBARTABPREVIEW |
|
26 NS_FORWARD_NSITASKBARPREVIEW(TaskbarPreview::) |
|
27 |
|
28 private: |
|
29 virtual nsresult ShowActive(bool active); |
|
30 virtual HWND &PreviewWindow(); |
|
31 virtual LRESULT WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam); |
|
32 static LRESULT CALLBACK GlobalWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam); |
|
33 |
|
34 virtual nsresult UpdateTaskbarProperties(); |
|
35 virtual nsresult Enable(); |
|
36 virtual nsresult Disable(); |
|
37 virtual void DetachFromNSWindow(); |
|
38 |
|
39 // WindowHook procedure for hooking mWnd |
|
40 static bool MainWindowHook(void *aContext, |
|
41 HWND hWnd, UINT nMsg, |
|
42 WPARAM wParam, LPARAM lParam, |
|
43 LRESULT *aResult); |
|
44 |
|
45 // Bug 520807 - we need to update the proxy window style based on the main |
|
46 // window's style to workaround a bug with the way the DWM displays the |
|
47 // previews. |
|
48 void UpdateProxyWindowStyle(); |
|
49 |
|
50 nsresult UpdateTitle(); |
|
51 nsresult UpdateIcon(); |
|
52 nsresult UpdateNext(); |
|
53 |
|
54 // Handle to the toplevel proxy window |
|
55 HWND mProxyWindow; |
|
56 nsString mTitle; |
|
57 nsCOMPtr<imgIContainer> mIconImage; |
|
58 // Cached Windows icon of mIconImage |
|
59 HICON mIcon; |
|
60 // Preview that follows this preview in the taskbar (left-to-right order) |
|
61 nsCOMPtr<nsITaskbarTabPreview> mNext; |
|
62 // True if this preview has been registered with the taskbar |
|
63 bool mRegistered; |
|
64 }; |
|
65 |
|
66 } // namespace widget |
|
67 } // namespace mozilla |
|
68 |
|
69 #endif /* __mozilla_widget_TaskbarTabPreview_h__ */ |