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 VIBRATE_ASSET_H
17 #define VIBRATE_ASSET_H
18 
19 #include <mutex>
20 #include <string>
21 
22 namespace OHOS {
23 namespace Media {
24 #define EXPORT __attribute__ ((visibility ("default")))
25 
26 class VibrateAsset {
27 public:
28     EXPORT VibrateAsset();
29     EXPORT virtual ~VibrateAsset() = default;
30 
31     EXPORT int32_t GetId() const;
32     EXPORT void SetId(int32_t id);
33 
34     EXPORT int64_t GetSize() const;
35     EXPORT void SetSize(int64_t size);
36 
37     EXPORT const std::string &GetPath() const;
38     EXPORT void SetPath(const std::string &path);
39 
40     EXPORT const std::string &GetDisplayName() const;
41     EXPORT void SetDisplayName(const std::string &displayName);
42 
43     EXPORT const std::string &GetTitle() const;
44     EXPORT void SetTitle(const std::string &title);
45 
46     EXPORT const std::string &GetDisplayLanguage() const;
47     EXPORT void SetDisplayLanguage(const std::string &displayLanguage);
48 
49     EXPORT int32_t GetVibrateType() const;
50     EXPORT void SetVibrateType(int32_t type);
51 
52     EXPORT int32_t GetSourceType() const;
53     EXPORT void SetSourceType(int32_t type);
54 
55     EXPORT int64_t GetDateAdded() const;
56     EXPORT void SetDateAdded(int64_t dateAdded);
57 
58     EXPORT int64_t GetDateModified() const;
59     EXPORT void SetDateModified(int64_t dateModified);
60 
61     EXPORT int64_t GetDateTaken() const;
62     EXPORT void SetDateTaken(int64_t dateTaken);
63 
64     EXPORT void SetPlayMode(int32_t playMode);
65     EXPORT int32_t GetPlayMode() const;
66 
67     EXPORT std::unordered_map<std::string, std::variant<int32_t, int64_t, std::string, double>> &GetMemberMap();
68     EXPORT std::variant<int32_t, int64_t, std::string, double> &GetMemberValue(const std::string &name);
69 
70 private:
71     const std::string &GetStrMember(const std::string &name) const;
72     int32_t GetInt32Member(const std::string &name) const;
73     int64_t GetInt64Member(const std::string &name) const;
74 
75     std::unordered_map<std::string, std::variant<int32_t, int64_t, std::string, double>> member_;
76 };
77 } // namespace Media
78 } // namespace OHOS
79 
80 #endif  // VIBRATE_ASSET_H
81