nsIRadioVisitor.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* -*- Mode: C++; tab-width: 8; 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. #ifndef nsIRadioVisitor_h___
  6. #define nsIRadioVisitor_h___
  7. #include "nsISupports.h"
  8. class nsIFormControl;
  9. // IID for the nsIRadioControl interface
  10. #define NS_IRADIOVISITOR_IID \
  11. { 0xc6bed232, 0x1181, 0x4ab2, \
  12. { 0xa1, 0xda, 0x55, 0xc2, 0x13, 0x6d, 0xea, 0x3d } }
  13. /**
  14. * This interface is used for the text control frame to store its value away
  15. * into the content.
  16. */
  17. class nsIRadioVisitor : public nsISupports {
  18. public:
  19. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRADIOVISITOR_IID)
  20. /**
  21. * Visit a node in the tree. This is meant to be called on all radios in a
  22. * group, sequentially. (Each radio group implementor may define
  23. * sequentially in their own way, it just has to be the same every time.)
  24. * Currently all radio groups are ordered in the order they appear in the
  25. * document. Radio group implementors should honor the return value of the
  26. * method and stop iterating if the return value is false.
  27. *
  28. * @param aRadio the radio button in question (must be nullptr and QI'able to
  29. * nsIRadioControlElement)
  30. */
  31. virtual bool Visit(nsIFormControl* aRadio) = 0;
  32. };
  33. NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioVisitor, NS_IRADIOVISITOR_IID)
  34. #endif // nsIRadioVisitor_h___