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