• 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 SMS_RECEIVE_INDEXER_H
17 #define SMS_RECEIVE_INDEXER_H
18 
19 #include <string>
20 #include <vector>
21 
22 namespace OHOS {
23 namespace Telephony {
24 class SmsReceiveIndexer {
25 public:
26     SmsReceiveIndexer();
27     virtual ~SmsReceiveIndexer() = default;
28     SmsReceiveIndexer(const std::vector<uint8_t> &pdu, int64_t timestamp, int16_t destPort, bool isCdma,
29         const std::string &address, const std::string &displayAddress, uint16_t msgRefId, uint16_t msgSeqId,
30         uint16_t msgCount, bool isCdmaWapPdu, const std::string &messageBody);
31     SmsReceiveIndexer(const std::vector<uint8_t> &pdu, int64_t timestamp, int16_t destPort, bool isCdma,
32         bool isCdmaWapPdu, const std::string &address, const std::string &displayAddress,
33         const std::string &messageBody);
34     const std::vector<uint8_t>& GetPdu() const;
35     void SetPdu(const std::vector<uint8_t> &pdu);
36     int64_t GetTimestamp() const;
37     void SetTimestamp(int64_t timestamp);
38     int16_t GetDestPort() const;
39     void SetDestPort(int16_t destPort);
40     bool GetIsCdma() const;
41     void SetIsCdma(bool isCdma);
42     bool GetIsCdmaWapPdu() const;
43     void SetIsCdmaWapPdu(bool isCdmaWapPdu);
44     std::string GetVisibleMessageBody() const;
45     void SetVisibleMessageBody(const std::string &messageBody);
46     std::string GetOriginatingAddress() const;
47     void SetOriginatingAddress(const std::string &address);
48     uint16_t GetMsgRefId() const;
49     void SetMsgRefId(uint16_t msgRefId);
50     uint16_t GetMsgSeqId() const;
51     void SetMsgSeqId(uint16_t msgSeqId);
52     uint16_t GetDataBaseId() const;
53     void SetDataBaseId(uint16_t dataBaseId);
54     uint16_t GetMsgCount() const;
55     void SetMsgCount(uint16_t msgCount);
56     std::string GetEraseRefId() const;
57     void SetEraseRefId(const std::string &eraseRefId);
58     std::string GetVisibleAddress() const;
59     void SetVisibleAddress(const std::string &visibleAddress);
60     bool GetIsText() const;
61     bool GetIsWapPushMsg() const;
62     void SetPdu(const std::vector<uint8_t> &&pdu);
63     bool IsSingleMsg() const;
64     std::string GetRawUserData() const;
65     std::string GetWapPusRawUserData() const;
66     void SetRawUserData(const std::string &rawUserData);
67     void SetRawWapPushUserData(const std::string &rawWapPushUserData);
68 
69 private:
70     std::vector<uint8_t> pdu_;
71     int64_t timestamp_;
72     int16_t destPort_;
73     bool isCdma_ = false;
74     bool isCdmaWapPdu_ = false;
75     std::string visibleMessageBody_;
76     std::string originatingAddress_;
77     uint16_t msgRefId_ = 0;
78     uint16_t msgSeqId_ = 0;
79     uint16_t dataBaseId_ = 0;
80     uint16_t msgCount_ = 0;
81     std::string eraseRefId_;
82     std::string visibleAddress_;
83     std::string rawUserData_;
84     std::string rawWapPushUserData_;
85 };
86 } // namespace Telephony
87 } // namespace OHOS
88 #endif