widget/windows/TaskbarWindowPreview.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/windows/TaskbarWindowPreview.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,84 @@
     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_TaskbarWindowPreview_h__
    1.12 +#define __mozilla_widget_TaskbarWindowPreview_h__
    1.13 +
    1.14 +#include "nsITaskbarWindowPreview.h"
    1.15 +#include "nsITaskbarProgress.h"
    1.16 +#include "nsITaskbarOverlayIconController.h"
    1.17 +#include "TaskbarPreview.h"
    1.18 +#include <nsWeakReference.h>
    1.19 +
    1.20 +namespace mozilla {
    1.21 +namespace widget {
    1.22 +
    1.23 +class TaskbarPreviewButton;
    1.24 +class TaskbarWindowPreview : public TaskbarPreview,
    1.25 +                             public nsITaskbarWindowPreview,
    1.26 +                             public nsITaskbarProgress,
    1.27 +                             public nsITaskbarOverlayIconController,
    1.28 +                             public nsSupportsWeakReference
    1.29 +{
    1.30 +public:
    1.31 +  TaskbarWindowPreview(ITaskbarList4 *aTaskbar, nsITaskbarPreviewController *aController, HWND aHWND, nsIDocShell *aShell);
    1.32 +  virtual ~TaskbarWindowPreview();
    1.33 +
    1.34 +  NS_DECL_ISUPPORTS
    1.35 +  NS_DECL_NSITASKBARWINDOWPREVIEW
    1.36 +  NS_DECL_NSITASKBARPROGRESS
    1.37 +  NS_DECL_NSITASKBAROVERLAYICONCONTROLLER
    1.38 +  NS_FORWARD_NSITASKBARPREVIEW(TaskbarPreview::)
    1.39 +
    1.40 +  virtual LRESULT WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
    1.41 +private:
    1.42 +  virtual nsresult ShowActive(bool active);
    1.43 +  virtual HWND &PreviewWindow();
    1.44 +
    1.45 +  virtual nsresult UpdateTaskbarProperties();
    1.46 +  virtual nsresult Enable();
    1.47 +  virtual nsresult Disable();
    1.48 +  virtual void DetachFromNSWindow();
    1.49 +  nsresult UpdateButton(uint32_t index);
    1.50 +  nsresult UpdateButtons();
    1.51 +
    1.52 +  // Is custom drawing enabled?
    1.53 +  bool                    mCustomDrawing;
    1.54 +  // Have we made any buttons?
    1.55 +  bool                    mHaveButtons;
    1.56 +  // Windows button format
    1.57 +  THUMBBUTTON             mThumbButtons[nsITaskbarWindowPreview::NUM_TOOLBAR_BUTTONS];
    1.58 +  // Pointers to our button class (cached instances)
    1.59 +  nsWeakPtr               mWeakButtons[nsITaskbarWindowPreview::NUM_TOOLBAR_BUTTONS];
    1.60 +
    1.61 +  // Called to update ITaskbarList4 dependent properties
    1.62 +  nsresult UpdateTaskbarProgress();
    1.63 +  nsresult UpdateOverlayIcon();
    1.64 +
    1.65 +  // The taskbar progress
    1.66 +  TBPFLAG                 mState;
    1.67 +  ULONGLONG               mCurrentValue;
    1.68 +  ULONGLONG               mMaxValue;
    1.69 +
    1.70 +  // Taskbar overlay icon
    1.71 +  HICON                   mOverlayIcon;
    1.72 +  nsString                mIconDescription;
    1.73 +
    1.74 +  // WindowHook procedure for hooking mWnd for taskbar progress and icon stuff
    1.75 +  static bool TaskbarWindowHook(void *aContext,
    1.76 +                                  HWND hWnd, UINT nMsg,
    1.77 +                                  WPARAM wParam, LPARAM lParam,
    1.78 +                                  LRESULT *aResult);
    1.79 +
    1.80 +  friend class TaskbarPreviewButton;
    1.81 +};
    1.82 +
    1.83 +} // namespace widget
    1.84 +} // namespace mozilla
    1.85 +
    1.86 +#endif /* __mozilla_widget_TaskbarWindowPreview_h__ */
    1.87 +

mercurial