layout/forms/nsGfxButtonControlFrame.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/forms/nsGfxButtonControlFrame.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,67 @@
     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 +
     1.9 +#ifndef nsGfxButtonControlFrame_h___
    1.10 +#define nsGfxButtonControlFrame_h___
    1.11 +
    1.12 +#include "mozilla/Attributes.h"
    1.13 +#include "nsHTMLButtonControlFrame.h"
    1.14 +#include "nsCOMPtr.h"
    1.15 +#include "nsIAnonymousContentCreator.h"
    1.16 +
    1.17 +// Class which implements the input[type=button, reset, submit] and
    1.18 +// browse button for input[type=file].
    1.19 +// The label for button is specified through generated content
    1.20 +// in the ua.css file.
    1.21 +
    1.22 +class nsGfxButtonControlFrame : public nsHTMLButtonControlFrame,
    1.23 +                                public nsIAnonymousContentCreator
    1.24 +{
    1.25 +public:
    1.26 +  NS_DECL_FRAMEARENA_HELPERS
    1.27 +
    1.28 +  nsGfxButtonControlFrame(nsStyleContext* aContext);
    1.29 +
    1.30 +  virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
    1.31 +
    1.32 +  virtual nsresult HandleEvent(nsPresContext* aPresContext, 
    1.33 +                               mozilla::WidgetGUIEvent* aEvent,
    1.34 +                               nsEventStatus* aEventStatus) MOZ_OVERRIDE;
    1.35 +
    1.36 +  virtual nsIAtom* GetType() const MOZ_OVERRIDE;
    1.37 +
    1.38 +#ifdef DEBUG_FRAME_DUMP
    1.39 +  virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
    1.40 +#endif
    1.41 +
    1.42 +  NS_DECL_QUERYFRAME
    1.43 +
    1.44 +  // nsIAnonymousContentCreator
    1.45 +  virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) MOZ_OVERRIDE;
    1.46 +  virtual void AppendAnonymousContentTo(nsBaseContentList& aElements,
    1.47 +                                        uint32_t aFilter) MOZ_OVERRIDE;
    1.48 +  virtual nsIFrame* CreateFrameFor(nsIContent* aContent) MOZ_OVERRIDE;
    1.49 +
    1.50 +  virtual nsresult AttributeChanged(int32_t         aNameSpaceID,
    1.51 +                                    nsIAtom*        aAttribute,
    1.52 +                                    int32_t         aModType) MOZ_OVERRIDE;
    1.53 +
    1.54 +  virtual bool IsLeaf() const MOZ_OVERRIDE;
    1.55 +
    1.56 +  virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE;
    1.57 +
    1.58 +protected:
    1.59 +  nsresult GetDefaultLabel(nsXPIDLString& aLabel) const;
    1.60 +
    1.61 +  nsresult GetLabel(nsXPIDLString& aLabel);
    1.62 +
    1.63 +  virtual bool IsInput() MOZ_OVERRIDE { return true; }
    1.64 +private:
    1.65 +  nsCOMPtr<nsIContent> mTextContent;
    1.66 +};
    1.67 +
    1.68 +
    1.69 +#endif
    1.70 +

mercurial