xpcAccessibleImage.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 file,
  4. * You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_a11y_xpcAccessibleImage_h_
  6. #define mozilla_a11y_xpcAccessibleImage_h_
  7. #include "nsIAccessibleImage.h"
  8. #include "xpcAccessibleGeneric.h"
  9. namespace mozilla {
  10. namespace a11y {
  11. class xpcAccessibleImage : public xpcAccessibleGeneric,
  12. public nsIAccessibleImage
  13. {
  14. public:
  15. explicit xpcAccessibleImage(Accessible* aIntl) :
  16. xpcAccessibleGeneric(aIntl) { }
  17. xpcAccessibleImage(ProxyAccessible* aProxy, uint32_t aInterfaces) :
  18. xpcAccessibleGeneric(aProxy, aInterfaces) {}
  19. NS_DECL_ISUPPORTS_INHERITED
  20. NS_IMETHOD GetImagePosition(uint32_t aCoordType,
  21. int32_t* aX, int32_t* aY) final override;
  22. NS_IMETHOD GetImageSize(int32_t* aWidth, int32_t* aHeight) final override;
  23. protected:
  24. virtual ~xpcAccessibleImage() {}
  25. private:
  26. ImageAccessible* Intl()
  27. { return mIntl.IsAccessible() ? mIntl.AsAccessible()->AsImage() : nullptr; }
  28. xpcAccessibleImage(const xpcAccessibleImage&) = delete;
  29. xpcAccessibleImage& operator =(const xpcAccessibleImage&) = delete;
  30. };
  31. } // namespace a11y
  32. } // namespace mozilla
  33. #endif