Opera 12.15 Source Code
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

viewportlisteners.h 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
  2. *
  3. * Copyright (C) 2008 Opera Software AS. All rights reserved.
  4. *
  5. * This file is part of the Opera web browser.
  6. * It may not be distributed under any circumstances.
  7. */
  8. #ifndef VIEWPORTLISTENERS_H
  9. #define VIEWPORTLISTENERS_H
  10. #include "modules/windowcommander/OpViewportController.h"
  11. class OpWindowCommander;
  12. class DefaultViewportRequestListener : public OpViewportRequestListener
  13. {
  14. private:
  15. OpWindowCommander* m_commander;
  16. void AdjustRenderingViewport(OpViewportController* controller, const OpRect& new_visual_viewport);
  17. public:
  18. DefaultViewportRequestListener(OpWindowCommander* commander) : m_commander(commander) {}
  19. virtual ~DefaultViewportRequestListener() {}
  20. // Implementing OpViewportRequestListener:
  21. void OnVisualViewportChangeRequest(OpViewportController* controller, const OpRect& viewport, const OpRect& priority_rect, OpViewportChangeReason reason, DirectionHint* dir_hint = NULL);
  22. void OnVisualViewportEdgeChangeRequest(OpViewportController* controller, const ViewportPosition& pos, OpViewportChangeReason reason, DirectionHint* dir_hint = NULL);
  23. #ifdef DOC_SEND_POIMOVED
  24. void OnPOIMoved(OpViewportController* controller, const POIData& element_data);
  25. #endif // DOC_SEND_POIMOVED
  26. virtual void OnZoomLevelChangeRequest(OpViewportController* controller, double zoom_level, const OpRect* priority_rect, OpViewportChangeReason reason);
  27. };
  28. class NullViewportInfoListener : public OpViewportInfoListener
  29. {
  30. public:
  31. // Implementing OpViewportInfoListener:
  32. void OnNewPage(OpViewportController* controller, OpViewportChangeReason reason, int id);
  33. void OnNewPageReady(OpViewportController* controller);
  34. void OnZoomLevelLimitsChanged(OpViewportController* controller, double min_zoom_level, double max_zoom_level, BOOL user_zoomable);
  35. void OnLayoutViewportSizeChanged(OpViewportController* controller, unsigned int width, unsigned int height);
  36. void OnDocumentSizeChanged(OpViewportController* controller, unsigned int width, unsigned int height);
  37. void OnDocumentContentChanged(OpViewportController* controller, CONTENT_CHANGED_REASON reason);
  38. #ifdef CONTENT_MAGIC
  39. void OnContentMagicFound(OpViewportController* controller, const OpRect& content_magic_rect);
  40. #endif // CONTENT_MAGIC
  41. void OnReservedRegionChanged(OpViewportController* controller, const OpRect* rect_array, unsigned int num_rects);
  42. #ifdef ADAPTIVE_ZOOM_SUPPORT
  43. void OnAreaOfInterestChanged(OpViewportController* controller, const OpRect& primary_rect, const OpRect& secondary_rect);
  44. #endif // ADAPTIVE_ZOOM_SUPPORT
  45. void OnTrueZoomBaseScaleChanged(OpViewportController* controller, unsigned int scale_percentage);
  46. #ifdef PAGED_MEDIA_SUPPORT
  47. void OnPageChanged(int new_page_number, int new_page_count);
  48. #endif // PAGED_MEDIA_SUPPORT
  49. };
  50. #endif // VIEWPORTLISTENERS_H