Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs
nsGenericHTMLElement.h File Reference
#include "nsGenericElement.h"
#include "nsIDOMHTMLElement.h"
#include "nsINameSpaceManager.h"
#include "nsIFormControl.h"
#include "nsIDOMNSHTMLFrameElement.h"
#include "nsIChromeEventHandler.h"
#include "nsFrameLoader.h"

Go to the source code of this file.

Classes

class  nsGenericHTMLElement
 A common superclass for HTML elements. More...
class  nsGenericHTMLFormElement
 A helper class for form elements that can contain children. More...
class  nsGenericHTMLFrameElement
 A helper class for frame elements. More...

Defines

#define NS_IMPL_NS_NEW_HTML_ELEMENT(_elementName)
 A macro to implement the NS_NewHTMLXXXElement() functions.
#define NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(_elementName)
#define NS_IMPL_STRING_ATTR(_class, _method, _atom)
 A macro to implement the getter and setter for a given string valued content property.
#define NS_IMPL_STRING_ATTR_DEFAULT_VALUE(_class, _method, _atom, _default)
 A macro to implement the getter and setter for a given string valued content property with a default value.
#define NS_IMPL_BOOL_ATTR(_class, _method, _atom)
 A macro to implement the getter and setter for a given boolean valued content property.
#define NS_IMPL_INT_ATTR(_class, _method, _atom)   NS_IMPL_INT_ATTR_DEFAULT_VALUE(_class, _method, _atom, -1)
 A macro to implement the getter and setter for a given integer valued content property.
#define NS_IMPL_INT_ATTR_DEFAULT_VALUE(_class, _method, _atom, _default)
#define NS_IMPL_URI_ATTR(_class, _method, _atom)
 A macro to implement the getter and setter for a given content property that needs to return a URI in string form.
#define NS_HTML_CONTENT_INTERFACE_MAP_AMBIGOUS_BEGIN(_class, _base, _base_if)
 QueryInterface() implementation helper macros.
#define NS_HTML_CONTENT_INTERFACE_MAP_BEGIN(_class, _base)
#define NS_HTML_CONTENT_INTERFACE_MAP_END
#define NS_INTERFACE_MAP_ENTRY_IF_TAG(_interface, _tag)
#define NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO_IF_TAG(_class, _tag)
#define NS_DECLARE_NS_NEW_HTML_ELEMENT(_elementName)

Typedefs

typedef void(* nsMapRuleToAttributesFunc )(const nsMappedAttributes *aAttributes, nsRuleData *aData)

Define Documentation

Value:
nsGenericHTMLElement*                                             \
NS_NewHTML##_elementName##Element(nsINodeInfo *aNodeInfo,         \
                                  PRBool aFromParser = PR_FALSE);

Definition at line 1152 of file nsGenericHTMLElement.h.

#define NS_HTML_CONTENT_INTERFACE_MAP_AMBIGOUS_BEGIN (   _class,
  _base,
  _base_if 
)
Value:
NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr)    \
  {                                                                           \
    NS_ENSURE_ARG_POINTER(aInstancePtr);                                      \
                                                                              \
    *aInstancePtr = nsnull;                                                   \
                                                                              \
    nsresult rv;                                                              \
                                                                              \
    rv = _base::QueryInterface(aIID, aInstancePtr);                           \
                                                                              \
    if (NS_SUCCEEDED(rv))                                                     \
      return rv;                                                              \
                                                                              \
    rv = DOMQueryInterface(NS_STATIC_CAST(_base_if *, this), aIID,            \
                           aInstancePtr);                                     \
                                                                              \
    if (NS_SUCCEEDED(rv))                                                     \
      return rv;                                                              \
                                                                              \
    nsISupports *foundInterface = nsnull;

QueryInterface() implementation helper macros.

Definition at line 1091 of file nsGenericHTMLElement.h.

#define NS_HTML_CONTENT_INTERFACE_MAP_BEGIN (   _class,
  _base 
)
Value:
{                                                                         \
      return PostQueryInterface(aIID, aInstancePtr);                          \
    }                                                                         \
                                                                              \
    NS_ADDREF(foundInterface);                                                \
                                                                              \
    *aInstancePtr = foundInterface;                                           \
                                                                              \
    return NS_OK;                                                             \
  }

Definition at line 1119 of file nsGenericHTMLElement.h.

#define NS_IMPL_BOOL_ATTR (   _class,
  _method,
  _atom 
)
Value:
NS_IMETHODIMP                                                       \
  _class::Get##_method(PRBool* aValue)                                \
  {                                                                   \
    return GetBoolAttr(nsHTMLAtoms::_atom, aValue);                   \
  }                                                                   \
  NS_IMETHODIMP                                                       \
  _class::Set##_method(PRBool aValue)                                 \
  {                                                                   \
    return SetBoolAttr(nsHTMLAtoms::_atom, aValue);                   \
  }

A macro to implement the getter and setter for a given boolean valued content property.

The method uses the generic GetAttr and SetAttr methods.

Definition at line 1036 of file nsGenericHTMLElement.h.

