WebClient.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. void SendMouseWheelEvent(int x, int y, unsigned modifier, int deltaX, int deltaY) const;
  26. void SendTextInputEvent(const StringHash eventType, VariantMap& eventData);
  27. void SendKeyEvent(const StringHash eventType, VariantMap& eventData);
  28. void ShortcutCut();
  29. void ShortcutCopy();
  30. void ShortcutPaste();
  31. void ShortcutSelectAll();
  32. void ShortcutUndo();
  33. void ShortcutRedo();
  34. void ShortcutDelete();
  35. private:
  36. void WasResized();
  37. SharedPtr<WebRenderHandler> renderHandler_;
  38. WebClientPrivate* d_;
  39. };
  40. }