Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsXFormsElementFactory.cpp File Reference
#include "nsXFormsElementFactory.h"
#include "nsIDOMDocument.h"
#include "nsXFormsAtoms.h"
#include "nsIDocument.h"
#include "nsIDOMNode.h"
#include "nsString.h"

Go to the source code of this file.

Functions

 NS_HIDDEN_ (nsresult) NS_NewXFormsInputElement(nsIXTFElement **aElement)
 Resolves a relative path string containing "." and ".." with respect to a base path (assumed to already be resolved).
 NS_IMPL_ISUPPORTS2 (nsXFormsElementFactory, nsIXTFElementFactory, nsIDOMNSFeatureFactory) NS_IMETHODIMP nsXFormsElementFactory

Function Documentation

NS_HIDDEN_ ( nsresult  ) [inline]

Resolves a relative path string containing "." and ".." with respect to a base path (assumed to already be resolved).

NS_CStringAppendData.

This routine returns the trash directory corresponding to the given directory.

Extract URI-Scheme if possible.

Todo:
Having <contextcontainer> in the factory means that the item can be used by a user in a document. Not optimal, as it is not a legal XForms tag, but only a pseudo-element. But nsXFormsRepeat/SelectElement needs to be able to create the tag, so is there a "backdoor way" to do that? (XXX)

For example, resolving "../../foo/./bar/../baz.html" w.r.t. "/a/b/c/d/e/" yields "/a/b/c/foo/baz.html". Attempting to ascend above the base results in the NS_ERROR_MALFORMED_URI exception. If basePath is null, it treats it as "/".

Parameters:
relativePatha relative URI
basePatha base URI
Returns:
a new string, representing canonical uri
Parameters:
inURIURI spec
startPosstart of scheme (may be null)
endPosend of scheme; index of colon (may be null)
schemescheme copied to this buffer on return (may be null)

This function appends data to the existing value of aStr.

Parameters:
aStrabstract string reference to be modified
aDatacharacter buffer
aDataLengthnumber of characters to append (pass PR_UINT32_MAX to append until a null-character is encountered)
Returns:
NS_OK if function succeeded

This function does not necessarily null-terminate aStr upon completion. The behavior depends on the implementation of the abstract string, aStr. If aStr is a reference to a nsStringContainer, then its data will be null- terminated by this function.

Resolves a relative path string containing "." and ".." with respect to a base path (assumed to already be resolved).

This routine returns the trash directory corresponding to the given directory.

This later point is only an issue on Windows and a few other systems.

If the moveToTrash parameter is true, then the process for deleting the directory creates a sibling directory of the same name with the ".Trash" suffix. It then attempts to move the given directory into the corresponding trash folder (moving individual files if necessary). Next, it proceeds to delete each file in the trash folder on a low-priority background thread.

If the moveToTrash parameter is false, then the given directory is deleted directly.

If the sync flag is true, then the delete operation runs to completion before this function returns. Otherwise, deletion occurs asynchronously.

Resolves a relative path string containing "." and ".." with respect to a base path (assumed to already be resolved).

As part of that process, it may exit the current process and relaunch it at a later time.

Two directories are passed to this function: greDir (where the actual binary resides) and appDir (which contains application.ini for XULRunner apps). If this is not a XULRunner app then appDir is identical to greDir.

The argc and argv passed to this function should be what is needed to relaunch the current process.

This function does not modify greDir or appDir.

Resolves a relative path string containing "." and ".." with respect to a base path (assumed to already be resolved).

NS_CStringAppendData.

This function appends data to the existing value of aStr.

Parameters:
aStrabstract string reference to be modified
aDatacharacter buffer
aDataLengthnumber of characters to append (pass PR_UINT32_MAX to append until a null-character is encountered)
Returns:
NS_OK if function succeeded

This function does not necessarily null-terminate aStr upon completion. The behavior depends on the implementation of the abstract string, aStr. If aStr is a reference to a nsStringContainer, then its data will be null- terminated by this function.

Definition at line 105 of file nsXFormsElementFactory.cpp.

