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/. */
|
2010-02-24 21:58:18 -08:00
|
|
|
|
|
|
|
#ifndef nsFormData_h__
|
|
|
|
#define nsFormData_h__
|
|
|
|
|
|
|
|
#include "nsIDOMFormData.h"
|
|
|
|
#include "nsIXMLHttpRequest.h"
|
2010-05-26 05:49:38 -07:00
|
|
|
#include "nsFormSubmission.h"
|
2010-09-15 15:52:02 -07:00
|
|
|
#include "nsIJSNativeInitializer.h"
|
2010-02-24 21:58:18 -08:00
|
|
|
#include "nsTArray.h"
|
|
|
|
|
2010-09-05 11:00:05 -07:00
|
|
|
class nsIDOMFile;
|
|
|
|
|
2010-02-24 21:58:18 -08:00
|
|
|
class nsFormData : public nsIDOMFormData,
|
|
|
|
public nsIXHRSendable,
|
2010-09-15 15:52:02 -07:00
|
|
|
public nsIJSNativeInitializer,
|
2010-02-24 21:58:18 -08:00
|
|
|
public nsFormSubmission
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsFormData();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOMFORMDATA
|
|
|
|
NS_DECL_NSIXHRSENDABLE
|
|
|
|
|
|
|
|
// nsFormSubmission
|
|
|
|
virtual nsresult GetEncodedSubmission(nsIURI* aURI,
|
|
|
|
nsIInputStream** aPostDataStream);
|
|
|
|
virtual nsresult AddNameValuePair(const nsAString& aName,
|
|
|
|
const nsAString& aValue);
|
|
|
|
virtual nsresult AddNameFilePair(const nsAString& aName,
|
2010-10-13 16:25:33 -07:00
|
|
|
nsIDOMBlob* aBlob);
|
2010-02-24 21:58:18 -08:00
|
|
|
|
2010-09-15 15:52:02 -07:00
|
|
|
NS_IMETHOD Initialize(nsISupports* aOwner, JSContext* aCx, JSObject* aObj,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t aArgc, jsval* aArgv);
|
2010-02-24 21:58:18 -08:00
|
|
|
private:
|
|
|
|
struct FormDataTuple
|
|
|
|
{
|
|
|
|
nsString name;
|
|
|
|
nsString stringValue;
|
2010-10-13 16:25:33 -07:00
|
|
|
nsCOMPtr<nsIDOMBlob> fileValue;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool valueIsFile;
|
2010-02-24 21:58:18 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
nsTArray<FormDataTuple> mFormData;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsFormData_h__
|