#define NS_IMPL_INT_ATTR (   _class,
  _method,
  _atom 
)    NS_IMPL_INT_ATTR_DEFAULT_VALUE(_class, _method, _atom, -1)

A macro to implement the getter and setter for a given integer valued content property.

The method uses the generic GetAttr and SetAttr methods.

Definition at line 1053 of file nsGenericHTMLElement.h.

#define NS_IMPL_INT_ATTR_DEFAULT_VALUE (   _class,
  _method,
  _atom,
  _default 
)
Value:
NS_IMETHODIMP                                                           \
  _class::Get##_method(PRInt32* aValue)                                   \
  {                                                                       \
    return GetIntAttr(nsHTMLAtoms::_atom, _default, aValue);              \
  }                                                                       \
  NS_IMETHODIMP                                                           \
  _class::Set##_method(PRInt32 aValue)                                    \
  {                                                                       \
    return SetIntAttr(nsHTMLAtoms::_atom, aValue);                        \
  }

Definition at line 1056 of file nsGenericHTMLElement.h.

#define NS_IMPL_NS_NEW_HTML_ELEMENT (   _elementName)
Value:
nsGenericHTMLElement*                                                        \
NS_NewHTML##_elementName##Element(nsINodeInfo *aNodeInfo, PRBool aFromParser)\
{                                                                            \
  return new nsHTML##_elementName##Element(aNodeInfo);                       \
}

A macro to implement the NS_NewHTMLXXXElement() functions.

Definition at line 982 of file nsGenericHTMLElement.h.

Value:
nsGenericHTMLElement*                                                        \
NS_NewHTML##_elementName##Element(nsINodeInfo *aNodeInfo, PRBool aFromParser)\
{                                                                            \
  return new nsHTML##_elementName##Element(aNodeInfo, aFromParser);          \
}

Definition at line 989 of file nsGenericHTMLElement.h.

#define NS_IMPL_STRING_ATTR (   _class,
  _method,
  _atom 
)
Value:
NS_IMETHODIMP                                                      \
  _class::Get##_method(nsAString& aValue)                            \
  {                                                                  \
    return GetAttrHelper(nsHTMLAtoms::_atom, aValue);                \
  }                                                                  \
  NS_IMETHODIMP                                                      \
  _class::Set##_method(const nsAString& aValue)                      \
  {                                                                  \
    return SetAttrHelper(nsHTMLAtoms::_atom, aValue);                \
  }

A macro to implement the getter and setter for a given string valued content property.

The method uses the generic GetAttr and SetAttr methods.

Definition at line 1002 of file nsGenericHTMLElement.h.

#define NS_IMPL_STRING_ATTR_DEFAULT_VALUE (   _class,
  _method,
  _atom,
  _default 
)
Value:
NS_IMETHODIMP                                                      \
  _class::Get##_method(nsAString& aValue)                            \
  {                                                                  \
    return GetStringAttrWithDefault(nsHTMLAtoms::_atom, _default, aValue);\
  }                                                                  \
  NS_IMETHODIMP                                                      \
  _class::Set##_method(const nsAString& aValue)                      \
  {                                                                  \
    return SetAttrHelper(nsHTMLAtoms::_atom, aValue);                \
  }

A macro to implement the getter and setter for a given string valued content property with a default value.

The method uses the generic GetAttr and SetAttr methods.

Definition at line 1019 of file nsGenericHTMLElement.h.

#define NS_IMPL_URI_ATTR (   _class,
  _method,
  _atom 
)
Value:
NS_IMETHODIMP                                                     \
  _class::Get##_method(nsAString& aValue)                           \
  {                                                                 \
    return GetURIAttr(nsHTMLAtoms::_atom, aValue);                  \
  }                                                                 \
  NS_IMETHODIMP                                                     \
  _class::Set##_method(const nsAString& aValue)                     \
  {                                                                 \
    return SetAttrHelper(nsHTMLAtoms::_atom, aValue);               \
  }

A macro to implement the getter and setter for a given content property that needs to return a URI in string form.

The method uses the generic GetAttr and SetAttr methods. This macro is much like the NS_IMPL_STRING_ATTR macro, except we make sure the URI is absolute.

Definition at line 1075 of file nsGenericHTMLElement.h.

Value:
if (mNodeInfo->Equals(nsHTMLAtoms::_tag) &&                                 \
      aIID.Equals(NS_GET_IID(nsIClassInfo))) {                                \
    foundInterface =                                                          \
      nsContentUtils::GetClassInfoInstance(eDOMClassInfo_##_class##_id);      \
    if (!foundInterface) {                                                    \
      *aInstancePtr = nsnull;                                                 \
      return NS_ERROR_OUT_OF_MEMORY;                                          \
    }                                                                         \
  } else

Definition at line 1137 of file nsGenericHTMLElement.h.

#define NS_INTERFACE_MAP_ENTRY_IF_TAG (   _interface,
  _tag 
)
Value:
NS_INTERFACE_MAP_ENTRY_CONDITIONAL(_interface,                              \
                                     mNodeInfo->Equals(nsHTMLAtoms::_tag))

Definition at line 1132 of file nsGenericHTMLElement.h.


Typedef Documentation

Definition at line 70 of file nsGenericHTMLElement.h.