2012-06-03 16:33:52 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_file_filerequest_h__
|
|
|
|
#define mozilla_dom_file_filerequest_h__
|
|
|
|
|
2013-06-05 16:15:48 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-06-03 16:33:52 +00:00
|
|
|
#include "FileCommon.h"
|
|
|
|
|
|
|
|
#include "DOMRequest.h"
|
|
|
|
|
|
|
|
BEGIN_FILE_NAMESPACE
|
|
|
|
|
|
|
|
class FileHelper;
|
|
|
|
class LockedFile;
|
|
|
|
|
2013-03-17 08:51:36 +00:00
|
|
|
class FileRequest : public mozilla::dom::DOMRequest
|
2012-06-03 16:33:52 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(FileRequest, DOMRequest)
|
|
|
|
|
|
|
|
static already_AddRefed<FileRequest>
|
2012-07-10 05:07:01 +00:00
|
|
|
Create(nsIDOMWindow* aOwner, LockedFile* aLockedFile, bool aIsFileRequest);
|
2012-06-03 16:33:52 +00:00
|
|
|
|
|
|
|
// nsIDOMEventTarget
|
|
|
|
virtual nsresult
|
2013-06-05 16:15:48 +00:00
|
|
|
PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
2012-06-03 16:33:52 +00:00
|
|
|
|
|
|
|
void
|
2012-08-22 15:56:38 +00:00
|
|
|
OnProgress(uint64_t aProgress, uint64_t aProgressMax)
|
2012-06-03 16:33:52 +00:00
|
|
|
{
|
|
|
|
FireProgressEvent(aProgress, aProgressMax);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NotifyHelperCompleted(FileHelper* aFileHelper);
|
|
|
|
|
2013-03-17 08:51:36 +00:00
|
|
|
protected:
|
2012-06-03 16:33:52 +00:00
|
|
|
FileRequest(nsIDOMWindow* aWindow);
|
|
|
|
~FileRequest();
|
|
|
|
|
|
|
|
void
|
2012-08-22 15:56:38 +00:00
|
|
|
FireProgressEvent(uint64_t aLoaded, uint64_t aTotal);
|
2012-06-03 16:33:52 +00:00
|
|
|
|
|
|
|
nsRefPtr<LockedFile> mLockedFile;
|
|
|
|
};
|
|
|
|
|
|
|
|
END_FILE_NAMESPACE
|
|
|
|
|
|
|
|
#endif // mozilla_dom_file_filerequest_h__
|