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
:
23 AsyncColorChooser(COLORREF aInitialColor
,
24 nsIWidget
* aParentWidget
,
25 nsIColorPickerShownCallback
* aCallback
);
26 NS_IMETHOD
Run() MOZ_OVERRIDE
;
29 void Update(COLORREF aColor
);
31 static UINT_PTR CALLBACK
HookProc(HWND aDialog
, UINT aMsg
,
32 WPARAM aWParam
, LPARAM aLParam
);
34 COLORREF mInitialColor
;
36 nsCOMPtr
<nsIWidget
> mParentWidget
;
37 nsCOMPtr
<nsIColorPickerShownCallback
> mCallback
;
43 virtual ~nsColorPicker();
50 NS_IMETHOD
Init(nsIDOMWindow
* parent
, const nsAString
& title
,
51 const nsAString
& aInitialColor
);
52 NS_IMETHOD
Open(nsIColorPickerShownCallback
* aCallback
);
55 COLORREF mInitialColor
;
56 nsCOMPtr
<nsIWidget
> mParentWidget
;
59 #endif // nsColorPicker_h__