1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef AUTO_LAUNCH_CALLBACK_H 16 #define AUTO_LAUNCH_CALLBACK_H 17 18 #include <string> 19 #include "auto_launch_export.h" 20 #include "types_export.h" 21 22 #ifdef RELEASE_MODE_V2 23 class AutoLaunchCallback { 24 public: AutoLaunchCallback()25 AutoLaunchCallback() {} ~AutoLaunchCallback()26 ~AutoLaunchCallback() {} 27 28 // Delete the copy and assign constructors 29 AutoLaunchCallback(const AutoLaunchCallback &callback) = delete; 30 AutoLaunchCallback &operator=(const AutoLaunchCallback &callback) = delete; 31 AutoLaunchCallback(AutoLaunchCallback &&callback) = delete; 32 AutoLaunchCallback &operator=(AutoLaunchCallback &&callback) = delete; 33 34 void AutoLaunchNotifier(const std::string &userId, const std::string &appId, const std::string &storeId, 35 DistributedDB::AutoLaunchStatus status); 36 int GetStatus(); 37 void Clear(); 38 #ifdef RELEASE_MODE_V3 39 bool AutoLaunchRequestNotifier(const std::string &identifier, DistributedDB::AutoLaunchParam ¶m); 40 void AddHashIdentity(const std::string &hashIdentity); 41 void ClearHashIdentities(); 42 void SetAutoLaunchParam(DistributedDB::AutoLaunchParam &autoLaunchParam); 43 #endif 44 45 private: 46 int realStatus_ = 0; 47 std::vector<std::string> hashIdentities_; 48 #ifdef RELEASE_MODE_V3 49 DistributedDB::AutoLaunchParam autoLaunchParam_; 50 #endif 51 }; 52 #endif // end of RELEASE_MODE_V2 53 #endif // AUTO_LAUNCH_CALLBACK_H