1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsColorPicker_h__
8 #define nsColorPicker_h__
14 #include "nsIColorPicker.h"
15 #include "nsThreadUtils.h"
19 class AsyncColorChooser
: public mozilla::Runnable
{
21 AsyncColorChooser(COLORREF aInitialColor
, nsIWidget
* aParentWidget
,
22 nsIColorPickerShownCallback
* aCallback
);
23 NS_IMETHOD
Run() override
;
26 void Update(COLORREF aColor
);
28 static UINT_PTR CALLBACK
HookProc(HWND aDialog
, UINT aMsg
, WPARAM aWParam
,
31 COLORREF mInitialColor
;
33 nsCOMPtr
<nsIWidget
> mParentWidget
;
34 nsCOMPtr
<nsIColorPickerShownCallback
> mCallback
;
37 class nsColorPicker
: public nsIColorPicker
{
38 virtual ~nsColorPicker();
45 NS_IMETHOD
Init(mozIDOMWindowProxy
* parent
, const nsAString
& title
,
46 const nsAString
& aInitialColor
) override
;
47 NS_IMETHOD
Open(nsIColorPickerShownCallback
* aCallback
) override
;
50 COLORREF mInitialColor
;
51 nsCOMPtr
<nsIWidget
> mParentWidget
;
54 #endif // nsColorPicker_h__