editor/txtsvc/public/nsITextServicesDocument.h

editor/txtsvc/src/nsTextServicesDocument.cpp
editor/txtsvc/src/nsTextServicesDocument.h

  - Added ScrollSelectionIntoView() method to nsITextServicesDocument
    interface and implementation.
This commit is contained in:
kin%netscape.com 1999-09-29 20:04:34 +00:00
Родитель ff2c034123
Коммит 6a0bf9b1e4
6 изменённых файлов: 48 добавлений и 0 удалений

Просмотреть файл

@ -175,6 +175,12 @@ public:
NS_IMETHOD SetSelection(PRInt32 aOffset, PRInt32 aLength) = 0;
/**
* Scrolls the document so that the current selection is visible.
*/
NS_IMETHOD ScrollSelectionIntoView() = 0;
/**
* Deletes the text selected by SetSelection(). Calling
* DeleteSelection with nothing selected, or with a collapsed

Просмотреть файл

@ -1697,6 +1697,23 @@ nsTextServicesDocument::SetSelection(PRInt32 aOffset, PRInt32 aLength)
return result;
}
NS_IMETHODIMP
nsTextServicesDocument::ScrollSelectionIntoView()
{
nsresult result;
if (!mPresShell)
return NS_ERROR_FAILURE;
LOCK_DOC(this);
result = mPresShell->ScrollSelectionIntoView(SELECTION_NORMAL, SELECTION_FOCUS_REGION);
UNLOCK_DOC(this);
return result;
}
NS_IMETHODIMP
nsTextServicesDocument::DeleteSelection()
{

Просмотреть файл

@ -114,6 +114,7 @@ public:
NS_IMETHOD NextBlock();
NS_IMETHOD IsDone(PRBool *aIsDone);
NS_IMETHOD SetSelection(PRInt32 aOffset, PRInt32 aLength);
NS_IMETHOD ScrollSelectionIntoView();
NS_IMETHOD DeleteSelection();
NS_IMETHOD InsertText(const nsString *aText);
NS_IMETHOD SetDisplayStyle(TSDDisplayStyle aStyle);

Просмотреть файл

@ -175,6 +175,12 @@ public:
NS_IMETHOD SetSelection(PRInt32 aOffset, PRInt32 aLength) = 0;
/**
* Scrolls the document so that the current selection is visible.
*/
NS_IMETHOD ScrollSelectionIntoView() = 0;
/**
* Deletes the text selected by SetSelection(). Calling
* DeleteSelection with nothing selected, or with a collapsed

Просмотреть файл

@ -1697,6 +1697,23 @@ nsTextServicesDocument::SetSelection(PRInt32 aOffset, PRInt32 aLength)
return result;
}
NS_IMETHODIMP
nsTextServicesDocument::ScrollSelectionIntoView()
{
nsresult result;
if (!mPresShell)
return NS_ERROR_FAILURE;
LOCK_DOC(this);
result = mPresShell->ScrollSelectionIntoView(SELECTION_NORMAL, SELECTION_FOCUS_REGION);
UNLOCK_DOC(this);
return result;
}
NS_IMETHODIMP
nsTextServicesDocument::DeleteSelection()
{

Просмотреть файл

@ -114,6 +114,7 @@ public:
NS_IMETHOD NextBlock();
NS_IMETHOD IsDone(PRBool *aIsDone);
NS_IMETHOD SetSelection(PRInt32 aOffset, PRInt32 aLength);
NS_IMETHOD ScrollSelectionIntoView();
NS_IMETHOD DeleteSelection();
NS_IMETHOD InsertText(const nsString *aText);
NS_IMETHOD SetDisplayStyle(TSDDisplayStyle aStyle);