• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025-2025 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 #include "floating_ball_option.h"
17 
18 namespace OHOS {
19 namespace Rosen {
FbOption()20 FbOption::FbOption()
21 {
22 }
23 
SetTemplate(const uint32_t & type)24 void FbOption::SetTemplate(const uint32_t& type)
25 {
26     template_ = type;
27 }
28 
SetTitle(const std::string & title)29 void FbOption::SetTitle(const std::string& title)
30 {
31     title_ = title;
32 }
33 
SetContent(const std::string & content)34 void FbOption::SetContent(const std::string& content)
35 {
36     content_ = content;
37 }
38 
SetBackgroundColor(const std::string & color)39 void FbOption::SetBackgroundColor(const std::string& color)
40 {
41     backgroundColor_ = color;
42 }
43 
SetIcon(const std::shared_ptr<Media::PixelMap> & icon)44 void FbOption::SetIcon(const std::shared_ptr<Media::PixelMap>& icon)
45 {
46     icon_ = icon;
47 }
48 
49 // LCOV_EXCL_START
GetTemplate() const50 uint32_t FbOption::GetTemplate() const
51 {
52     return template_;
53 }
54 
GetTitle() const55 std::string FbOption::GetTitle() const
56 {
57     return title_;
58 }
59 
GetContent() const60 std::string FbOption::GetContent() const
61 {
62     return content_;
63 }
64 
GetBackgroundColor() const65 std::string FbOption::GetBackgroundColor() const
66 {
67     return backgroundColor_;
68 }
69 
GetIcon() const70 std::shared_ptr<Media::PixelMap> FbOption::GetIcon() const
71 {
72     return icon_;
73 }
74 
GetFbTemplateBaseInfo(FloatingBallTemplateBaseInfo & fbTemplateBaseInfo)75 void FbOption::GetFbTemplateBaseInfo(FloatingBallTemplateBaseInfo& fbTemplateBaseInfo)
76 {
77     fbTemplateBaseInfo.template_ = template_;
78     fbTemplateBaseInfo.title_ = title_;
79     fbTemplateBaseInfo.content_ = content_;
80     fbTemplateBaseInfo.backgroundColor_ = backgroundColor_;
81 }
82 // LCOV_EXCL_STOP
83 
84 } // namespace Rosen
85 } // namespace OHOS