2014-10-31 18:17:05 +00:00
|
|
|
// Copyright (c) 2013 GitHub, Inc.
|
2014-04-25 09:49:37 +00:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
2013-05-03 13:03:26 +00:00
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2014-03-16 00:58:59 +00:00
|
|
|
#ifndef ATOM_BROWSER_UI_MESSAGE_BOX_H_
|
|
|
|
#define ATOM_BROWSER_UI_MESSAGE_BOX_H_
|
2013-05-03 13:03:26 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2013-09-22 09:11:09 +00:00
|
|
|
#include "base/callback_forward.h"
|
2014-11-05 08:04:39 +00:00
|
|
|
#include "base/strings/string16.h"
|
2013-09-22 09:11:09 +00:00
|
|
|
|
2015-01-05 23:08:42 +00:00
|
|
|
namespace gfx {
|
|
|
|
class ImageSkia;
|
|
|
|
}
|
|
|
|
|
2013-05-03 13:03:26 +00:00
|
|
|
namespace atom {
|
|
|
|
|
2013-06-07 07:59:12 +00:00
|
|
|
class NativeWindow;
|
|
|
|
|
2013-05-03 13:03:26 +00:00
|
|
|
enum MessageBoxType {
|
|
|
|
MESSAGE_BOX_TYPE_NONE = 0,
|
|
|
|
MESSAGE_BOX_TYPE_INFORMATION,
|
2015-07-07 08:52:53 +00:00
|
|
|
MESSAGE_BOX_TYPE_WARNING,
|
|
|
|
MESSAGE_BOX_TYPE_ERROR,
|
|
|
|
MESSAGE_BOX_TYPE_QUESTION,
|
2013-05-03 13:03:26 +00:00
|
|
|
};
|
|
|
|
|
2015-07-23 06:16:43 +00:00
|
|
|
enum MessageBoxOptions {
|
2015-07-23 09:20:43 +00:00
|
|
|
MESSAGE_BOX_NONE = 0,
|
|
|
|
MESSAGE_BOX_NO_LINK = 1 << 0,
|
2015-07-23 06:16:43 +00:00
|
|
|
};
|
|
|
|
|
2013-09-23 09:27:32 +00:00
|
|
|
typedef base::Callback<void(int code)> MessageBoxCallback;
|
2013-09-22 09:11:09 +00:00
|
|
|
|
2013-06-07 07:59:12 +00:00
|
|
|
int ShowMessageBox(NativeWindow* parent_window,
|
|
|
|
MessageBoxType type,
|
2013-05-03 13:03:26 +00:00
|
|
|
const std::vector<std::string>& buttons,
|
2016-01-10 23:33:27 +00:00
|
|
|
int default_id,
|
2017-01-05 01:28:50 +00:00
|
|
|
int cancel_id,
|
2015-07-23 06:16:43 +00:00
|
|
|
int options,
|
2013-05-03 13:03:26 +00:00
|
|
|
const std::string& title,
|
|
|
|
const std::string& message,
|
2015-01-05 23:08:42 +00:00
|
|
|
const std::string& detail,
|
|
|
|
const gfx::ImageSkia& icon);
|
2013-05-03 13:03:26 +00:00
|
|
|
|
2013-09-22 09:11:09 +00:00
|
|
|
void ShowMessageBox(NativeWindow* parent_window,
|
|
|
|
MessageBoxType type,
|
|
|
|
const std::vector<std::string>& buttons,
|
2016-01-10 23:33:27 +00:00
|
|
|
int default_id,
|
2015-07-07 10:26:50 +00:00
|
|
|
int cancel_id,
|
2015-07-23 06:16:43 +00:00
|
|
|
int options,
|
2013-09-22 09:11:09 +00:00
|
|
|
const std::string& title,
|
|
|
|
const std::string& message,
|
|
|
|
const std::string& detail,
|
2015-01-05 23:08:42 +00:00
|
|
|
const gfx::ImageSkia& icon,
|
2013-09-22 09:11:09 +00:00
|
|
|
const MessageBoxCallback& callback);
|
|
|
|
|
2014-11-05 08:04:39 +00:00
|
|
|
// Like ShowMessageBox with simplest settings, but safe to call at very early
|
|
|
|
// stage of application.
|
|
|
|
void ShowErrorBox(const base::string16& title, const base::string16& content);
|
|
|
|
|
2013-05-03 13:03:26 +00:00
|
|
|
} // namespace atom
|
|
|
|
|
2014-03-16 00:58:59 +00:00
|
|
|
#endif // ATOM_BROWSER_UI_MESSAGE_BOX_H_
|