1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/forms/nsITextControlFrame.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsITextControlFrame_h___ 1.10 +#define nsITextControlFrame_h___ 1.11 + 1.12 +#include "nsIFormControlFrame.h" 1.13 + 1.14 +class nsIEditor; 1.15 +class nsISelectionController; 1.16 +class nsFrameSelection; 1.17 + 1.18 +class nsITextControlFrame : public nsIFormControlFrame 1.19 +{ 1.20 +public: 1.21 + NS_DECL_QUERYFRAME_TARGET(nsITextControlFrame) 1.22 + 1.23 + enum SelectionDirection { 1.24 + eNone, 1.25 + eForward, 1.26 + eBackward 1.27 + }; 1.28 + 1.29 + NS_IMETHOD GetEditor(nsIEditor **aEditor) = 0; 1.30 + 1.31 + NS_IMETHOD SetSelectionStart(int32_t aSelectionStart) = 0; 1.32 + NS_IMETHOD SetSelectionEnd(int32_t aSelectionEnd) = 0; 1.33 + 1.34 + NS_IMETHOD SetSelectionRange(int32_t aSelectionStart, 1.35 + int32_t aSelectionEnd, 1.36 + SelectionDirection aDirection = eNone) = 0; 1.37 + NS_IMETHOD GetSelectionRange(int32_t* aSelectionStart, 1.38 + int32_t* aSelectionEnd, 1.39 + SelectionDirection* aDirection = nullptr) = 0; 1.40 + 1.41 + NS_IMETHOD GetOwnedSelectionController(nsISelectionController** aSelCon) = 0; 1.42 + virtual nsFrameSelection* GetOwnedFrameSelection() = 0; 1.43 + 1.44 + virtual nsresult GetPhonetic(nsAString& aPhonetic) = 0; 1.45 + 1.46 + /** 1.47 + * Ensure editor is initialized with the proper flags and the default value. 1.48 + * @throws NS_ERROR_NOT_INITIALIZED if mEditor has not been created 1.49 + * @throws various and sundry other things 1.50 + */ 1.51 + virtual nsresult EnsureEditorInitialized() = 0; 1.52 + 1.53 + virtual nsresult ScrollSelectionIntoView() = 0; 1.54 +}; 1.55 + 1.56 +#endif