nsIHTMLObjectResizer.idl 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsISupports.idl"
  6. #include "domstubs.idl"
  7. interface nsIHTMLObjectResizeListener;
  8. [scriptable, uuid(8b396020-69d3-451f-80c1-1a96a7da25a9)]
  9. interface nsIHTMLObjectResizer : nsISupports
  10. {
  11. %{C++
  12. typedef short EResizerLocation;
  13. %}
  14. const short eTopLeft = 0;
  15. const short eTop = 1;
  16. const short eTopRight = 2;
  17. const short eLeft = 3;
  18. const short eRight = 4;
  19. const short eBottomLeft = 5;
  20. const short eBottom = 6;
  21. const short eBottomRight = 7;
  22. /**
  23. * the element currently displaying resizers
  24. */
  25. readonly attribute nsIDOMElement resizedObject;
  26. /**
  27. * a boolean indicating if object resizing is enabled in the editor
  28. */
  29. attribute boolean objectResizingEnabled;
  30. /**
  31. * Shows active resizers around an element's frame
  32. * @param aResizedElement [IN] a DOM Element
  33. */
  34. void showResizers(in nsIDOMElement aResizedElement);
  35. /**
  36. * Hide resizers if they are visible
  37. */
  38. void hideResizers();
  39. /**
  40. * Refresh visible resizers
  41. */
  42. void refreshResizers();
  43. /**
  44. * event callback when a mouse button is pressed
  45. * @param aX [IN] horizontal position of the pointer
  46. * @param aY [IN] vertical position of the pointer
  47. * @param aTarget [IN] the element triggering the event
  48. * @param aMouseEvent [IN] the event
  49. */
  50. void mouseDown(in long aX, in long aY,
  51. in nsIDOMElement aTarget, in nsIDOMEvent aMouseEvent);
  52. /**
  53. * event callback when a mouse button is released
  54. * @param aX [IN] horizontal position of the pointer
  55. * @param aY [IN] vertical position of the pointer
  56. * @param aTarget [IN] the element triggering the event
  57. */
  58. void mouseUp(in long aX, in long aY,
  59. in nsIDOMElement aTarget);
  60. /**
  61. * event callback when the mouse pointer is moved
  62. * @param aMouseEvent [IN] the event
  63. */
  64. void mouseMove(in nsIDOMEvent aMouseEvent);
  65. /* Event Listeners */
  66. /**
  67. * Creates a resize listener that can be used to get notifications
  68. * that the user started to resize an object or finalized such an operation
  69. * @param aListener [IN] an instance of nsIHTMLObjectResizeListener
  70. */
  71. void addObjectResizeEventListener(in nsIHTMLObjectResizeListener aListener);
  72. /**
  73. * Deletes a resize listener
  74. * @param aListener [IN] an instance of nsIHTMLObjectResizeListener
  75. */
  76. void removeObjectResizeEventListener(in nsIHTMLObjectResizeListener aListener);
  77. };