nsICSSLoaderObserver.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. /* internal interface for observing CSS style sheet loads */
  6. #ifndef nsICSSLoaderObserver_h___
  7. #define nsICSSLoaderObserver_h___
  8. #include "nsISupports.h"
  9. #include "mozilla/StyleSheet.h"
  10. #define NS_ICSSLOADEROBSERVER_IID \
  11. { 0xf51fbf2c, 0xfe4b, 0x4a15, \
  12. { 0xaf, 0x7e, 0x5e, 0x20, 0x64, 0x5f, 0xaf, 0x58 } }
  13. class nsICSSLoaderObserver : public nsISupports {
  14. public:
  15. NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSLOADEROBSERVER_IID)
  16. /**
  17. * StyleSheetLoaded is called after aSheet is marked complete and before any
  18. * load events associated with aSheet are fired.
  19. * @param aSheet the sheet that was loaded. Guaranteed to always be
  20. * non-null, even if aStatus indicates failure.
  21. * @param aWasAlternate whether the sheet was an alternate. This will always
  22. * match the value LoadStyleLink or LoadInlineStyle returned in
  23. * aIsAlternate if one of those methods were used to load the sheet,
  24. * and will always be false otherwise.
  25. * @param aStatus is a success code if the sheet loaded successfully and a
  26. * failure code otherwise. Note that successful load of aSheet
  27. * doesn't indicate anything about whether the data actually parsed
  28. * as CSS, and doesn't indicate anything about the status of any child
  29. * sheets of aSheet.
  30. */
  31. NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheet* aSheet,
  32. bool aWasAlternate,
  33. nsresult aStatus) = 0;
  34. };
  35. NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSLoaderObserver, NS_ICSSLOADEROBSERVER_IID)
  36. #endif // nsICSSLoaderObserver_h___