1 // Copyright 2013 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. 4 5 #ifndef CHROME_COMMON_MEDIA_GALLERIES_PICASA_TYPES_H_ 6 #define CHROME_COMMON_MEDIA_GALLERIES_PICASA_TYPES_H_ 7 8 #include <map> 9 #include <set> 10 #include <string> 11 12 #include "base/files/file_path.h" 13 #include "base/platform_file.h" 14 #include "ipc/ipc_platform_file.h" 15 16 namespace picasa { 17 18 struct AlbumInfo; 19 20 typedef std::set<base::FilePath> AlbumImages; 21 typedef std::set<std::string> AlbumUIDSet; 22 typedef std::map<std::string, AlbumImages> AlbumImagesMap; 23 typedef std::map<std::string, AlbumInfo> AlbumMap; 24 25 const char kPicasaAlbumTableName[] = "albumdata"; 26 27 struct AlbumInfo { 28 AlbumInfo(); 29 AlbumInfo(const std::string& name, const base::Time& timestamp, 30 const std::string& uid, const base::FilePath& path); 31 32 ~AlbumInfo(); 33 34 std::string name; 35 base::Time timestamp; 36 std::string uid; 37 base::FilePath path; 38 }; 39 40 struct AlbumTableFiles { 41 AlbumTableFiles(); 42 explicit AlbumTableFiles(const base::FilePath& directory_path); 43 44 // Special empty file used to confirm existence of table. 45 base::PlatformFile indicator_file; 46 47 base::PlatformFile category_file; 48 base::PlatformFile date_file; 49 base::PlatformFile filename_file; 50 base::PlatformFile name_file; 51 base::PlatformFile token_file; 52 base::PlatformFile uid_file; 53 }; 54 55 // A mirror of AlbumTableFiles but for transit. 56 struct AlbumTableFilesForTransit { 57 AlbumTableFilesForTransit(); 58 IPC::PlatformFileForTransit indicator_file; 59 60 IPC::PlatformFileForTransit category_file; 61 IPC::PlatformFileForTransit date_file; 62 IPC::PlatformFileForTransit filename_file; 63 IPC::PlatformFileForTransit name_file; 64 IPC::PlatformFileForTransit token_file; 65 IPC::PlatformFileForTransit uid_file; 66 }; 67 68 struct FolderINIContents { 69 base::FilePath folder_path; 70 std::string ini_contents; 71 }; 72 73 void CloseAlbumTableFiles(AlbumTableFiles* table_files); 74 75 } // namespace picasa 76 77 #endif // CHROME_COMMON_MEDIA_GALLERIES_PICASA_TYPES_H_ 78