本文整理汇总了C++中ekiga::Form::visit方法的典型用法代码示例。如果您正苦于以下问题:C++ Form::visit方法的具体用法?C++ Form::visit怎么用?C++ Form::visit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ekiga::Form
的用法示例。
在下文中一共展示了Form::visit方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: request
void
OPENLDAP::Source::on_new_book_form_submitted (bool submitted,
Ekiga::Form &result)
{
if (!submitted)
return;
std::string errmsg;
if (OPENLDAP::BookFormInfo (result, bookinfo, errmsg)) {
Ekiga::FormRequestSimple request(sigc::mem_fun (this, &OPENLDAP::Source::on_new_book_form_submitted));
result.visit (request);
request.error (errmsg);
if (!questions.handle_request (&request)) {
// FIXME: better error reporting
#ifdef __GNUC__
std::cout << "Unhandled form request in "
<< __PRETTY_FUNCTION__ << std::endl;
#endif
}
return;
}
add ();
save ();
}
示例2:
bool
OPENLDAP::Book::on_sasl_form_submitted (bool submitted,
Ekiga::Form &result,
std::string &/*error*/)
{
if (!submitted)
return false;
result.visit (*saslform);
return true;
}
示例3: if
void Opal::Bank::on_new_account_form_submitted (Ekiga::Form &result,
Account::Type t)
{
try {
Ekiga::FormRequestSimple request;
std::string error;
std::string new_name = (t == Opal::Account::SIP || t == Opal::Account::H323) ? result.text ("name") : result.hidden ("name");
std::string new_host = (t == Opal::Account::SIP || t == Opal::Account::H323) ? result.text ("host") : result.hidden ("host");
std::string new_user = result.text ("user");
std::string new_authentication_user = (t == Opal::Account::SIP) ? result.text ("authentication_user") : new_user;
std::string new_password = result.private_text ("password");
bool new_enabled = result.boolean ("enabled");
unsigned new_timeout = atoi ((t == Opal::Account::SIP || t == Opal::Account::H323) ?
result.text ("timeout").c_str () : result.hidden ("timeout").c_str ());
result.visit (request);
if (new_name.empty ())
error = _("You did not supply a name for that account.");
else if (new_host.empty ())
error = _("You did not supply a host to register to.");
else if (new_user.empty ())
error = _("You did not supply a user name for that account.");
else if (new_timeout < 10)
error = _("The timeout should have a bigger value.");
if (!error.empty ()) {
request.error (error);
request.submitted.connect (sigc::bind (sigc::mem_fun (this, &Opal::Bank::on_new_account_form_submitted) ,t));
if (!questions.handle_request (&request)) {
#ifdef __GNUC__
std::cout << "Unhandled form request in "
<< __PRETTY_FUNCTION__ << std::endl;
#endif
}
}
else {
add (t, new_name, new_host, new_user, new_authentication_user, new_password, new_enabled, new_timeout);
save ();
}
} catch (Ekiga::Form::not_found) {
std::cerr << "Invalid result form" << std::endl;
}
}
示例4: request
void
Local::Heap::new_presentity_form_submitted (bool submitted,
Ekiga::Form &result)
{
if (!submitted)
return;
gmref_ptr<Ekiga::PresenceCore> presence_core = core.get ("presence-core");
const std::string name = result.text ("name");
const std::string good_uri = result.hidden ("good-uri");
std::string uri;
const std::set<std::string> groups = result.editable_set ("groups");
if (good_uri == "yes")
uri = result.hidden ("uri");
else
uri = result.text ("uri");
size_t pos = uri.find_first_of (' ');
if (pos != std::string::npos)
uri = uri.substr (0, pos);
if (presence_core->is_supported_uri (uri)
&& !has_presentity_with_uri (uri)) {
add (name, uri, groups);
save ();
} else {
Ekiga::FormRequestSimple request(sigc::mem_fun (this, &Local::Heap::new_presentity_form_submitted));
result.visit (request);
if (!presence_core->is_supported_uri (uri))
request.error (_("You supplied an unsupported address"));
else
request.error (_("You already have a contact with this address!"));
if (!questions.handle_request (&request)) {
// FIXME: better error handling
#ifdef __GNUC__
std::cout << "Unhandled form request in "
<< __PRETTY_FUNCTION__ << std::endl;
#endif
}
}
}
示例5: if
void Opal::Bank::on_new_account_form_submitted (bool submitted,
Ekiga::Form &result,
Account::Type acc_type)
{
if (!submitted)
return;
boost::shared_ptr<Ekiga::FormRequestSimple> request = boost::shared_ptr<Ekiga::FormRequestSimple> (new Ekiga::FormRequestSimple (boost::bind (&Opal::Bank::on_new_account_form_submitted, this, _1, _2, acc_type)));
std::string error;
std::string new_name = (acc_type == Opal::Account::SIP
|| acc_type == Opal::Account::H323) ? result.text ("name") : result.hidden ("name");
std::string new_host = (acc_type == Opal::Account::SIP
|| acc_type == Opal::Account::H323) ? result.text ("host") : result.hidden ("host");
std::string new_user = result.text ("user");
std::string new_authentication_user = (acc_type == Opal::Account::SIP) ? result.text ("authentication_user") : new_user;
std::string new_password = result.private_text ("password");
bool new_enabled = result.boolean ("enabled");
unsigned new_timeout = atoi ((acc_type == Opal::Account::SIP
|| acc_type == Opal::Account::H323) ?
result.text ("timeout").c_str () : result.hidden ("timeout").c_str ());
result.visit (*request);
if (new_name.empty ())
error = _("You did not supply a name for that account.");
else if (new_host.empty ())
error = _("You did not supply a host to register to.");
else if (new_user.empty ())
error = _("You did not supply a user name for that account.");
else if (new_timeout < 10)
error = _("The timeout should be at least 10 seconds.");
if (!error.empty ()) {
request->error (error);
questions (request);
}
else {
add (acc_type, new_name, new_host, new_user, new_authentication_user,
new_password, new_enabled, new_timeout);
save ();
}
}
示例6: add
void
Local::Heap::new_presentity_form_submitted (bool submitted,
Ekiga::Form &result)
{
if (!submitted)
return;
boost::shared_ptr<Ekiga::PresenceCore> pcore = presence_core.lock ();
if (!pcore)
return;
const std::string name = result.text ("name");
const std::string good_uri = result.hidden ("good-uri");
std::string uri;
const std::set<std::string> groups = result.editable_set ("groups");
if (good_uri == "yes")
uri = result.hidden ("uri");
else
uri = result.text ("uri");
uri = canonize_uri (uri);
if (pcore->is_supported_uri (uri)
&& !has_presentity_with_uri (uri)) {
add (name, uri, groups);
save ();
} else {
boost::shared_ptr<Ekiga::FormRequestSimple> request = boost::shared_ptr<Ekiga::FormRequestSimple>(new Ekiga::FormRequestSimple (boost::bind (&Local::Heap::new_presentity_form_submitted, this, _1, _2)));
result.visit (*request);
if (!pcore->is_supported_uri (uri))
request->error (_("You supplied an unsupported address"));
else
request->error (_("You already have a contact with this address!"));
questions (request);
}
}
示例7:
void
Ekiga::FormDumper::dump (const Ekiga::Form &form)
{
form.visit (*this);
}