Bug 1861709 replace AudioCallbackDriver::ThreadRunning() assertions that mean to...
[gecko.git] / widget / windows / nsColorPicker.h
blobff34b9bd4830f0145b8353e2a7bb82c5f65c07d8
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__
10 #include <windows.h>
11 #include <commdlg.h>
13 #include "nsCOMPtr.h"
14 #include "nsIColorPicker.h"
15 #include "nsThreadUtils.h"
17 class nsIWidget;
19 class AsyncColorChooser : public mozilla::Runnable {
20 public:
21 AsyncColorChooser(COLORREF aInitialColor,
22 const nsTArray<nsString>& aDefaultColors,
23 nsIWidget* aParentWidget,
24 nsIColorPickerShownCallback* aCallback);
25 NS_IMETHOD Run() override;
27 private:
28 void Update(COLORREF aColor);
30 static UINT_PTR CALLBACK HookProc(HWND aDialog, UINT aMsg, WPARAM aWParam,
31 LPARAM aLParam);
33 COLORREF mInitialColor;
34 nsTArray<nsString> mDefaultColors;
35 COLORREF mColor;
36 nsCOMPtr<nsIWidget> mParentWidget;
37 nsCOMPtr<nsIColorPickerShownCallback> mCallback;
40 class nsColorPicker : public nsIColorPicker {
41 virtual ~nsColorPicker();
43 public:
44 nsColorPicker();
46 NS_DECL_ISUPPORTS
47 NS_DECL_NSICOLORPICKER
49 private:
50 COLORREF mInitialColor;
51 nsTArray<nsString> mDefaultColors;
52 nsCOMPtr<nsIWidget> mParentWidget;
55 #endif // nsColorPicker_h__