[XForms] Fixup submission cosmetics. Bug 332072, r=smaug+doronr

This commit is contained in:
allan%beaufour.dk 2006-03-30 08:28:00 +00:00
Родитель 160736a8d7
Коммит ddee273096
1 изменённых файлов: 58 добавлений и 26 удалений

Просмотреть файл

@ -81,11 +81,11 @@ public:
NS_DECL_NSIINTERFACEREQUESTOR
nsXFormsSubmissionElement()
: mElement(nsnull)
, mSubmissionActive(PR_FALSE)
, mIsReplaceInstance(PR_FALSE)
, mIsSOAPRequest(PR_FALSE)
, mFormat(0)
: mElement(nsnull),
mSubmissionActive(PR_FALSE),
mIsReplaceInstance(PR_FALSE),
mIsSOAPRequest(PR_FALSE),
mFormat(0)
{}
// nsIXTFGenericElement overrides
@ -98,34 +98,66 @@ public:
NS_HIDDEN_(nsresult) LoadReplaceInstance(nsIChannel *);
NS_HIDDEN_(nsresult) LoadReplaceAll(nsIChannel *);
NS_HIDDEN_(nsresult) Submit();
NS_HIDDEN_(PRBool) GetBooleanAttr(const nsAString &attrName, PRBool defaultVal = PR_FALSE);
NS_HIDDEN_(PRBool) GetBooleanAttr(const nsAString &attrName,
PRBool defaultVal = PR_FALSE);
NS_HIDDEN_(void) GetDefaultInstanceData(nsIDOMNode **result);
NS_HIDDEN_(nsresult) GetBoundInstanceData(nsIDOMNode **result);
NS_HIDDEN_(nsresult) GetSelectedInstanceElement(const nsAString &aInstance, nsIModelElementPrivate *aModel, nsIInstanceElementPrivate **result);
NS_HIDDEN_(nsresult) SerializeData(nsIDOMNode *data, nsCString &uri, nsIInputStream **, nsCString &contentType);
NS_HIDDEN_(nsresult) SerializeDataXML(nsIDOMNode *data, nsIInputStream **, nsCString &contentType, SubmissionAttachmentArray *);
NS_HIDDEN_(nsresult) CreateSubmissionDoc(nsIDOMNode *source, const nsString &encoding, SubmissionAttachmentArray *, nsIDOMDocument **result);
NS_HIDDEN_(nsresult) CopyChildren(nsIModelElementPrivate* model, nsIDOMNode *source, nsIDOMNode *dest, nsIDOMDocument *destDoc, SubmissionAttachmentArray *, const nsString &cdataElements, PRBool indent, PRUint32 depth);
NS_HIDDEN_(nsresult) SerializeDataURLEncoded(nsIDOMNode *data, nsCString &uri, nsIInputStream **, nsCString &contentType);
NS_HIDDEN_(void) AppendURLEncodedData(nsIDOMNode *data, const nsCString &sep, nsCString &buf);
NS_HIDDEN_(nsresult) SerializeDataMultipartRelated(nsIDOMNode *data, nsIInputStream **, nsCString &contentType);
NS_HIDDEN_(nsresult) SerializeDataMultipartFormData(nsIDOMNode *data, nsIInputStream **, nsCString &contentType);
NS_HIDDEN_(nsresult) AppendMultipartFormData(nsIDOMNode *data, const nsCString &boundary, nsCString &buf, nsIMultiplexInputStream *);
NS_HIDDEN_(nsresult) AppendPostDataChunk(nsCString &postDataChunk, nsIMultiplexInputStream *multiStream);
NS_HIDDEN_(nsresult) GetElementEncodingType(nsIDOMNode *data, PRUint32 *encType, nsIModelElementPrivate* aModel = nsnull);
NS_HIDDEN_(nsresult) CreateFileStream(const nsString &absURI, nsIFile **file, nsIInputStream **stream);
NS_HIDDEN_(nsresult) SendData(const nsCString &uri, nsIInputStream *stream, const nsCString &contentType);
NS_HIDDEN_(nsresult) GetSelectedInstanceElement(const nsAString &aInstance,
nsIModelElementPrivate *aModel,
nsIInstanceElementPrivate **result);
NS_HIDDEN_(nsresult) SerializeData(nsIDOMNode *data, nsCString &uri,
nsIInputStream **, nsCString &contentType);
NS_HIDDEN_(nsresult) SerializeDataXML(nsIDOMNode *data, nsIInputStream **,
nsCString &contentType,
SubmissionAttachmentArray *);
NS_HIDDEN_(nsresult) CreateSubmissionDoc(nsIDOMNode *source,
const nsString &encoding,
SubmissionAttachmentArray *,
nsIDOMDocument **result);
NS_HIDDEN_(nsresult) CopyChildren(nsIModelElementPrivate* model,
nsIDOMNode *source, nsIDOMNode *dest,
nsIDOMDocument *destDoc,
SubmissionAttachmentArray *,
const nsString &cdataElements,
PRBool indent, PRUint32 depth);
NS_HIDDEN_(nsresult) SerializeDataURLEncoded(nsIDOMNode *data, nsCString &uri,
nsIInputStream **,
nsCString &contentType);
NS_HIDDEN_(void) AppendURLEncodedData(nsIDOMNode *data,
const nsCString &sep,
nsCString &buf);
NS_HIDDEN_(nsresult) SerializeDataMultipartRelated(nsIDOMNode *data,
nsIInputStream **,
nsCString &contentType);
NS_HIDDEN_(nsresult) SerializeDataMultipartFormData(nsIDOMNode *data,
nsIInputStream **,
nsCString &contentType);
NS_HIDDEN_(nsresult) AppendMultipartFormData(nsIDOMNode *data,
const nsCString &boundary,
nsCString &buf,
nsIMultiplexInputStream *);
NS_HIDDEN_(nsresult) AppendPostDataChunk(nsCString &postDataChunk,
nsIMultiplexInputStream *multiStream);
NS_HIDDEN_(nsresult) GetElementEncodingType(nsIDOMNode *data,
PRUint32 *encType,
nsIModelElementPrivate* aModel = nsnull);
NS_HIDDEN_(nsresult) CreateFileStream(const nsString &absURI, nsIFile **file,
nsIInputStream **stream);
NS_HIDDEN_(nsresult) SendData(const nsCString &uri, nsIInputStream *stream,
const nsCString &contentType);
private:
nsIDOMElement *mElement;
PRPackedBool mSubmissionActive;
PRPackedBool mIsReplaceInstance; // Valid when mSubmissionActive == PR_TRUE
PRPackedBool mIsSOAPRequest;
PRUint32 mFormat; // Valid when mSubmissionActive == PR_TRUE
nsIDOMElement* mElement;
PRPackedBool mSubmissionActive;
// Valid when mSubmissionActive == PR_TRUE
PRPackedBool mIsReplaceInstance;
PRPackedBool mIsSOAPRequest;
// Valid when mSubmissionActive == PR_TRUE
PRUint32 mFormat;
nsCOMPtr<nsIXFormsSubmitElement> mActivator;
// input end of pipe, which contains response data.
nsCOMPtr<nsIInputStream> mPipeIn;
nsCOMPtr<nsIInputStream> mPipeIn;
/**
* @return true if aTestURI has the same origin as aBaseURI or if