dom/filesystem/RemoveTask.h

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:bc3112652b1b
1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 #ifndef mozilla_dom_RemoveTask_h
8 #define mozilla_dom_RemoveTask_h
9
10 #include "mozilla/dom/FileSystemTaskBase.h"
11 #include "nsAutoPtr.h"
12
13 namespace mozilla {
14 namespace dom {
15
16 class Promise;
17
18 class RemoveTask MOZ_FINAL
19 : public FileSystemTaskBase
20 {
21 public:
22 RemoveTask(FileSystemBase* aFileSystem,
23 const nsAString& aDirPath,
24 nsIDOMFile* aTargetFile,
25 const nsAString& aTargetPath,
26 bool aRecursive);
27 RemoveTask(FileSystemBase* aFileSystem,
28 const FileSystemRemoveParams& aParam,
29 FileSystemRequestParent* aParent);
30
31 virtual
32 ~RemoveTask();
33
34 already_AddRefed<Promise>
35 GetPromise();
36
37 virtual void
38 GetPermissionAccessType(nsCString& aAccess) const MOZ_OVERRIDE;
39
40 protected:
41 virtual FileSystemParams
42 GetRequestParams(const nsString& aFileSystem) const MOZ_OVERRIDE;
43
44 virtual FileSystemResponseValue
45 GetSuccessRequestResult() const MOZ_OVERRIDE;
46
47 virtual void
48 SetSuccessRequestResult(const FileSystemResponseValue& aValue) MOZ_OVERRIDE;
49
50 virtual nsresult
51 Work() MOZ_OVERRIDE;
52
53 virtual void
54 HandlerCallback() MOZ_OVERRIDE;
55
56 private:
57 nsRefPtr<Promise> mPromise;
58 nsString mDirRealPath;
59 nsCOMPtr<nsIDOMFile> mTargetFile;
60 nsString mTargetRealPath;
61 bool mRecursive;
62 bool mReturnValue;
63 };
64
65 } // namespace dom
66 } // namespace mozilla
67
68 #endif // mozilla_dom_RemoveTask_h

mercurial