nsNSSDialogHelper.h (1218B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef nsNSSDialogHelper_h 8 #define nsNSSDialogHelper_h 9 10 #include "nsError.h" 11 12 class mozIDOMWindowProxy; 13 class nsISupports; 14 15 /** 16 * Helper class that uses the window watcher service to open a standard dialog, 17 * with or without a parent context. 18 */ 19 class nsNSSDialogHelper { 20 public: 21 /** 22 * Opens a XUL dialog. 23 * 24 * @param window 25 * Parent window of the dialog, or nullptr to signal no parent. 26 * @param url 27 * URL to the XUL dialog. 28 * @param params 29 * Parameters to pass to the dialog. Same semantics as the 30 * nsIWindowWatcher.openWindow() |aArguments| parameter. 31 * @param modal 32 * true if the dialog should be modal, false otherwise. 33 * @return The result of opening the dialog. 34 */ 35 static nsresult openDialog(mozIDOMWindowProxy* window, const char* url, 36 nsISupports* params, bool modal = true); 37 }; 38 39 #endif // nsNSSDialogHelper_h