This patch is actually part of Bug 115136, but I think its best to get this part
of it in now before the API freeze. It adds several new attrs to the nsIWebBrowserPrint API and implments them in DocumentViewer. It also adds a new platform specific interface for PrintSettings that will be used when the "pluggable" dialog work gets checked in. Although these have been tested via BUg 115136, these little nto no risk now because no one is using them yet. Bug 132827 r=dcone sr=attinasi a=asa git-svn-id: svn://10.0.0.236/trunk@117396 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
a7953d7749
commit
15f33efd46
@ -5295,6 +5295,46 @@ DocumentViewerImpl::GetIsFramesetDocument(PRBool *aIsFramesetDocument)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isIFrameSelected; */
|
||||
NS_IMETHODIMP
|
||||
DocumentViewerImpl::GetIsIFrameSelected(PRBool *aIsIFrameSelected)
|
||||
{
|
||||
*aIsIFrameSelected = PR_FALSE;
|
||||
|
||||
// Get the webshell for this documentviewer
|
||||
nsCOMPtr<nsIWebShell> webContainer(do_QueryInterface(mContainer));
|
||||
// Get the currently focused window
|
||||
nsCOMPtr<nsIDOMWindowInternal> currentFocusWin = getter_AddRefs(FindFocusedDOMWindowInternal());
|
||||
if (currentFocusWin && webContainer) {
|
||||
// Get whether the doc contains a frameset
|
||||
// Also, check to see if the currently focus webshell
|
||||
// is a child of this webshell
|
||||
PRPackedBool isParentFrameSet;
|
||||
*aIsIFrameSelected = IsThereAnIFrameSelected(webContainer, currentFocusWin, isParentFrameSet);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isRangeSelection; */
|
||||
NS_IMETHODIMP
|
||||
DocumentViewerImpl::GetIsRangeSelection(PRBool *aIsRangeSelection)
|
||||
{
|
||||
// Get the currently focused window
|
||||
nsCOMPtr<nsIDOMWindowInternal> currentFocusWin = getter_AddRefs(FindFocusedDOMWindowInternal());
|
||||
*aIsRangeSelection = IsThereARangeSelection(currentFocusWin);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isFramesetFrameSelected; */
|
||||
NS_IMETHODIMP
|
||||
DocumentViewerImpl::GetIsFramesetFrameSelected(PRBool *aIsFramesetFrameSelected)
|
||||
{
|
||||
// Get the currently focused window
|
||||
nsCOMPtr<nsIDOMWindowInternal> currentFocusWin = getter_AddRefs(FindFocusedDOMWindowInternal());
|
||||
*aIsFramesetFrameSelected = currentFocusWin != nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute long printPreviewNumPages; */
|
||||
NS_IMETHODIMP
|
||||
DocumentViewerImpl::GetPrintPreviewNumPages(PRInt32 *aPrintPreviewNumPages)
|
||||
|
||||
@ -141,6 +141,21 @@ interface nsIWebBrowserPrint : nsISupports
|
||||
*/
|
||||
readonly attribute boolean isFramesetDocument;
|
||||
|
||||
/**
|
||||
* This returns whether the current document is a frameset document
|
||||
*/
|
||||
readonly attribute boolean isFramesetFrameSelected;
|
||||
|
||||
/**
|
||||
* This returns whether there is an IFrame selected
|
||||
*/
|
||||
readonly attribute boolean isIFrameSelected;
|
||||
|
||||
/**
|
||||
* This returns whether there is a "range" selection
|
||||
*/
|
||||
readonly attribute boolean isRangeSelection;
|
||||
|
||||
/**
|
||||
* This returns the total number of pages for the Print Preview
|
||||
*/
|
||||
|
||||
@ -5295,6 +5295,46 @@ DocumentViewerImpl::GetIsFramesetDocument(PRBool *aIsFramesetDocument)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isIFrameSelected; */
|
||||
NS_IMETHODIMP
|
||||
DocumentViewerImpl::GetIsIFrameSelected(PRBool *aIsIFrameSelected)
|
||||
{
|
||||
*aIsIFrameSelected = PR_FALSE;
|
||||
|
||||
// Get the webshell for this documentviewer
|
||||
nsCOMPtr<nsIWebShell> webContainer(do_QueryInterface(mContainer));
|
||||
// Get the currently focused window
|
||||
nsCOMPtr<nsIDOMWindowInternal> currentFocusWin = getter_AddRefs(FindFocusedDOMWindowInternal());
|
||||
if (currentFocusWin && webContainer) {
|
||||
// Get whether the doc contains a frameset
|
||||
// Also, check to see if the currently focus webshell
|
||||
// is a child of this webshell
|
||||
PRPackedBool isParentFrameSet;
|
||||
*aIsIFrameSelected = IsThereAnIFrameSelected(webContainer, currentFocusWin, isParentFrameSet);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isRangeSelection; */
|
||||
NS_IMETHODIMP
|
||||
DocumentViewerImpl::GetIsRangeSelection(PRBool *aIsRangeSelection)
|
||||
{
|
||||
// Get the currently focused window
|
||||
nsCOMPtr<nsIDOMWindowInternal> currentFocusWin = getter_AddRefs(FindFocusedDOMWindowInternal());
|
||||
*aIsRangeSelection = IsThereARangeSelection(currentFocusWin);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isFramesetFrameSelected; */
|
||||
NS_IMETHODIMP
|
||||
DocumentViewerImpl::GetIsFramesetFrameSelected(PRBool *aIsFramesetFrameSelected)
|
||||
{
|
||||
// Get the currently focused window
|
||||
nsCOMPtr<nsIDOMWindowInternal> currentFocusWin = getter_AddRefs(FindFocusedDOMWindowInternal());
|
||||
*aIsFramesetFrameSelected = currentFocusWin != nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute long printPreviewNumPages; */
|
||||
NS_IMETHODIMP
|
||||
DocumentViewerImpl::GetPrintPreviewNumPages(PRInt32 *aPrintPreviewNumPages)
|
||||
|
||||
@ -903,6 +903,27 @@ PluginViewerImpl::GetIsFramesetDocument(PRBool *aIsFramesetDocument)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isIFrameSelected; */
|
||||
NS_IMETHODIMP
|
||||
PluginViewerImpl::GetIsIFrameSelected(PRBool *aIsIFrameSelected)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isRangeSelection; */
|
||||
NS_IMETHODIMP
|
||||
PluginViewerImpl::GetIsRangeSelection(PRBool *aIsRangeSelection)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isFramesetFrameSelected; */
|
||||
NS_IMETHODIMP
|
||||
PluginViewerImpl::GetIsFramesetFrameSelected(PRBool *aIsFramesetFrameSelected)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* readonly attribute long printPreviewNumPages; */
|
||||
NS_IMETHODIMP
|
||||
PluginViewerImpl::GetPrintPreviewNumPages(PRInt32 *aPrintPreviewNumPages)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user