• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 OPP_TRANSFER_INFORMATION_H
17 #define OPP_TRANSFER_INFORMATION_H
18 
19 #include <cstdint>
20 #include <string>
21 #include "iosfwd"
22 
23 namespace OHOS {
24 namespace bluetooth {
25 class IOppTransferInformation {
26 public:
27     IOppTransferInformation() = default;
28     virtual ~IOppTransferInformation() = default;
29 
30     int GetId() const;
31     void SetId(int id);
32     std::string GetFileName() const;
33     void SetFileName(const std::string &fileName);
34     std::string GetFilePath() const;
35     void SetFilePath(const std::string &filePath);
36     std::string GetFileType() const;
37     void SetFileType(const std::string &fileType);
38     std::string GetDeviceName() const;
39     void SetDeviceName(const std::string &deviceName);
40     std::string GetDeviceAddress() const;
41     void SetDeviceAddress(const std::string &deviceAddress);
42     int GetDirection() const;
43     void SetDirection(int direction);
44     int GetStatus() const;
45     void SetStatus(int status);
46     int GetResult() const;
47     void SetResult(int result);
48     int GetFileFd() const;
49     void SetFileFd(int fileFd);
50     uint64_t GetTimeStamp() const;
51     void SetTimeStamp(uint64_t timeStamp);
52     uint64_t GetCurrentBytes() const;
53     void SetCurrentBytes(uint64_t currentBytes);
54     uint64_t GetTotalBytes() const;
55     void SetTotalBytes(uint64_t totalBytes);
56     int GetIsAccept() const;
57     void SetIsAccept(int isAccept);
58     int GetOperationNum() const;
59     void SetOperationNum(int operationNum);
60     int GetCurrentCount() const;
61     void SetCurrentCount(int currentCount);
62     int GetTotalCount() const;
63     void SetTotalCount(int totalCount);
64 
65 private:
66     int id_ = -1;
67     std::string fileName_;
68     std::string filePath_;
69     std::string fileType_;
70     std::string deviceName_;
71     std::string deviceAddress_;
72     int direction_ = 0;
73     int status_ = 0;
74     int result_ = 0;
75     int fileFd_ = -1;
76     int operationNum_ = 0;
77     int isAccept_ = false;
78     uint64_t timeStamp_ = 0;
79     uint64_t currentBytes_ = 0;
80     uint64_t totalBytes_ = 0;
81     int currentCount_ = 0;
82     int totalCount_ = 0;
83 };
84 
85 class IOppTransferFileHolder {
86 public:
87     IOppTransferFileHolder() = default;
88     virtual ~IOppTransferFileHolder() = default;
89     IOppTransferFileHolder(const std::string &filePath, const int64_t &fileSize, const int32_t &fileFd);
90     std::string GetFilePath() const;
91     void SetFilePath(const std::string &filePath);
92     int64_t GetFileSize() const;
93     void SetFileSize(const int64_t &fileSize);
94     int32_t GetFileFd() const;
95     void SetFileFd(const int32_t &fileFd);
96 private:
97     std::string filePath_ = "";
98     int64_t fileSize_ = 0;
99     int32_t fileFd_ = 0;
100 };
101 
102 }  // namespace bluetooth
103 }  // namespace OHOS
104 
105 #endif  // OPP_TRANSFER_INFORMATION_H