Wt examples
4.0.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
public-git
wt
examples
composer
ContactSuggestions.C
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
3
*
4
* See the LICENSE file for terms of use.
5
*/
6
7
#include <boost/lexical_cast.hpp>
8
9
#include "
ContactSuggestions.h
"
10
#include "
AddresseeEdit.h
"
11
#include "
Contact.h
"
12
13
#include <Wt/WContainerWidget.h>
14
15
namespace
{
16
WSuggestionPopup::Options contactOptions
17
= {
"<b>"
,
// highlightBeginTag
18
"</b>"
,
// highlightEndTag
19
','
,
// listSeparator
20
" \\n"
,
// whitespace
21
"-., \"@\\n;"
,
// wordSeparators
22
", "
// appendReplacedText
23
};
24
}
25
26
ContactSuggestions::ContactSuggestions
()
27
:
WSuggestionPopup
(
WSuggestionPopup
::generateMatcherJS(contactOptions),
28
WSuggestionPopup
::generateReplacerJS(contactOptions))
29
{ }
30
31
void
ContactSuggestions::setAddressBook
(
const
std::vector<Contact>& contacts)
32
{
33
clearSuggestions
();
34
35
for
(
auto
contact : contacts)
36
addSuggestion
(contact.formatted(), contact.formatted());
37
}
Wt::WSuggestionPopup::addSuggestion
void addSuggestion(const WString &suggestionText, const WString &suggestionValue=WString::Empty)
Contact.h
ContactSuggestions.h
ContactSuggestions::setAddressBook
void setAddressBook(const std::vector< Contact > &contacts)
Set the address book.
Definition:
ContactSuggestions.C:31
Wt::WSuggestionPopup
Wt::WSuggestionPopup::clearSuggestions
void clearSuggestions()
AddresseeEdit.h
ContactSuggestions::ContactSuggestions
ContactSuggestions()
Create a new ContactSuggestions popup.
Definition:
ContactSuggestions.C:26
Generated on Mon Sep 4 2017 for
the C++ Web Toolkit (Wt)
by
1.8.11