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
,
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
: public nsIColorPicker
{
41 virtual ~nsColorPicker();
47 NS_DECL_NSICOLORPICKER
50 COLORREF mInitialColor
;
51 nsTArray
<nsString
> mDefaultColors
;
52 nsCOMPtr
<nsIWidget
> mParentWidget
;
55 #endif // nsColorPicker_h__