Bug 1877662 - expose mozconfig as an artifact from build-fat-aar. r=glandium,geckovie...
[gecko.git] / layout / forms / nsSearchControlFrame.h
blob0499fa84ea519b086a253534106e659b92d017ed
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 nsSearchControlFrame_h__
8 #define nsSearchControlFrame_h__
10 #include "mozilla/Attributes.h"
11 #include "nsTextControlFrame.h"
12 #include "nsIAnonymousContentCreator.h"
13 #include "mozilla/RefPtr.h"
15 class nsITextControlFrame;
16 class nsPresContext;
18 namespace mozilla {
19 enum class PseudoStyleType : uint8_t;
20 class PresShell;
21 namespace dom {
22 class Element;
23 } // namespace dom
24 } // namespace mozilla
26 /**
27 * This frame type is used for <input type=search>.
29 class nsSearchControlFrame final : public nsTextControlFrame {
30 friend nsIFrame* NS_NewSearchControlFrame(mozilla::PresShell* aPresShell,
31 ComputedStyle* aStyle);
33 using PseudoStyleType = mozilla::PseudoStyleType;
34 using Element = mozilla::dom::Element;
36 explicit nsSearchControlFrame(ComputedStyle* aStyle,
37 nsPresContext* aPresContext);
39 public:
40 NS_DECL_QUERYFRAME
41 NS_DECL_FRAMEARENA_HELPERS(nsSearchControlFrame)
43 void Destroy(DestroyContext&) override;
45 // nsIAnonymousContentCreator
46 nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
47 void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
48 uint32_t aFilter) override;
50 #ifdef DEBUG_FRAME_DUMP
51 nsresult GetFrameName(nsAString& aResult) const override {
52 return MakeFrameName(u"SearchControl"_ns, aResult);
54 #endif
56 Element* GetAnonClearButton() const { return mClearButton; }
58 /**
59 * Update visbility of the clear button depending on the value
61 void UpdateClearButtonState();
63 private:
64 // See nsSearchControlFrame::CreateAnonymousContent of a description of these
65 RefPtr<Element> mClearButton;
68 #endif // nsSearchControlFrame_h__