{
  if (aTagName.EqualsLiteral("model"))
    return NS_NewXFormsModelElement(aElement);
  if (aTagName.EqualsLiteral("instance"))
    return NS_NewXFormsInstanceElement(aElement);
  if (aTagName.EqualsLiteral("bind"))
    return NS_NewXFormsStubElement(aElement);
  if (aTagName.EqualsLiteral("input"))
    return NS_NewXFormsInputElement(aElement);
  if (aTagName.EqualsLiteral("secret"))
    return NS_NewXFormsSecretElement(aElement);
  if (aTagName.EqualsLiteral("textarea"))
    return NS_NewXFormsTextAreaElement(aElement);
  if (aTagName.EqualsLiteral("group"))
    return NS_NewXFormsGroupElement(aElement);
  if (aTagName.EqualsLiteral("output"))
    return NS_NewXFormsOutputElement(aElement);
  if (aTagName.EqualsLiteral("repeat"))
    return NS_NewXFormsRepeatElement(aElement);
  if (aTagName.EqualsLiteral("insert"))
    return NS_NewXFormsInsertElement(aElement);
  if (aTagName.EqualsLiteral("delete"))
    return NS_NewXFormsDeleteElement(aElement);
  if (aTagName.EqualsLiteral("contextcontainer") ||
      aTagName.EqualsLiteral("contextcontainer-inline"))
    return NS_NewXFormsContextContainer(aElement);
  if (aTagName.EqualsLiteral("label"))
    return NS_NewXFormsLabelElement(aElement);
  if (aTagName.EqualsLiteral("select"))
    return NS_NewXFormsSelectElement(aElement);
  if (aTagName.EqualsLiteral("select1"))
    return NS_NewXFormsSelect1Element(aElement);
  if (aTagName.EqualsLiteral("item"))
    return NS_NewXFormsItemElement(aElement);
  if (aTagName.EqualsLiteral("itemset"))
    return NS_NewXFormsItemSetElement(aElement);
  if (aTagName.EqualsLiteral("value"))
    return NS_NewXFormsValueElement(aElement);
  if (aTagName.EqualsLiteral("choices"))
    return NS_NewXFormsChoicesElement(aElement);
  if (aTagName.EqualsLiteral("dispatch"))
    return NS_NewXFormsDispatchElement(aElement);
  if (aTagName.EqualsLiteral("send"))
    return NS_NewXFormsSendElement(aElement);
  if (aTagName.EqualsLiteral("setfocus"))
    return NS_NewXFormsSetFocusElement(aElement);
  if (aTagName.EqualsLiteral("reset"))
    return NS_NewXFormsResetElement(aElement);
  if (aTagName.EqualsLiteral("rebuild"))
    return NS_NewXFormsRebuildElement(aElement);
  if (aTagName.EqualsLiteral("recalculate"))
    return NS_NewXFormsRecalculateElement(aElement);
  if (aTagName.EqualsLiteral("revalidate"))
    return NS_NewXFormsRevalidateElement(aElement);
  if (aTagName.EqualsLiteral("refresh"))
    return NS_NewXFormsRefreshElement(aElement);
  if (aTagName.EqualsLiteral("action"))
    return NS_NewXFormsActionElement(aElement);
  if (aTagName.EqualsLiteral("load"))
    return NS_NewXFormsLoadElement(aElement);
  if (aTagName.EqualsLiteral("setvalue"))
    return NS_NewXFormsSetValueElement(aElement);
  if (aTagName.EqualsLiteral("setindex"))
    return NS_NewXFormsSetIndexElement(aElement);
  if (aTagName.EqualsLiteral("message"))
    return NS_NewXFormsMessageElement(aElement);
  if (aTagName.EqualsLiteral("hint"))
    return NS_NewXFormsHintElement(aElement);
  if (aTagName.EqualsLiteral("help"))
    return NS_NewXFormsHelpElement(aElement);
  if (aTagName.EqualsLiteral("alert"))
    return NS_NewXFormsAlertElement(aElement);
  if (aTagName.EqualsLiteral("mediatype"))
    return NS_NewXFormsMediatypeElement(aElement);
  if (aTagName.EqualsLiteral("submission"))
    return NS_NewXFormsSubmissionElement(aElement);
  if (aTagName.EqualsLiteral("trigger"))
    return NS_NewXFormsTriggerElement(aElement);
  if (aTagName.EqualsLiteral("submit"))
    return NS_NewXFormsSubmitElement(aElement);
  if (aTagName.EqualsLiteral("toggle"))
    return NS_NewXFormsToggleElement(aElement);
  if (aTagName.EqualsLiteral("case"))
    return NS_NewXFormsCaseElement(aElement);
  if (aTagName.EqualsLiteral("switch"))
    return NS_NewXFormsSwitchElement(aElement);
  if (aTagName.EqualsLiteral("upload"))
    return NS_NewXFormsUploadElement(aElement);
  if (aTagName.EqualsLiteral("range"))
    return NS_NewXFormsRangeElement(aElement);
  if (aTagName.EqualsLiteral("copy"))
    return NS_NewXFormsCopyElement(aElement);

  *aElement = nsnull;
  return NS_ERROR_FAILURE;
}