2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef WATCHFACE_COMPLICATION_DB_MANAGER_H_
18 #define WATCHFACE_COMPLICATION_DB_MANAGER_H_
22 #include <watchface-common.h>
23 #include <bundle_cpp.h>
29 namespace watchface_complication {
31 class EXPORT_API DBManager {
34 std::string provider_id_;
37 ProviderInfo(std::string provider_id, int type)
38 : provider_id_(provider_id), type_(type) {
40 std::string& GetProviderId() {
47 static std::unique_ptr<tizen_base::Bundle> GetDefaultData(
48 const char* provider_id, int support_type);
49 static std::string GetProviderAppId(const char* provider_id);
50 static std::list<std::string> GetRequiredPrivilegeList(
51 std::string& provider_id);
52 static int GetRequiredSupportEvents(std::string& provider_id);
53 static std::list<std::unique_ptr<ProviderInfo>> GetProviderListWithTypes(
55 static int GetSupportTypes(std::string& provider_id, int* types);
56 static int GetProviderPeriod(std::string& provider_id, int* period);
57 static std::string GetLabel(const char* provider_id);
58 static std::string GetSetupAppId(const char* provider_id);
59 static bool IsProviderExist(std::string& provider_id, int support_type);
60 static std::list<std::string> GetProviderListWithAppId(const char* provider_id);
61 static int GetTrustedInfo(std::string& provider_id, bool* trusted);
64 DBManager(); /* LCOV_EXCL_LINE */
65 virtual ~DBManager(); /* LCOV_EXCL_LINE */
66 static sqlite3* OpenDB();
67 static void CloseDB(sqlite3* db);
68 static const char* GetParserDataPath();
69 static char* GetSystemLocale();
72 } // namespace watchface_complication
74 #endif // WATCHFACE_COMPLICATION_DB_MANAGER_H_