From ddee273096b9fa3a85e7e0cef75d00a4ca6d387a Mon Sep 17 00:00:00 2001 From: "allan%beaufour.dk" Date: Thu, 30 Mar 2006 08:28:00 +0000 Subject: [PATCH] [XForms] Fixup submission cosmetics. Bug 332072, r=smaug+doronr --- extensions/xforms/nsXFormsSubmissionElement.h | 84 +++++++++++++------ 1 file changed, 58 insertions(+), 26 deletions(-) diff --git a/extensions/xforms/nsXFormsSubmissionElement.h b/extensions/xforms/nsXFormsSubmissionElement.h index c2099ebe0dd..7a577f478da 100644 --- a/extensions/xforms/nsXFormsSubmissionElement.h +++ b/extensions/xforms/nsXFormsSubmissionElement.h @@ -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 mActivator; // input end of pipe, which contains response data. - nsCOMPtr mPipeIn; + nsCOMPtr mPipeIn; /** * @return true if aTestURI has the same origin as aBaseURI or if