2
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; version 2 of the
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19
#ifndef _STUB_UTILITIES_H_
20
#define _STUB_UTILITIES_H_
22
#include "stub_mforms.h"
29
static boost::function<void (std::string)> open_url_slot;
31
static std::map<const std::string, std::string> passwords;
33
static int __stdcall show_message(const std::string &title, const std::string &text,
34
const std::string &ok, const std::string &cancel,
35
const std::string &other);
36
static int __stdcall show_error(const std::string &title, const std::string &text,
37
const std::string &ok, const std::string &cancel,
38
const std::string &other);
39
static int __stdcall show_warning(const std::string &title, const std::string &text,
40
const std::string &ok, const std::string &cancel,
41
const std::string &other);
42
static int __stdcall show_message_with_checkbox(const std::string &title, const std::string &text,
43
const std::string &ok, const std::string &cancel,
44
const std::string &other,
45
const std::string &checkbox_text, // empty text = default "Don't show this message again" text
46
bool &remember_checked);
48
static void __stdcall show_wait_message(const std::string &title, const std::string &text);
49
static bool __stdcall hide_wait_message();
50
static bool __stdcall run_cancelable_wait_message(const std::string &title, const std::string &text,
51
const boost::function<void ()> &start_task, const boost::function<bool ()> &cancel_task);
52
static void __stdcall stop_cancelable_wait_message();
54
static void __stdcall set_clipboard_text(const std::string &text);
55
static std::string __stdcall get_clipboard_text();
57
static std::string __stdcall get_special_folder(mforms::FolderType type);
60
static void __stdcall open_url(const std::string &url);
61
static void __stdcall add_timeout(float interval, const boost::function<bool ()> &slot);
63
static void __stdcall store_password(const std::string &service, const std::string &account, const std::string &password);
64
static bool __stdcall find_password(const std::string &service, const std::string &account, std::string &password);
65
static void __stdcall forget_password(const std::string &service, const std::string &account);
69
static void set_open_url_slot(const boost::function<void (std::string)> &slot);