[Android] Implement 3-way sensor fallback for Device Orientation.
[chromium-blink-merge.git] / ppapi / cpp / private / flash_file.h
blob04ab195eeb32168f4e55edd4cb3067b07eb2b14e
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PPAPI_CPP_PRIVATE_FLASH_FILE_H_
6 #define PPAPI_CPP_PRIVATE_FLASH_FILE_H_
8 #include <string>
9 #include <vector>
11 #include "ppapi/c/private/ppb_flash_file.h"
13 namespace pp {
15 class FileRef;
16 class InstanceHandle;
18 namespace flash {
20 // FileModuleLocal -------------------------------------------------------------
22 class FileModuleLocal {
23 public:
24 // Returns true if the required interface is available.
25 static bool IsAvailable();
27 // Returns |PP_kInvalidFileHandle| on error.
28 static PP_FileHandle OpenFile(const InstanceHandle& instance,
29 const std::string& path,
30 int32_t mode);
31 static bool RenameFile(const InstanceHandle& instance,
32 const std::string& path_from,
33 const std::string& path_to);
34 static bool DeleteFileOrDir(const InstanceHandle& instance,
35 const std::string& path,
36 bool recursive);
37 static bool CreateDir(const InstanceHandle& instance,
38 const std::string& path);
39 static bool QueryFile(const InstanceHandle& instance,
40 const std::string& path,
41 PP_FileInfo* info);
42 // Note that, unlike the C interface, no |FreeDirContents()| is needed.
43 struct DirEntry {
44 std::string name;
45 bool is_dir;
47 static bool GetDirContents(const InstanceHandle& instance,
48 const std::string& path,
49 std::vector<DirEntry>* dir_contents);
51 // Returns |PP_kInvalidFileHandle| on error.
52 static PP_FileHandle CreateTemporaryFile(const InstanceHandle& instance);
55 // FileFileRef -----------------------------------------------------------------
57 class FileFileRef {
58 public:
59 // Returns true if the required interface is available.
60 static bool IsAvailable();
62 // Returns |PP_kInvalidFileHandle| on error.
63 static PP_FileHandle OpenFile(const pp::FileRef& resource,
64 int32_t mode);
65 static bool QueryFile(const pp::FileRef& resource,
66 PP_FileInfo* info);
69 } // namespace flash
70 } // namespace pp
72 #endif // PPAPI_CPP_PRIVATE_FLASH_FILE_H_