1 /* 2 * Copyright (c) 2020-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 /** 17 * @addtogroup UI_DFX 18 * @{ 19 * 20 * @brief Provides test and analysis capabilities, such as stimulating input events and viewing information about a 21 * Document Object Model (DOM) tree. 22 * 23 * @since 6 24 */ 25 26 /** 27 * @file ui_view_bounds.h 28 * 29 * @brief 支持显示或隐藏控件边框,方便UI布局和问题定位. 30 * 31 * @since 6 32 */ 33 #ifndef GRAPHIC_LITE_UI_VIEW_BOUNDS_H 34 #define GRAPHIC_LITE_UI_VIEW_BOUNDS_H 35 36 #include "graphic_config.h" 37 #if ENABLE_DEBUG 38 #include "gfx_utils/heap_base.h" 39 namespace OHOS { 40 /** 41 * @brief 控件边框显示/隐藏控制类 42 * 43 * @since 6 44 */ 45 class UIViewBounds : public HeapBase { 46 public: 47 /** 48 * @brief Obtains a singleton <b>UIViewBounds</b> instance. 49 * 50 * @return Returns the <b>UIViewBounds</b> instance. 51 * @since 6 52 */ 53 static UIViewBounds* GetInstance(); 54 55 /** 56 * @brief 获取当前边框显示状态 57 * 58 * @return true 显示,false 不显示 59 * @since 6 60 */ GetShowState()61 bool GetShowState() 62 { 63 return showViewBounds_; 64 } 65 66 /** 67 * @brief 设置当前边框显示状态 68 * 69 * @since 6 70 */ 71 void SetShowState(bool show); 72 73 private: UIViewBounds()74 UIViewBounds() {} ~UIViewBounds()75 virtual ~UIViewBounds() {} 76 77 UIViewBounds(const UIViewBounds&) = delete; 78 UIViewBounds& operator=(const UIViewBounds&) = delete; 79 UIViewBounds(UIViewBounds&&) = delete; 80 UIViewBounds& operator=(UIViewBounds&&) = delete; 81 82 bool showViewBounds_ = false; 83 }; 84 } // namespace OHOS 85 #endif // ENABLE_DEBUG 86 #endif // GRAPHIC_LITE_UI_VIEW_BOUNDS_H 87