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/. */
6 #ifndef nsITextControlFrame_h___
7 #define nsITextControlFrame_h___
9 #include "nsIFormControlFrame.h"
13 class nsISelectionController
;
14 class nsFrameSelection
;
16 class nsITextControlFrame
: public nsIFormControlFrame
19 NS_DECL_QUERYFRAME_TARGET(nsITextControlFrame
)
21 enum SelectionDirection
{
27 NS_IMETHOD
GetEditor(nsIEditor
**aEditor
) = 0;
29 NS_IMETHOD
SetSelectionStart(int32_t aSelectionStart
) = 0;
30 NS_IMETHOD
SetSelectionEnd(int32_t aSelectionEnd
) = 0;
32 NS_IMETHOD
SetSelectionRange(int32_t aSelectionStart
,
33 int32_t aSelectionEnd
,
34 SelectionDirection aDirection
= eNone
) = 0;
35 NS_IMETHOD
GetSelectionRange(int32_t* aSelectionStart
,
36 int32_t* aSelectionEnd
,
37 SelectionDirection
* aDirection
= nullptr) = 0;
39 NS_IMETHOD
GetOwnedSelectionController(nsISelectionController
** aSelCon
) = 0;
40 virtual nsFrameSelection
* GetOwnedFrameSelection() = 0;
42 virtual nsresult
GetPhonetic(nsAString
& aPhonetic
) = 0;
45 * Ensure editor is initialized with the proper flags and the default value.
46 * @throws NS_ERROR_NOT_INITIALIZED if mEditor has not been created
47 * @throws various and sundry other things
49 virtual nsresult
EnsureEditorInitialized() = 0;
51 virtual nsresult
ScrollSelectionIntoView() = 0;