feedwatch.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef __FEEDWATCH_H
  2. #define __FEEDWATCH_H
  3. #include <bfc/wasabi_std.h>
  4. #include <api/syscb/callbacks/svccbi.h>
  5. #include "feedwatcherso.h"
  6. class svc_textFeed;
  7. class ifc_dependent;
  8. class FeedWatcher : private SvcCallbackI, public FeedWatcherScriptObject {
  9. public:
  10. FeedWatcher();
  11. virtual ~FeedWatcher();
  12. int setFeed(const wchar_t *feedid);
  13. void releaseFeed();
  14. const wchar_t *getFeedId();
  15. virtual void feedwatcher_onSetFeed(svc_textFeed *svc) { }
  16. virtual void feedwatcher_onFeedChange(const wchar_t *data) { }
  17. protected:
  18. class FWDV : public DependentViewerI
  19. {
  20. public:
  21. friend class FeedWatcher;
  22. FWDV(FeedWatcher *parent);
  23. virtual int viewer_onItemDeleted(ifc_dependent *item);
  24. virtual int viewer_onEvent(ifc_dependent *item, const GUID *classguid, int event, intptr_t param, void *ptr, size_t ptrlen);
  25. FeedWatcher *parent;
  26. };
  27. // catches text feed change events
  28. virtual int fwdv_onItemDeleted(ifc_dependent *item);
  29. virtual int fwdv_onEvent(ifc_dependent *item, int event, intptr_t param2, void *ptr, size_t ptrlen);
  30. private:
  31. // catches new feeds being registered
  32. virtual void svccb_onSvcRegister(FOURCC type, waServiceFactory *svc);
  33. int registered_syscb;
  34. StringW feed_id;
  35. svc_textFeed *textfeed;
  36. FWDV fwdv;
  37. };
  38. #endif