Wt examples
3.2.1
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
build
witty-Mvbd8A
witty-3.2.1
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
namespace
{
14
WSuggestionPopup::Options
contactOptions
15
= {
"<b>"
,
// highlightBeginTag
16
"</b>"
,
// highlightEndTag
17
','
,
// listSeparator
18
" \\n"
,
// whitespace
19
"-., \"@\\n;"
,
// wordSeparators
20
", "
// appendReplacedText
21
};
22
}
23
24
ContactSuggestions::ContactSuggestions
(
WContainerWidget
*parent)
25
:
WSuggestionPopup
(
WSuggestionPopup
::generateMatcherJS(contactOptions),
26
WSuggestionPopup
::generateReplacerJS(contactOptions),
27
parent)
28
{ }
29
30
void
ContactSuggestions::setAddressBook
(
const
std::vector<Contact>& contacts)
31
{
32
clearSuggestions
();
33
34
for
(
unsigned
i = 0; i < contacts.size(); ++i)
35
addSuggestion
(contacts[i].formatted(), contacts[i].formatted());
36
}
Generated on Sat Oct 18 2014 for
the C++ Web Toolkit (Wt)
by
1.8.1.2