Added nsXPBaseWindowType for creating either a Window or Dialog
git-svn-id: svn://10.0.0.236/trunk@13995 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -41,18 +41,30 @@ struct nsRect;
|
||||
#define NS_XPBASE_WINDOW_CID \
|
||||
{ 0x36c1fe51, 0x6f3e, 0x11d2, { 0x8d, 0xca, 0x0, 0x60, 0x97, 0x3, 0xc1, 0x4e } }
|
||||
|
||||
enum nsXPBaseWindowType {
|
||||
///creates a window
|
||||
eXPBaseWindowType_window,
|
||||
///creates a dialog
|
||||
eXPBaseWindowType_dialog,
|
||||
///creates a modal dialog
|
||||
eXPBaseWindowType_modalDialog,
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* API to a "XP window"
|
||||
*/
|
||||
class nsIXPBaseWindow : public nsISupports {
|
||||
public:
|
||||
NS_IMETHOD Init(nsIAppShell* aAppShell,
|
||||
nsIPref* aPrefs,
|
||||
const nsString& aDialogURL,
|
||||
const nsString& aTitle,
|
||||
const nsRect& aBounds,
|
||||
PRUint32 aChromeMask,
|
||||
PRBool aAllowPlugins = PR_TRUE) = 0;
|
||||
NS_IMETHOD Init(nsXPBaseWindowType aType,
|
||||
nsIAppShell* aAppShell,
|
||||
nsIPref* aPrefs,
|
||||
const nsString& aDialogURL,
|
||||
const nsString& aTitle,
|
||||
const nsRect& aBounds,
|
||||
PRUint32 aChromeMask,
|
||||
PRBool aAllowPlugins = PR_TRUE) = 0;
|
||||
|
||||
NS_IMETHOD SetLocation(PRInt32 aX, PRInt32 aY) = 0;
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ static NS_DEFINE_IID(kIToolbarItemIID, NS_ITOOLBARITEM_IID);
|
||||
static NS_DEFINE_IID(kIPopUpMenuIID, NS_IPOPUPMENU_IID);
|
||||
static NS_DEFINE_IID(kIMenuButtonIID, NS_IMENUBUTTON_IID);
|
||||
static NS_DEFINE_IID(kIXPBaseWindowIID, NS_IXPBASE_WINDOW_IID);
|
||||
//static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
|
||||
static const char* gsAOLFormat = "AOLMAIL";
|
||||
static const char* gsHTMLFormat = "text/html";
|
||||
@@ -1070,7 +1070,7 @@ void nsBrowserWindow::DoFind()
|
||||
kIXPBaseWindowIID,
|
||||
(void**) &dialog);
|
||||
if (rv == NS_OK) {
|
||||
dialog->Init(eXPBaseWindowType_window, mAppShell, nsnull, findHTML, title, rect, PRUint32(~0), PR_FALSE);
|
||||
dialog->Init(eXPBaseWindowType_dialog, mAppShell, nsnull, findHTML, title, rect, PRUint32(~0), PR_FALSE);
|
||||
dialog->SetVisible(PR_TRUE);
|
||||
if (NS_OK == dialog->QueryInterface(kIXPBaseWindowIID, (void**) &mXPDialog)) {
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ static NS_DEFINE_IID(kIDOMMouseListenerIID, NS_IDOMMOUSELISTENER_IID);
|
||||
static NS_DEFINE_IID(kIDOMEventReceiverIID, NS_IDOMEVENTRECEIVER_IID);
|
||||
static NS_DEFINE_IID(kIDOMElementIID, NS_IDOMELEMENT_IID);
|
||||
|
||||
//static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
nsXPBaseWindow::nsXPBaseWindow() :
|
||||
@@ -209,10 +209,10 @@ nsresult nsXPBaseWindow::Init(nsXPBaseWindowType aType,
|
||||
// Create top level window
|
||||
nsresult rv;
|
||||
if (aType == eXPBaseWindowType_window) {
|
||||
nsRepository::CreateInstance(kWindowCID, nsnull, kIWidgetIID,
|
||||
rv = nsRepository::CreateInstance(kWindowCID, nsnull, kIWidgetIID,
|
||||
(void**)&mWindow);
|
||||
} else {
|
||||
nsRepository::CreateInstance(kDialogCID, nsnull, kIWidgetIID,
|
||||
rv= nsRepository::CreateInstance(kDialogCID, nsnull, kIWidgetIID,
|
||||
(void**)&mWindow);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user