1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/xul/nsButtonBoxFrame.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 +#ifndef nsButtonBoxFrame_h___ 1.9 +#define nsButtonBoxFrame_h___ 1.10 + 1.11 +#include "mozilla/Attributes.h" 1.12 +#include "nsBoxFrame.h" 1.13 + 1.14 +class nsButtonBoxFrame : public nsBoxFrame 1.15 +{ 1.16 +public: 1.17 + NS_DECL_FRAMEARENA_HELPERS 1.18 + 1.19 + friend nsIFrame* NS_NewButtonBoxFrame(nsIPresShell* aPresShell); 1.20 + 1.21 + nsButtonBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) 1.22 + :nsBoxFrame(aPresShell, aContext, false) { 1.23 + UpdateMouseThrough(); 1.24 + } 1.25 + 1.26 + virtual void BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder, 1.27 + const nsRect& aDirtyRect, 1.28 + const nsDisplayListSet& aLists) MOZ_OVERRIDE; 1.29 + 1.30 + virtual nsresult HandleEvent(nsPresContext* aPresContext, 1.31 + mozilla::WidgetGUIEvent* aEvent, 1.32 + nsEventStatus* aEventStatus) MOZ_OVERRIDE; 1.33 + 1.34 + virtual void MouseClicked(nsPresContext* aPresContext, 1.35 + mozilla::WidgetGUIEvent* aEvent) 1.36 + { DoMouseClick(aEvent, false); } 1.37 + 1.38 +#ifdef DEBUG_FRAME_DUMP 1.39 + virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE { 1.40 + return MakeFrameName(NS_LITERAL_STRING("ButtonBoxFrame"), aResult); 1.41 + } 1.42 +#endif 1.43 + 1.44 + /** 1.45 + * Our implementation of MouseClicked. 1.46 + * @param aTrustEvent if true and aEvent as null, then assume the event was trusted 1.47 + */ 1.48 + void DoMouseClick(mozilla::WidgetGUIEvent* aEvent, bool aTrustEvent); 1.49 + void UpdateMouseThrough() MOZ_OVERRIDE { AddStateBits(NS_FRAME_MOUSE_THROUGH_NEVER); } 1.50 +}; // class nsButtonBoxFrame 1.51 + 1.52 +#endif /* nsButtonBoxFrame_h___ */