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 TONE_HAPTICS_ATTRS_H 17 #define TONE_HAPTICS_ATTRS_H 18 19 #include <string> 20 21 namespace OHOS { 22 namespace Media { 23 24 enum ToneHapticsMode { 25 NONE = 0, 26 SYNC = 1, 27 NON_SYNC = 2, 28 }; 29 30 struct ToneHapticsSettings { 31 ToneHapticsMode mode = NONE; 32 std::string hapticsUri = ""; 33 }; 34 35 class ToneHapticsAttrs { 36 public: ToneHapticsAttrs(std::string title,std::string fileName,std::string uri)37 ToneHapticsAttrs(std::string title, std::string fileName, std::string uri) : title_(title), 38 fileName_(fileName), uri_(uri) {} 39 ~ToneHapticsAttrs() = default; 40 /** 41 * @brief Returns the title of the tone haptics attrs. 42 * 43 * @return Returns title as string if the title is obtained successfully. 44 * returns an empty string otherwise. 45 * @since 12 46 */ GetTitle()47 std::string GetTitle() const 48 { 49 return title_; 50 } 51 GetFileName()52 std::string GetFileName() const 53 { 54 return fileName_; 55 } 56 GetUri()57 std::string GetUri() const 58 { 59 return uri_; 60 } 61 62 private: 63 std::string title_ = "title_test"; 64 std::string fileName_ = "fileName_test"; 65 std::string uri_ = "uri_test"; 66 }; 67 } // Media 68 } // OHOS 69 #endif // TONE_HAPTICS_ATTRS_H 70