diff --git a/docshell/base/nsWebShell.cpp b/docshell/base/nsWebShell.cpp index 589d2413aea9..c768410e3c9b 100644 --- a/docshell/base/nsWebShell.cpp +++ b/docshell/base/nsWebShell.cpp @@ -218,6 +218,16 @@ public: NS_IMETHOD OnStatus(nsIURL* aURL, const nsString &aMsg); NS_IMETHOD OnStopBinding(nsIURL* aURL, PRInt32 aStatus, const nsString &aMsg); + // Selection methods + NS_IMETHOD IsSelection(PRBool & aIsSelection); + NS_IMETHOD IsSelectionCutable(PRBool & aIsSelection); + NS_IMETHOD IsSelectionPastable(PRBool & aIsSelection); + NS_IMETHOD GetSelection(PRUnichar *& aSelection); + NS_IMETHOD CutSelection(PRUnichar *& aSelection); + NS_IMETHOD PasteSelection(const PRUnichar * aSelection); + NS_IMETHOD SelectAll(); + NS_IMETHOD FindNext(const PRUnichar * aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound); + // nsWebShell void HandleLinkClickEvent(const PRUnichar* aURLSpec, const PRUnichar* aTargetSpec, @@ -1881,6 +1891,68 @@ nsWebShell::OnStopBinding(nsIURL* aURL, PRInt32 aStatus, const nsString &aMsg) return rv; } +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::IsSelection(PRBool & aIsSelection) +{ + aIsSelection = PR_FALSE; + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::IsSelectionCutable(PRBool & aIsSelection) +{ + aIsSelection = PR_FALSE; + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::IsSelectionPastable(PRBool & aIsSelection) +{ + aIsSelection = PR_FALSE; + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::GetSelection(PRUnichar *& aSelection) +{ + aSelection = nsnull; + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::CutSelection(PRUnichar *& aSelection) +{ + aSelection = nsnull; + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::PasteSelection(const PRUnichar * aSelection) +{ + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::SelectAll() +{ + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::FindNext(const PRUnichar * aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound) +{ + return NS_ERROR_FAILURE; +} + + //---------------------------------------------------------------------- // Factory code for creating nsWebShell's diff --git a/webshell/public/nsIWebShell.h b/webshell/public/nsIWebShell.h index b4a0455c73e5..3963e7ba6afb 100644 --- a/webshell/public/nsIWebShell.h +++ b/webshell/public/nsIWebShell.h @@ -172,6 +172,47 @@ public: NS_IMETHOD GetMarginHeight(PRInt32& aWidth) = 0; NS_IMETHOD SetMarginHeight(PRInt32 aHeight) = 0; + // Selection Related Methods + /** + * Returns the whether there is a selection or not + */ + NS_IMETHOD IsSelection(PRBool & aIsSelection) = 0; + + /** + * Returns the whether the selection can be cut (editor or a form control) + */ + NS_IMETHOD IsSelectionCutable(PRBool & aIsSelection) = 0; + + /** + * Returns whether the data can be pasted (editor or a form control) + */ + NS_IMETHOD IsSelectionPastable(PRBool & aIsSelection) = 0; + + /** + * Copies the Selection from the content or a form control + */ + NS_IMETHOD GetSelection(PRUnichar *& aSelection) = 0; + + /** + * Cuts the Selection from the content or a form control + */ + NS_IMETHOD CutSelection(PRUnichar *& aSelection) = 0; + + /** + * Pastes the Selection into the content or a form control + */ + NS_IMETHOD PasteSelection(const PRUnichar * aSelection) = 0; + + /** + * Selects all the Content + */ + NS_IMETHOD SelectAll() = 0; + + /** + * Finds text in content + */ + NS_IMETHOD FindNext(const PRUnichar * aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound) = 0; + }; extern "C" NS_WEB nsresult diff --git a/webshell/src/nsWebShell.cpp b/webshell/src/nsWebShell.cpp index 589d2413aea9..c768410e3c9b 100644 --- a/webshell/src/nsWebShell.cpp +++ b/webshell/src/nsWebShell.cpp @@ -218,6 +218,16 @@ public: NS_IMETHOD OnStatus(nsIURL* aURL, const nsString &aMsg); NS_IMETHOD OnStopBinding(nsIURL* aURL, PRInt32 aStatus, const nsString &aMsg); + // Selection methods + NS_IMETHOD IsSelection(PRBool & aIsSelection); + NS_IMETHOD IsSelectionCutable(PRBool & aIsSelection); + NS_IMETHOD IsSelectionPastable(PRBool & aIsSelection); + NS_IMETHOD GetSelection(PRUnichar *& aSelection); + NS_IMETHOD CutSelection(PRUnichar *& aSelection); + NS_IMETHOD PasteSelection(const PRUnichar * aSelection); + NS_IMETHOD SelectAll(); + NS_IMETHOD FindNext(const PRUnichar * aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound); + // nsWebShell void HandleLinkClickEvent(const PRUnichar* aURLSpec, const PRUnichar* aTargetSpec, @@ -1881,6 +1891,68 @@ nsWebShell::OnStopBinding(nsIURL* aURL, PRInt32 aStatus, const nsString &aMsg) return rv; } +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::IsSelection(PRBool & aIsSelection) +{ + aIsSelection = PR_FALSE; + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::IsSelectionCutable(PRBool & aIsSelection) +{ + aIsSelection = PR_FALSE; + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::IsSelectionPastable(PRBool & aIsSelection) +{ + aIsSelection = PR_FALSE; + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::GetSelection(PRUnichar *& aSelection) +{ + aSelection = nsnull; + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::CutSelection(PRUnichar *& aSelection) +{ + aSelection = nsnull; + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::PasteSelection(const PRUnichar * aSelection) +{ + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::SelectAll() +{ + return NS_ERROR_FAILURE; +} + +//---------------------------------------------------- +NS_IMETHODIMP +nsWebShell::FindNext(const PRUnichar * aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound) +{ + return NS_ERROR_FAILURE; +} + + //---------------------------------------------------------------------- // Factory code for creating nsWebShell's