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