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 #ifndef ACTION_POPUP_H 16 #define ACTION_POPUP_H 17 18 #include "ithermal_action.h" 19 #include "window_manager.h" 20 #include "refbase.h" 21 22 namespace OHOS { 23 namespace PowerMgr { 24 class ActionPopup : public IThermalAction { 25 public: 26 ActionPopup() = default; 27 ~ActionPopup() = default; 28 enum { 29 LOWER_TEMP = 1, 30 HIGHER_TEMP = 2 31 }; 32 bool InitParams(const std::string ¶ms) override; 33 virtual void SetStrict(bool flag) override; 34 virtual void AddActionValue(std::string value) override; 35 virtual void Execute() override; 36 37 bool ShowDialog(const std::string ¶ms); 38 void HandlePopupEvent(const int32_t value); 39 void GetDisplayPosition(int32_t& offsetX, int32_t& offsetY, int32_t& width, int32_t& height, bool& wideScreen); 40 private: 41 std::vector<uint32_t> valueList_; 42 std::string params_; 43 bool flag_; 44 uint32_t lastValue_; 45 }; 46 } // namespace PowerMgr 47 } // namespace OHOS 48 #endif // ACTION_POPUP_H