Bug 1758713 [wpt PR 33128] - Clarify the status of the CSS build system, a=testonly
[gecko.git] / widget / windows / nsColorPicker.h
blob6d2136351fe69799337a3461e7b2f6498d0a1c30
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, nsIWidget* aParentWidget,
22 nsIColorPickerShownCallback* aCallback);
23 NS_IMETHOD Run() override;
25 private:
26 void Update(COLORREF aColor);
28 static UINT_PTR CALLBACK HookProc(HWND aDialog, UINT aMsg, WPARAM aWParam,
29 LPARAM aLParam);
31 COLORREF mInitialColor;
32 COLORREF mColor;
33 nsCOMPtr<nsIWidget> mParentWidget;
34 nsCOMPtr<nsIColorPickerShownCallback> mCallback;
37 class nsColorPicker : public nsIColorPicker {
38 virtual ~nsColorPicker();
40 public:
41 nsColorPicker();
43 NS_DECL_ISUPPORTS
45 NS_IMETHOD Init(mozIDOMWindowProxy* parent, const nsAString& title,
46 const nsAString& aInitialColor) override;
47 NS_IMETHOD Open(nsIColorPickerShownCallback* aCallback) override;
49 private:
50 COLORREF mInitialColor;
51 nsCOMPtr<nsIWidget> mParentWidget;
54 #endif // nsColorPicker_h__