nsDateTimeControlFrame.h (2134B)
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/. */ 6 7 /** 8 * This frame type is used for input type=date, time, month, week, and 9 * datetime-local. 10 * 11 * NOTE: some of the above-mentioned input types are still to-be-implemented. 12 * See nsCSSFrameConstructor::FindInputData, as well as bug 1286182 (date), 13 * bug 1306215 (month), bug 1306216 (week) and bug 1306217 (datetime-local). 14 */ 15 16 #ifndef nsDateTimeControlFrame_h__ 17 #define nsDateTimeControlFrame_h__ 18 19 #include "nsCOMPtr.h" 20 #include "nsContainerFrame.h" 21 #include "nsIAnonymousContentCreator.h" 22 23 namespace mozilla { 24 class PresShell; 25 namespace dom { 26 struct DateTimeValue; 27 } // namespace dom 28 } // namespace mozilla 29 30 class nsDateTimeControlFrame final : public nsContainerFrame { 31 typedef mozilla::dom::DateTimeValue DateTimeValue; 32 33 explicit nsDateTimeControlFrame(ComputedStyle* aStyle, 34 nsPresContext* aPresContext); 35 36 public: 37 friend nsIFrame* NS_NewDateTimeControlFrame(mozilla::PresShell* aPresShell, 38 ComputedStyle* aStyle); 39 40 NS_DECL_QUERYFRAME 41 NS_DECL_FRAMEARENA_HELPERS(nsDateTimeControlFrame) 42 43 #ifdef DEBUG_FRAME_DUMP 44 nsresult GetFrameName(nsAString& aResult) const override { 45 return MakeFrameName(u"DateTimeControl"_ns, aResult); 46 } 47 #endif 48 49 nscoord IntrinsicISize(const mozilla::IntrinsicSizeInput& aInput, 50 mozilla::IntrinsicISizeType aType) override; 51 52 void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, 53 const ReflowInput& aReflowInput, 54 nsReflowStatus& aStatus) override; 55 56 Maybe<nscoord> GetNaturalBaselineBOffset( 57 mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup, 58 BaselineExportContext) const override; 59 60 nscoord mFirstBaseline = NS_INTRINSIC_ISIZE_UNKNOWN; 61 }; 62 63 #endif // nsDateTimeControlFrame_h__