mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-05-13 08:57:27 +00:00
Added selection APIs
This commit is contained in:
parent
52c0173a9c
commit
f6c56f3956
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user