Backed out changeset 1d9301697aa0 (bug 1887752) for causing failures on browser_all_f...
[gecko.git] / layout / forms / nsITextControlFrame.h
bloba1c1df1e2e5b5780fecea98bd2791897f4e6e373
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
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/. */
7 #ifndef nsITextControlFrame_h___
8 #define nsITextControlFrame_h___
10 #include "nsIFormControlFrame.h"
11 #include "mozilla/AlreadyAddRefed.h"
13 class nsISelectionController;
14 class nsFrameSelection;
16 namespace mozilla {
17 class TextEditor;
18 } // namespace mozilla
20 // FIXME(emilio): This has only one implementation, seems it could be removed...
21 class nsITextControlFrame : public nsIFormControlFrame {
22 public:
23 NS_DECL_QUERYFRAME_TARGET(nsITextControlFrame)
25 enum class SelectionDirection : uint8_t { None, Forward, Backward };
27 virtual already_AddRefed<mozilla::TextEditor> GetTextEditor() = 0;
29 MOZ_CAN_RUN_SCRIPT NS_IMETHOD
30 SetSelectionRange(uint32_t aSelectionStart, uint32_t aSelectionEnd,
31 SelectionDirection = SelectionDirection::None) = 0;
33 NS_IMETHOD GetOwnedSelectionController(nsISelectionController** aSelCon) = 0;
34 virtual nsFrameSelection* GetOwnedFrameSelection() = 0;
36 /**
37 * Ensure editor is initialized with the proper flags and the default value.
38 * @throws NS_ERROR_NOT_INITIALIZED if mEditor has not been created
39 * @throws various and sundry other things
41 virtual nsresult EnsureEditorInitialized() = 0;
44 #endif