1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsBaseColorPicker_h_
7 #define nsBaseColorPicker_h_
10 #include "nsIColorPicker.h"
13 class mozIDOMWindowProxy
;
15 namespace mozilla::dom
{
16 class BrowsingContext
;
17 } // namespace mozilla::dom
19 class nsBaseColorPicker
: public nsIColorPicker
{
22 NS_IMETHOD
Init(mozilla::dom::BrowsingContext
* aBrowsingContext
,
23 const nsAString
& aTitle
, const nsAString
& aInitialColor
,
24 const nsTArray
<nsString
>& aDefaultColors
) override final
;
25 NS_IMETHOD
Open(nsIColorPickerShownCallback
* aCallback
) override final
;
28 virtual ~nsBaseColorPicker() = default;
30 virtual nsresult
InitNative(const nsTArray
<nsString
>& aDefaultColors
) = 0;
31 virtual nsresult
OpenNative() = 0;
33 bool MaybeBlockColorPicker(nsIColorPickerShownCallback
* aCallback
);
35 RefPtr
<mozilla::dom::BrowsingContext
> mBrowsingContext
;
37 nsString mInitialColor
;
38 nsCOMPtr
<nsIColorPickerShownCallback
> mCallback
;
41 #endif // nsBaseColorPicker_h_