Bumping manifests a=b2g-bump
[gecko.git] / widget / windows / nsColorPicker.h
blobebb3f9183f0ea8fbf4bdf6b461eb705616462042
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 :
20 public nsRunnable
22 public:
23 AsyncColorChooser(COLORREF aInitialColor,
24 nsIWidget* aParentWidget,
25 nsIColorPickerShownCallback* aCallback);
26 NS_IMETHOD Run() MOZ_OVERRIDE;
28 private:
29 void Update(COLORREF aColor);
31 static UINT_PTR CALLBACK HookProc(HWND aDialog, UINT aMsg,
32 WPARAM aWParam, LPARAM aLParam);
34 COLORREF mInitialColor;
35 COLORREF mColor;
36 nsCOMPtr<nsIWidget> mParentWidget;
37 nsCOMPtr<nsIColorPickerShownCallback> mCallback;
40 class nsColorPicker :
41 public nsIColorPicker
43 virtual ~nsColorPicker();
45 public:
46 nsColorPicker();
48 NS_DECL_ISUPPORTS
50 NS_IMETHOD Init(nsIDOMWindow* parent, const nsAString& title,
51 const nsAString& aInitialColor);
52 NS_IMETHOD Open(nsIColorPickerShownCallback* aCallback);
54 private:
55 COLORREF mInitialColor;
56 nsCOMPtr<nsIWidget> mParentWidget;
59 #endif // nsColorPicker_h__