79c43ffb1ad4ac27a661f0995744e146c5f9d9f7
[platform/framework/web/crosswalk.git] / src / xwalk / application / common / application_storage_impl_tizen.h
1 // Copyright (c) 2013 Intel Corporation. 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 XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_IMPL_TIZEN_H_
6 #define XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_IMPL_TIZEN_H_
7
8 #include <set>
9 #include <string>
10 #include <utility>
11 #include <vector>
12
13 #include "base/files/file_path.h"
14 #include "sql/connection.h"
15 #include "sql/meta_table.h"
16 #include "xwalk/application/common/application_data.h"
17
18 namespace xwalk {
19 namespace application {
20
21 // The Sqlite backend implementation of ApplicationStorage.
22 class ApplicationStorageImpl {
23  public:
24   explicit ApplicationStorageImpl(const base::FilePath& path);
25   ~ApplicationStorageImpl();
26
27   bool AddApplication(const ApplicationData* application,
28                       const base::Time& install_time);
29   bool RemoveApplication(const std::string& key);
30   bool ContainsApplication(const std::string& key);
31   bool UpdateApplication(ApplicationData* application,
32                          const base::Time& install_time);
33   bool Init();
34
35   scoped_refptr<ApplicationData> GetApplicationData(const std::string& id);
36
37   bool GetInstalledApplicationIDs(
38       std::vector<std::string>& app_ids);  // NOLINT
39 };
40
41 }  // namespace application
42 }  // namespace xwalk
43
44 #endif  // XWALK_APPLICATION_COMMON_APPLICATION_STORAGE_IMPL_TIZEN_H_