1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/windows/TaskbarTabPreview.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,69 @@ 1.4 +/* vim: se cin sw=2 ts=2 et : */ 1.5 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.6 + * 1.7 + * This Source Code Form is subject to the terms of the Mozilla Public 1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.10 + 1.11 +#ifndef __mozilla_widget_TaskbarTabPreview_h__ 1.12 +#define __mozilla_widget_TaskbarTabPreview_h__ 1.13 + 1.14 +#include "nsITaskbarTabPreview.h" 1.15 +#include "TaskbarPreview.h" 1.16 + 1.17 +namespace mozilla { 1.18 +namespace widget { 1.19 + 1.20 +class TaskbarTabPreview : public nsITaskbarTabPreview, 1.21 + public TaskbarPreview 1.22 +{ 1.23 +public: 1.24 + TaskbarTabPreview(ITaskbarList4 *aTaskbar, nsITaskbarPreviewController *aController, HWND aHWND, nsIDocShell *aShell); 1.25 + virtual ~TaskbarTabPreview(); 1.26 + 1.27 + NS_DECL_ISUPPORTS 1.28 + NS_DECL_NSITASKBARTABPREVIEW 1.29 + NS_FORWARD_NSITASKBARPREVIEW(TaskbarPreview::) 1.30 + 1.31 +private: 1.32 + virtual nsresult ShowActive(bool active); 1.33 + virtual HWND &PreviewWindow(); 1.34 + virtual LRESULT WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam); 1.35 + static LRESULT CALLBACK GlobalWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam); 1.36 + 1.37 + virtual nsresult UpdateTaskbarProperties(); 1.38 + virtual nsresult Enable(); 1.39 + virtual nsresult Disable(); 1.40 + virtual void DetachFromNSWindow(); 1.41 + 1.42 + // WindowHook procedure for hooking mWnd 1.43 + static bool MainWindowHook(void *aContext, 1.44 + HWND hWnd, UINT nMsg, 1.45 + WPARAM wParam, LPARAM lParam, 1.46 + LRESULT *aResult); 1.47 + 1.48 + // Bug 520807 - we need to update the proxy window style based on the main 1.49 + // window's style to workaround a bug with the way the DWM displays the 1.50 + // previews. 1.51 + void UpdateProxyWindowStyle(); 1.52 + 1.53 + nsresult UpdateTitle(); 1.54 + nsresult UpdateIcon(); 1.55 + nsresult UpdateNext(); 1.56 + 1.57 + // Handle to the toplevel proxy window 1.58 + HWND mProxyWindow; 1.59 + nsString mTitle; 1.60 + nsCOMPtr<imgIContainer> mIconImage; 1.61 + // Cached Windows icon of mIconImage 1.62 + HICON mIcon; 1.63 + // Preview that follows this preview in the taskbar (left-to-right order) 1.64 + nsCOMPtr<nsITaskbarTabPreview> mNext; 1.65 + // True if this preview has been registered with the taskbar 1.66 + bool mRegistered; 1.67 +}; 1.68 + 1.69 +} // namespace widget 1.70 +} // namespace mozilla 1.71 + 1.72 +#endif /* __mozilla_widget_TaskbarTabPreview_h__ */