1 /*
2  * Copyright (c) 2024 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 OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_COMMON_EVENT_SET_SEARCHABLE_EVENT_H
17 #define OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_COMMON_EVENT_SET_SEARCHABLE_EVENT_H
18 
19 #include "cloud/cloud_event.h"
20 #include "visibility.h"
21 namespace OHOS::DistributedData {
22 class API_EXPORT SetSearchableEvent : public CloudEvent {
23 public:
24     struct EventInfo {
25         bool isSearchable;
26         bool isRebuild;
27     };
28 
29     SetSearchableEvent(StoreInfo storeInfo, EventInfo evtInfo, int32_t evtId = SET_SEARCHABLE)
30         : CloudEvent(evtId, std::move(storeInfo)), info_(std::move(evtInfo))
31     {
32     }
33 
34     ~SetSearchableEvent() override = default;
35 
GetIsSearchabl()36     bool GetIsSearchabl() const
37     {
38         return info_.isSearchable;
39     }
40 
GetIsRebuild()41     bool GetIsRebuild() const
42     {
43         return info_.isRebuild;
44     }
45 private:
46     EventInfo info_;
47 };
48 } // OHOS::DistributedData
49 #endif // OHOS_DISTRIBUTED_DATA_SERVICES_FRAMEWORK_COMMON_EVENT_SET_SEARCHABLE_EVENT_H