Bug 1646817 - Support DocumentChannel process switching in sidebars and popups r...
[gecko.git] / widget / cocoa / nsColorPicker.h
blobb8ee6328bad0c121dbcb46a67afd00d7ac78f582
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"
11 #include "nsString.h"
12 #include "nsCOMPtr.h"
14 class nsIColorPickerShownCallback;
15 class mozIDOMWindowProxy;
16 @class NSColorPanelWrapper;
17 @class NSColor;
19 class nsColorPicker final : public nsIColorPicker {
20 public:
21 NS_DECL_ISUPPORTS
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);
29 void Done();
31 private:
32 ~nsColorPicker();
34 static NSColor* GetNSColorFromHexString(const nsAString& aColor);
35 static void GetHexStringFromNSColor(NSColor* aColor, nsAString& aResult);
37 NSColorPanelWrapper* mColorPanelWrapper;
39 nsString mTitle;
40 nsString mColor;
41 nsCOMPtr<nsIColorPickerShownCallback> mCallback;
44 #endif // nsColorPicker_h_