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 "nsIColorPicker.h"
14 class nsIColorPickerShownCallback
;
15 class mozIDOMWindowProxy
;
16 @
class NSColorPanelWrapper
;
19 class nsColorPicker final
: public nsIColorPicker
{
23 NS_IMETHOD
Init(mozIDOMWindowProxy
* aParent
, const nsAString
& aTitle
,
24 const nsAString
& aInitialColor
) override
;
25 NS_IMETHOD
Open(nsIColorPickerShownCallback
* aCallback
) override
;
27 // For NSColorPanelWrapper.
28 void Update(NSColor
* aColor
);
34 static NSColor
* GetNSColorFromHexString(const nsAString
& aColor
);
35 static void GetHexStringFromNSColor(NSColor
* aColor
, nsAString
& aResult
);
37 NSColorPanelWrapper
* mColorPanelWrapper
;
41 nsCOMPtr
<nsIColorPickerShownCallback
> mCallback
;
44 #endif // nsColorPicker_h_