popexitchecker.h 954 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef __POPUPEXITCHECKER_H
  2. #define __POPUPEXITCHECKER_H
  3. #include <bfc/depend.h>
  4. #include <bfc/ptrlist.h>
  5. class ifc_window;
  6. class PopupExitCallback;
  7. class PopupExitCallbackEntry
  8. {
  9. public:
  10. PopupExitCallbackEntry(PopupExitCallback *_cb, ifc_window *_watched, api_dependent *_cbd, api_dependent *_wd) : cb(_cb), watched(_watched), cbd(_cbd), wd(_wd) {}
  11. virtual ~PopupExitCallbackEntry() {}
  12. PopupExitCallback *cb;
  13. ifc_window *watched;
  14. api_dependent *cbd;
  15. api_dependent *wd;
  16. };
  17. class PopupExitChecker : public DependentViewerI
  18. {
  19. public:
  20. PopupExitChecker();
  21. virtual ~PopupExitChecker();
  22. void registerCallback(PopupExitCallback *cb, ifc_window *watched);
  23. void deregisterCallback(PopupExitCallback *cb);
  24. #undef check
  25. int check(ifc_window *w);
  26. void signal();
  27. int isGrandChildren(ifc_window *parent, ifc_window *child); // recursive
  28. PtrList<PopupExitCallbackEntry> watchers;
  29. virtual int viewer_onItemDeleted(api_dependent *item);
  30. };
  31. #endif