1 /* 2 * Copyright (c) 2023 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 SECURITY_COLLECTOR_EVENT_DEFINE_H 17 #define SECURITY_COLLECTOR_EVENT_DEFINE_H 18 19 #include <cstdint> 20 #include <string> 21 #include <vector> 22 #include <set> 23 24 namespace OHOS::Security::SecurityCollector { 25 enum EventId : int64_t { 26 PASTEBOARD_EVENTID = 1011015000, 27 ACCOUNT_EVENTID, 28 WINDOW_EVENTID, 29 VOLUMN_EVENTID, 30 PRINTER_EVENTID, 31 FILE_EVENTID, 32 PROCESS_EVENTID, 33 NETWORK_EVENTID, 34 FILE_GUARD_EVENTID, 35 CAMERA_EVENTID, 36 APPLICATION_EVENTID, 37 MOUSE_EVENTID, 38 KEYBOARD_EVENTID, 39 }; 40 41 struct Event { 42 int64_t eventId; 43 std::string version; 44 std::string content; 45 std::string extra; 46 std::string timestamp; 47 int32_t userId; 48 std::string deviceId; 49 std::set<std::string> eventSubscribes; 50 }; 51 52 struct SecurityCollectorEventMuteFilter { 53 int64_t eventId; 54 int64_t type; 55 bool isInclude; 56 std::set<std::string> mutes; 57 bool isSetMute; 58 std::string instanceFlag; 59 bool operator == (const SecurityCollectorEventMuteFilter &input) const 60 { 61 return eventId == input.eventId && isInclude == input.isInclude && type == input.type && 62 instanceFlag == input.instanceFlag && mutes.size() == input.mutes.size() && mutes == input.mutes; 63 } 64 }; 65 } // namespace OHOS::Security::SecurityCollector 66 #endif // SECURITY_COLLECTOR_EVENT_INFO_H