123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- //
- // RUPopupMgr.h
- // red_utils
- //
- // Created by ZhengSong on 2023/6/9.
- //
- #ifndef RUPopupMgr_h
- #define RUPopupMgr_h
- #include "RUDefine.h"
- NS_RU_BEGIN
- class BasePopup;
- class PopupDelegate;
- class PopupMgr {
- public:
- static PopupMgr* getInstance();
- /// 立即打开弹窗
- void openPopup(BasePopup* popup);
-
- /// 打开弹窗(向队列插入待打开窗口),如果当前没有弹窗,根据窗口优先级排序,优先级越小优先弹窗
- void openPopupByQueue(BasePopup* popup);
-
- /// 关闭指定弹窗
- void closePopup(std::string popupName);
-
- /// 弹窗页面关闭成功
- void popupLayerClosed(std::string popupName);
-
- ///强制关闭当前,清空队列,重新开启新弹窗
- void forcePopup(BasePopup* popup);
-
- ///设置代理
- void setPopupDelegate(PopupDelegate* delegate);
-
- ///弹窗析构检查
- void checkPopupByDestruct(BasePopup* popup);
- private:
- void _popupLayer(BasePopup* popup);
- ///是否已经存在同名窗口
- bool _existWindowName(std::string popupName);
- private:
- std::vector<BasePopup*> _waiting; //弹窗等待数组
- std::vector<BasePopup*> _running; //正在运行弹窗数组
- PopupDelegate* _delegate = nullptr;
- bool _isClosing = false;
- };
- NS_RU_END
- #endif /* RUPopupMgr_h */
|