michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsITextControlFrame_h___ michael@0: #define nsITextControlFrame_h___ michael@0: michael@0: #include "nsIFormControlFrame.h" michael@0: michael@0: class nsIEditor; michael@0: class nsISelectionController; michael@0: class nsFrameSelection; michael@0: michael@0: class nsITextControlFrame : public nsIFormControlFrame michael@0: { michael@0: public: michael@0: NS_DECL_QUERYFRAME_TARGET(nsITextControlFrame) michael@0: michael@0: enum SelectionDirection { michael@0: eNone, michael@0: eForward, michael@0: eBackward michael@0: }; michael@0: michael@0: NS_IMETHOD GetEditor(nsIEditor **aEditor) = 0; michael@0: michael@0: NS_IMETHOD SetSelectionStart(int32_t aSelectionStart) = 0; michael@0: NS_IMETHOD SetSelectionEnd(int32_t aSelectionEnd) = 0; michael@0: michael@0: NS_IMETHOD SetSelectionRange(int32_t aSelectionStart, michael@0: int32_t aSelectionEnd, michael@0: SelectionDirection aDirection = eNone) = 0; michael@0: NS_IMETHOD GetSelectionRange(int32_t* aSelectionStart, michael@0: int32_t* aSelectionEnd, michael@0: SelectionDirection* aDirection = nullptr) = 0; michael@0: michael@0: NS_IMETHOD GetOwnedSelectionController(nsISelectionController** aSelCon) = 0; michael@0: virtual nsFrameSelection* GetOwnedFrameSelection() = 0; michael@0: michael@0: virtual nsresult GetPhonetic(nsAString& aPhonetic) = 0; michael@0: michael@0: /** michael@0: * Ensure editor is initialized with the proper flags and the default value. michael@0: * @throws NS_ERROR_NOT_INITIALIZED if mEditor has not been created michael@0: * @throws various and sundry other things michael@0: */ michael@0: virtual nsresult EnsureEditorInitialized() = 0; michael@0: michael@0: virtual nsresult ScrollSelectionIntoView() = 0; michael@0: }; michael@0: michael@0: #endif