Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
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 "nsString.h"
16 #include "nsThreadUtils.h"
18 class nsIWidget;
20 class AsyncColorChooser :
21 public nsRunnable
22 {
23 public:
24 AsyncColorChooser(const nsAString& aInitialColor,
25 nsIWidget* aParentWidget,
26 nsIColorPickerShownCallback* aCallback);
27 NS_IMETHOD Run() MOZ_OVERRIDE;
29 private:
30 nsString mInitialColor;
31 nsCOMPtr<nsIWidget> mParentWidget;
32 nsCOMPtr<nsIColorPickerShownCallback> mCallback;
33 nsString mColor;
34 };
36 class nsColorPicker :
37 public nsIColorPicker
38 {
39 public:
40 nsColorPicker();
41 virtual ~nsColorPicker();
43 NS_DECL_ISUPPORTS
45 NS_IMETHOD Init(nsIDOMWindow* parent, const nsAString& title,
46 const nsAString& aInitialColor);
47 NS_IMETHOD Open(nsIColorPickerShownCallback* aCallback);
49 protected:
50 nsString mInitialColor;
51 nsCOMPtr<nsIWidget> mParentWidget;
52 };
54 #endif // nsColorPicker_h__