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__
13 #include "nsBaseColorPicker.h"
15 #include "nsThreadUtils.h"
19 class AsyncColorChooser
: public mozilla::Runnable
{
21 AsyncColorChooser(COLORREF aInitialColor
,
22 const nsTArray
<nsString
>& aDefaultColors
,
23 nsIWidget
* aParentWidget
,
24 nsIColorPickerShownCallback
* aCallback
);
25 NS_IMETHOD
Run() override
;
28 void Update(COLORREF aColor
);
30 static UINT_PTR CALLBACK
HookProc(HWND aDialog
, UINT aMsg
, WPARAM aWParam
,
33 COLORREF mInitialColor
;
34 nsTArray
<nsString
> mDefaultColors
;
36 nsCOMPtr
<nsIWidget
> mParentWidget
;
37 nsCOMPtr
<nsIColorPickerShownCallback
> mCallback
;
40 class nsColorPicker final
: public nsBaseColorPicker
{
41 virtual ~nsColorPicker();
50 nsresult
InitNative(const nsTArray
<nsString
>& aDefaultColors
) override
;
51 nsresult
OpenNative() override
;
53 nsTArray
<nsString
> mDefaultColors
;
54 nsCOMPtr
<nsIWidget
> mParentWidget
;
57 #endif // nsColorPicker_h__