nsITextControlFrame.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #ifndef nsITextControlFrame_h___
  6. #define nsITextControlFrame_h___
  7. #include "nsIFormControlFrame.h"
  8. class nsIEditor;
  9. class nsISelectionController;
  10. class nsFrameSelection;
  11. class nsITextControlFrame : public nsIFormControlFrame
  12. {
  13. public:
  14. NS_DECL_QUERYFRAME_TARGET(nsITextControlFrame)
  15. enum SelectionDirection {
  16. eNone,
  17. eForward,
  18. eBackward
  19. };
  20. NS_IMETHOD GetEditor(nsIEditor **aEditor) = 0;
  21. NS_IMETHOD SetSelectionStart(int32_t aSelectionStart) = 0;
  22. NS_IMETHOD SetSelectionEnd(int32_t aSelectionEnd) = 0;
  23. NS_IMETHOD SetSelectionRange(int32_t aSelectionStart,
  24. int32_t aSelectionEnd,
  25. SelectionDirection aDirection = eNone) = 0;
  26. NS_IMETHOD GetSelectionRange(int32_t* aSelectionStart,
  27. int32_t* aSelectionEnd,
  28. SelectionDirection* aDirection = nullptr) = 0;
  29. NS_IMETHOD GetOwnedSelectionController(nsISelectionController** aSelCon) = 0;
  30. virtual nsFrameSelection* GetOwnedFrameSelection() = 0;
  31. virtual nsresult GetPhonetic(nsAString& aPhonetic) = 0;
  32. /**
  33. * Ensure editor is initialized with the proper flags and the default value.
  34. * @throws NS_ERROR_NOT_INITIALIZED if mEditor has not been created
  35. * @throws various and sundry other things
  36. */
  37. virtual nsresult EnsureEditorInitialized() = 0;
  38. virtual nsresult ScrollSelectionIntoView() = 0;
  39. };
  40. #endif