2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsGfxButtonControlFrame_h___
|
|
|
|
#define nsGfxButtonControlFrame_h___
|
|
|
|
|
|
|
|
#include "nsFormControlFrame.h"
|
|
|
|
#include "nsHTMLButtonControlFrame.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIAnonymousContentCreator.h"
|
|
|
|
|
|
|
|
#ifdef ACCESSIBILITY
|
|
|
|
class nsIAccessible;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Class which implements the input[type=button, reset, submit] and
|
|
|
|
// browse button for input[type=file].
|
|
|
|
// The label for button is specified through generated content
|
|
|
|
// in the ua.css file.
|
|
|
|
|
|
|
|
class nsGfxButtonControlFrame : public nsHTMLButtonControlFrame,
|
|
|
|
public nsIAnonymousContentCreator
|
|
|
|
{
|
|
|
|
public:
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsGfxButtonControlFrame(nsStyleContext* aContext);
|
|
|
|
|
2009-12-23 21:21:15 -08:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,
|
|
|
|
nsGUIEvent* aEvent,
|
|
|
|
nsEventStatus* aEventStatus);
|
|
|
|
|
|
|
|
virtual nsIAtom* GetType() const;
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
|
|
|
#endif
|
|
|
|
|
2009-01-12 11:20:59 -08:00
|
|
|
NS_DECL_QUERYFRAME
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// nsIAnonymousContentCreator
|
2011-05-06 13:04:44 -07:00
|
|
|
virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements);
|
2010-10-15 08:34:35 -07:00
|
|
|
virtual void AppendAnonymousContentTo(nsBaseContentList& aElements,
|
|
|
|
PRUint32 aFilter);
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual nsIFrame* CreateFrameFor(nsIContent* aContent);
|
|
|
|
|
|
|
|
// nsIFormControlFrame
|
|
|
|
virtual nsresult GetFormProperty(nsIAtom* aName, nsAString& aValue) const;
|
|
|
|
|
|
|
|
|
|
|
|
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
|
|
|
|
nsIAtom* aAttribute,
|
|
|
|
PRInt32 aModType);
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool IsLeaf() const;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
virtual nsIFrame* GetContentInsertionFrame();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsresult GetDefaultLabel(nsXPIDLString& aLabel);
|
|
|
|
|
|
|
|
nsresult GetLabel(nsXPIDLString& aLabel);
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool IsFileBrowseButton(PRInt32 type); // Browse button of file input
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
virtual bool IsInput() { return true; }
|
2007-03-22 10:30:00 -07:00
|
|
|
private:
|
|
|
|
nsSize mSuggestedSize;
|
|
|
|
nsCOMPtr<nsIContent> mTextContent;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|