WebClient.h 944 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include <Atomic/Core/Object.h>
  2. #include "WebRenderHandler.h"
  3. #pragma once
  4. class CefClient;
  5. namespace Atomic
  6. {
  7. class WebClientPrivate;
  8. class ATOMIC_API WebClient : public Object
  9. {
  10. friend class WebBrowserHost;
  11. friend class WebClientPrivate;
  12. OBJECT(WebClient)
  13. public:
  14. /// Construct.
  15. WebClient(Context* context);
  16. /// Destruct.
  17. virtual ~WebClient();
  18. /// call once initialized with handlers
  19. bool CreateBrowser(const String& initialURL, int width, int height);
  20. void SetSize(int width, int height);
  21. void SetWebRenderHandler(WebRenderHandler* handler);
  22. CefClient* GetCefClient();
  23. void SendMouseClickEvent(int x, int y, unsigned button, bool mouseUp, unsigned modifier) const;
  24. void SendMouseMoveEvent(int x, int y, unsigned modifier, bool mouseLeave = false) const;
  25. private:
  26. void WasResized();
  27. SharedPtr<WebRenderHandler> renderHandler_;
  28. WebClientPrivate* d_;
  29. };
  30. }