1e1c44949Sopenharmony_ci/* 2e1c44949Sopenharmony_ci * Copyright (C) 2024 Huawei Device Co., Ltd. 3e1c44949Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4e1c44949Sopenharmony_ci * you may not use this file except in compliance with the License. 5e1c44949Sopenharmony_ci * You may obtain a copy of the License at 6e1c44949Sopenharmony_ci * 7e1c44949Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8e1c44949Sopenharmony_ci * 9e1c44949Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10e1c44949Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11e1c44949Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12e1c44949Sopenharmony_ci * See the License for the specific language governing permissions and 13e1c44949Sopenharmony_ci * limitations under the License. 14e1c44949Sopenharmony_ci */ 15e1c44949Sopenharmony_ci 16e1c44949Sopenharmony_ci#ifndef FOLD_STATUS_MANAGER 17e1c44949Sopenharmony_ci#define FOLD_STATUS_MANAGER 18e1c44949Sopenharmony_ci 19e1c44949Sopenharmony_ci#include "singleton.h" 20e1c44949Sopenharmony_ci#include "display_manager.h" 21e1c44949Sopenharmony_ci#include "display_info.h" 22e1c44949Sopenharmony_ci 23e1c44949Sopenharmony_cinamespace OHOS { 24e1c44949Sopenharmony_cinamespace Telephony { 25e1c44949Sopenharmony_ciclass FoldStatusManager { 26e1c44949Sopenharmony_ci DECLARE_DELAYED_SINGLETON(FoldStatusManager) 27e1c44949Sopenharmony_cipublic: 28e1c44949Sopenharmony_ci void RegisterFoldableListener(); 29e1c44949Sopenharmony_ci void UnregisterFoldableListener(); 30e1c44949Sopenharmony_ci static bool IsSmallFoldDevice(); 31e1c44949Sopenharmony_ci class FoldStatusListener : public Rosen::DisplayManager::IFoldStatusListener { 32e1c44949Sopenharmony_ci public: 33e1c44949Sopenharmony_ci FoldStatusListener() = default; 34e1c44949Sopenharmony_ci ~FoldStatusListener() override = default; 35e1c44949Sopenharmony_ci DISALLOW_COPY_AND_MOVE(FoldStatusListener); 36e1c44949Sopenharmony_ci 37e1c44949Sopenharmony_ci /** 38e1c44949Sopenharmony_ci * @param FoldStatus uint32_t; UNKNOWN = 0, EXPAND = 1, FOLDED = 2, HALF_FOLD = 3; 39e1c44949Sopenharmony_ci */ 40e1c44949Sopenharmony_ci void OnFoldStatusChanged(Rosen::FoldStatus foldStatus) override; 41e1c44949Sopenharmony_ci }; 42e1c44949Sopenharmony_ci 43e1c44949Sopenharmony_ci Rosen::FoldStatus mOldFoldStatus; 44e1c44949Sopenharmony_ci 45e1c44949Sopenharmony_ciprivate: 46e1c44949Sopenharmony_ci sptr<Rosen::DisplayManager::IFoldStatusListener> foldStatusListener_; 47e1c44949Sopenharmony_ci}; 48e1c44949Sopenharmony_ci} // namespace Telephony 49e1c44949Sopenharmony_ci} // namespace OHOS 50e1c44949Sopenharmony_ci#endif // TELEPHONY_DISTRIBUTED_CALL_MANAGER_H 51