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