2009-10-06 02:26:54 +00: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 11:12:37 +00: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-06 02:26:54 +00:00
|
|
|
|
|
|
|
#ifndef __mozilla_widget_TaskbarWindowPreview_h__
|
|
|
|
#define __mozilla_widget_TaskbarWindowPreview_h__
|
|
|
|
|
|
|
|
#include "nsITaskbarWindowPreview.h"
|
2009-10-06 19:00:23 +00:00
|
|
|
#include "nsITaskbarProgress.h"
|
2011-09-28 18:36:43 +00:00
|
|
|
#include "nsITaskbarOverlayIconController.h"
|
2009-10-06 02:26:54 +00:00
|
|
|
#include "TaskbarPreview.h"
|
|
|
|
#include <nsWeakReference.h>
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace widget {
|
|
|
|
|
|
|
|
class TaskbarPreviewButton;
|
|
|
|
class TaskbarWindowPreview : public TaskbarPreview,
|
|
|
|
public nsITaskbarWindowPreview,
|
2009-10-06 19:00:23 +00:00
|
|
|
public nsITaskbarProgress,
|
2011-09-28 18:36:43 +00:00
|
|
|
public nsITaskbarOverlayIconController,
|
2009-10-06 02:26:54 +00:00
|
|
|
public nsSupportsWeakReference
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TaskbarWindowPreview(ITaskbarList4 *aTaskbar, nsITaskbarPreviewController *aController, HWND aHWND, nsIDocShell *aShell);
|
|
|
|
virtual ~TaskbarWindowPreview();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSITASKBARWINDOWPREVIEW
|
2009-10-06 19:00:23 +00:00
|
|
|
NS_DECL_NSITASKBARPROGRESS
|
2011-09-28 18:36:43 +00:00
|
|
|
NS_DECL_NSITASKBAROVERLAYICONCONTROLLER
|
2009-10-06 02:26:54 +00:00
|
|
|
NS_FORWARD_NSITASKBARPREVIEW(TaskbarPreview::)
|
|
|
|
|
|
|
|
virtual LRESULT WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
private:
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual nsresult ShowActive(bool active);
|
2009-10-06 02:26:54 +00:00
|
|
|
virtual HWND &PreviewWindow();
|
|
|
|
|
|
|
|
virtual nsresult UpdateTaskbarProperties();
|
|
|
|
virtual nsresult Enable();
|
|
|
|
virtual nsresult Disable();
|
2010-04-21 19:09:59 +00:00
|
|
|
virtual void DetachFromNSWindow();
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult UpdateButton(uint32_t index);
|
2009-10-06 02:26:54 +00:00
|
|
|
nsresult UpdateButtons();
|
|
|
|
|
|
|
|
// Is custom drawing enabled?
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mCustomDrawing;
|
2009-10-06 02:26:54 +00:00
|
|
|
// Have we made any buttons?
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mHaveButtons;
|
2009-10-06 02:26:54 +00:00
|
|
|
// Windows button format
|
2009-10-06 02:56:54 +00:00
|
|
|
THUMBBUTTON mThumbButtons[nsITaskbarWindowPreview::NUM_TOOLBAR_BUTTONS];
|
2009-10-06 02:26:54 +00:00
|
|
|
// Pointers to our button class (cached instances)
|
2009-10-06 02:56:54 +00:00
|
|
|
nsWeakPtr mWeakButtons[nsITaskbarWindowPreview::NUM_TOOLBAR_BUTTONS];
|
2009-10-06 02:26:54 +00:00
|
|
|
|
2009-10-06 19:00:23 +00:00
|
|
|
// Called to update ITaskbarList4 dependent properties
|
|
|
|
nsresult UpdateTaskbarProgress();
|
2011-09-28 18:36:43 +00:00
|
|
|
nsresult UpdateOverlayIcon();
|
2009-10-06 19:00:23 +00:00
|
|
|
|
|
|
|
// The taskbar progress
|
|
|
|
TBPFLAG mState;
|
|
|
|
ULONGLONG mCurrentValue;
|
|
|
|
ULONGLONG mMaxValue;
|
|
|
|
|
2011-09-28 18:36:43 +00:00
|
|
|
// Taskbar overlay icon
|
|
|
|
HICON mOverlayIcon;
|
|
|
|
nsString mIconDescription;
|
|
|
|
|
|
|
|
// WindowHook procedure for hooking mWnd for taskbar progress and icon stuff
|
2011-09-29 06:19:26 +00:00
|
|
|
static bool TaskbarWindowHook(void *aContext,
|
2011-09-28 18:36:43 +00:00
|
|
|
HWND hWnd, UINT nMsg,
|
|
|
|
WPARAM wParam, LPARAM lParam,
|
|
|
|
LRESULT *aResult);
|
2009-10-06 19:00:23 +00:00
|
|
|
|
2009-10-06 02:26:54 +00:00
|
|
|
friend class TaskbarPreviewButton;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace widget
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* __mozilla_widget_TaskbarWindowPreview_h__ */
|
|
|
|
|