• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
16 #ifndef FOUNDATION_APPEXECFWK_SERVICES_FORMMGR_INCLUDE_FORM_BATCH_DELETE_CONNECTION_H
17 #define FOUNDATION_APPEXECFWK_SERVICES_FORMMGR_INCLUDE_FORM_BATCH_DELETE_CONNECTION_H
18 
19 #include <set>
20 
21 #include "event_handler.h"
22 #include "form_ability_connection.h"
23 #include "want.h"
24 
25 namespace OHOS {
26 namespace AppExecFwk {
27 using WantParams = OHOS::AAFwk::WantParams;
28 
29 /**
30  * @class FormBatchDeleteConnection
31  * Form batch delete connection stub.
32  */
33 class FormBatchDeleteConnection : public FormAbilityConnection {
34 public:
35     FormBatchDeleteConnection(const std::set<int64_t> &formIds, const std::string &bundleName,
36         const std::string &abilityName);
37     virtual ~FormBatchDeleteConnection() = default;
38 
39     /**
40      * @brief OnAbilityConnectDone, AbilityMs notify caller ability the result of connect.
41      * @param element service ability's ElementName.
42      * @param remoteObject the session proxy of service ability.
43      * @param resultCode ERR_OK on success, others on failure.
44      */
45     void OnAbilityConnectDone(
46         const AppExecFwk::ElementName &element, const sptr<IRemoteObject> &remoteObject, int resultCode) override;
47 
48 private:
49     std::set<int64_t> formIds_;
50 
51     DISALLOW_COPY_AND_MOVE(FormBatchDeleteConnection);
52 };
53 }  // namespace AppExecFwk
54 }  // namespace OHOS
55 
56 #endif // FOUNDATION_APPEXECFWK_SERVICES_FORMMGR_INCLUDE_FORM_BATCH_DELETE_CONNECTION_H