Wt examples  3.2.1
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 
25  : WSuggestionPopup(WSuggestionPopup::generateMatcherJS(contactOptions),
26  WSuggestionPopup::generateReplacerJS(contactOptions),
27  parent)
28 { }
29 
30 void ContactSuggestions::setAddressBook(const std::vector<Contact>& contacts)
31 {
33 
34  for (unsigned i = 0; i < contacts.size(); ++i)
35  addSuggestion(contacts[i].formatted(), contacts[i].formatted());
36 }

Generated on Mon Jun 18 2012 for the C++ Web Toolkit (Wt) by doxygen 1.8.1