2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsITextControlFrame_h___
|
|
|
|
#define nsITextControlFrame_h___
|
|
|
|
|
|
|
|
#include "nsIFormControlFrame.h"
|
|
|
|
|
|
|
|
class nsIEditor;
|
|
|
|
class nsIDocShell;
|
|
|
|
class nsISelectionController;
|
|
|
|
class nsFrameSelection;
|
|
|
|
|
|
|
|
class nsITextControlFrame : public nsIFormControlFrame
|
|
|
|
{
|
|
|
|
public:
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsITextControlFrame)
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-07-28 10:51:22 -07:00
|
|
|
enum SelectionDirection {
|
|
|
|
eNone,
|
|
|
|
eForward,
|
|
|
|
eBackward
|
|
|
|
};
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD GetEditor(nsIEditor **aEditor) = 0;
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD GetTextLength(int32_t* aTextLength) = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD SetSelectionStart(int32_t aSelectionStart) = 0;
|
|
|
|
NS_IMETHOD SetSelectionEnd(int32_t aSelectionEnd) = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD SetSelectionRange(int32_t aSelectionStart,
|
|
|
|
int32_t aSelectionEnd,
|
2011-07-28 10:51:22 -07:00
|
|
|
SelectionDirection aDirection = eNone) = 0;
|
2012-08-22 08:56:38 -07:00
|
|
|
NS_IMETHOD GetSelectionRange(int32_t* aSelectionStart,
|
|
|
|
int32_t* aSelectionEnd,
|
2012-07-30 07:20:58 -07:00
|
|
|
SelectionDirection* aDirection = nullptr) = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-04-21 13:17:41 -07:00
|
|
|
NS_IMETHOD GetOwnedSelectionController(nsISelectionController** aSelCon) = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual nsFrameSelection* GetOwnedFrameSelection() = 0;
|
2008-10-27 17:27:55 -07:00
|
|
|
|
|
|
|
virtual nsresult GetPhonetic(nsAString& aPhonetic) = 0;
|
2010-02-01 20:00:06 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Ensure editor is initialized with the proper flags and the default value.
|
|
|
|
* @throws NS_ERROR_NOT_INITIALIZED if mEditor has not been created
|
|
|
|
* @throws various and sundry other things
|
|
|
|
*/
|
|
|
|
virtual nsresult EnsureEditorInitialized() = 0;
|
2011-02-04 16:29:29 -08:00
|
|
|
|
|
|
|
virtual nsresult ScrollSelectionIntoView() = 0;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|