imgINotificationObserver.idl 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #include "nsISupports.idl"
  7. interface imgIRequest;
  8. %{C++
  9. #include "nsRect.h"
  10. %}
  11. [ptr] native nsIntRect(nsIntRect);
  12. [scriptable, builtinclass, uuid(03da5641-a333-454a-a859-036d0bb683b7)]
  13. interface imgINotificationObserver : nsISupports
  14. {
  15. // GetWidth() and GetHeight() can now be used to retrieve the size of the
  16. // image.
  17. const long SIZE_AVAILABLE = 1;
  18. // A region of the image (indicated by the |aRect| argument to |notify|) has
  19. // changed, and needs to be redrawn. This is triggered both for incremental
  20. // rendering as the image gets decoded and for changes due to animation.
  21. const long FRAME_UPDATE = 2;
  22. // The first frame of the image is now decoded and ready to draw.
  23. const long FRAME_COMPLETE = 3;
  24. // The entire image has been loaded. That doesn't mean that it has been
  25. // decoded, but it does mean that imgIContainer::Draw is guaranteed to succeed
  26. // (modulo decode errors, at least) if you specify FLAG_SYNC_DECODE.
  27. const long LOAD_COMPLETE = 4;
  28. // The entire image has been decoded.
  29. const long DECODE_COMPLETE = 5;
  30. // The decoded version of the image has been discarded. Content should never
  31. // change as a result of this notification - discarding is an implementation
  32. // detail. This notification should normally only be observed by tests.
  33. const long DISCARD = 6;
  34. // The image was drawn without being locked. This notification is part of the
  35. // image locking mechanism that prevents visible images from being discarded;
  36. // generally only image locking code needs to observe it.
  37. const long UNLOCKED_DRAW = 7;
  38. // The image is animated.
  39. const long IS_ANIMATED = 8;
  40. // The image is transparent.
  41. const long HAS_TRANSPARENCY = 9;
  42. [noscript] void notify(in imgIRequest aProxy, in long aType,
  43. [const] in nsIntRect aRect);
  44. };