1 /*
2  * Copyright (c) 2023-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 FILEMANAGEMENT_DFS_SERVICE_SOFTBUS_FILE_SEND_LISTENER_H
17 #define FILEMANAGEMENT_DFS_SERVICE_SOFTBUS_FILE_SEND_LISTENER_H
18 
19 #include <stdint.h>
20 #include <string>
21 #include "transport/socket.h"
22 #include "transport/trans_type.h"
23 
24 namespace OHOS {
25 namespace Storage {
26 namespace DistributedFile {
27 class SoftBusFileSendListener {
28 public:
29     static void OnFile(int32_t socket, FileEvent *event);
30     static void OnSendFileProcess(int32_t sessionId, uint64_t bytesUpload, uint64_t bytesTotal);
31     static void OnSendFileFinished(int32_t sessionId);
32     static void OnFileTransError(int32_t sessionId, int32_t errorCode);
33     static void OnSendFileReport(int32_t sessionId, FileStatusList statusList, int32_t errorCode);
34     static void OnSendFileShutdown(int32_t sessionId, ShutdownReason reason);
35 
36     static std::string GetLocalSessionName(int32_t sessionId);
37 
38 private:
39     static inline const std::string SERVICE_NAME{"ohos.storage.distributedfile.daemon"};
40 };
41 } // namespace DistributedFile
42 } // namespace Storage
43 } // namespace OHOS
44 #endif // FILEMANAGEMENT_DFS_SERVICE_SOFTBUS_FILE_SEND_LISTENER_H