michael@0: /* vim: se cin sw=2 ts=2 et : */ michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef __mozilla_widget_TaskbarTabPreview_h__ michael@0: #define __mozilla_widget_TaskbarTabPreview_h__ michael@0: michael@0: #include "nsITaskbarTabPreview.h" michael@0: #include "TaskbarPreview.h" michael@0: michael@0: namespace mozilla { michael@0: namespace widget { michael@0: michael@0: class TaskbarTabPreview : public nsITaskbarTabPreview, michael@0: public TaskbarPreview michael@0: { michael@0: public: michael@0: TaskbarTabPreview(ITaskbarList4 *aTaskbar, nsITaskbarPreviewController *aController, HWND aHWND, nsIDocShell *aShell); michael@0: virtual ~TaskbarTabPreview(); michael@0: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSITASKBARTABPREVIEW michael@0: NS_FORWARD_NSITASKBARPREVIEW(TaskbarPreview::) michael@0: michael@0: private: michael@0: virtual nsresult ShowActive(bool active); michael@0: virtual HWND &PreviewWindow(); michael@0: virtual LRESULT WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam); michael@0: static LRESULT CALLBACK GlobalWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam); michael@0: michael@0: virtual nsresult UpdateTaskbarProperties(); michael@0: virtual nsresult Enable(); michael@0: virtual nsresult Disable(); michael@0: virtual void DetachFromNSWindow(); michael@0: michael@0: // WindowHook procedure for hooking mWnd michael@0: static bool MainWindowHook(void *aContext, michael@0: HWND hWnd, UINT nMsg, michael@0: WPARAM wParam, LPARAM lParam, michael@0: LRESULT *aResult); michael@0: michael@0: // Bug 520807 - we need to update the proxy window style based on the main michael@0: // window's style to workaround a bug with the way the DWM displays the michael@0: // previews. michael@0: void UpdateProxyWindowStyle(); michael@0: michael@0: nsresult UpdateTitle(); michael@0: nsresult UpdateIcon(); michael@0: nsresult UpdateNext(); michael@0: michael@0: // Handle to the toplevel proxy window michael@0: HWND mProxyWindow; michael@0: nsString mTitle; michael@0: nsCOMPtr mIconImage; michael@0: // Cached Windows icon of mIconImage michael@0: HICON mIcon; michael@0: // Preview that follows this preview in the taskbar (left-to-right order) michael@0: nsCOMPtr mNext; michael@0: // True if this preview has been registered with the taskbar michael@0: bool mRegistered; michael@0: }; michael@0: michael@0: } // namespace widget michael@0: } // namespace mozilla michael@0: michael@0: #endif /* __mozilla_widget_TaskbarTabPreview_h__ */