no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / layout / forms / nsColorControlFrame.h
bloba85816324f80d6e08294063a8ea269fad9967d68
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
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 nsColorControlFrame_h___
8 #define nsColorControlFrame_h___
10 #include "nsCOMPtr.h"
11 #include "nsHTMLButtonControlFrame.h"
12 #include "nsIAnonymousContentCreator.h"
14 namespace mozilla {
15 enum class PseudoStyleType : uint8_t;
16 class PresShell;
17 } // namespace mozilla
19 // Class which implements the input type=color
21 class nsColorControlFrame final : public nsHTMLButtonControlFrame,
22 public nsIAnonymousContentCreator {
23 typedef mozilla::PseudoStyleType PseudoStyleType;
24 typedef mozilla::dom::Element Element;
26 public:
27 friend nsIFrame* NS_NewColorControlFrame(mozilla::PresShell* aPresShell,
28 ComputedStyle* aStyle);
30 void Destroy(DestroyContext&) override;
32 NS_DECL_QUERYFRAME
33 NS_DECL_FRAMEARENA_HELPERS(nsColorControlFrame)
35 #ifdef DEBUG_FRAME_DUMP
36 virtual nsresult GetFrameName(nsAString& aResult) const override;
37 #endif
39 // nsIAnonymousContentCreator
40 virtual nsresult CreateAnonymousContent(
41 nsTArray<ContentInfo>& aElements) override;
42 virtual void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
43 uint32_t aFilter) override;
45 // nsIFrame
46 virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
47 int32_t aModType) override;
48 virtual nsContainerFrame* GetContentInsertionFrame() override;
50 // Refresh the color swatch, using associated input's value
51 nsresult UpdateColor();
53 private:
54 explicit nsColorControlFrame(ComputedStyle* aStyle,
55 nsPresContext* aPresContext);
57 nsCOMPtr<Element> mColorContent;
60 #endif // nsColorControlFrame_h___