Wt examples  3.2.1
/home/koen/project/wt/public-git/wt/examples/composer/ContactSuggestions.C
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
00003  *
00004  * See the LICENSE file for terms of use.
00005  */
00006 
00007 #include <boost/lexical_cast.hpp>
00008 
00009 #include "ContactSuggestions.h"
00010 #include "AddresseeEdit.h"
00011 #include "Contact.h"
00012 
00013 namespace {
00014   WSuggestionPopup::Options contactOptions
00015   = { "<b>",         // highlightBeginTag
00016       "</b>",        // highlightEndTag
00017       ',',           // listSeparator
00018       " \\n",        // whitespace
00019       "-., \"@\\n;", // wordSeparators
00020       ", "           // appendReplacedText
00021     };
00022 }
00023 
00024 ContactSuggestions::ContactSuggestions(WContainerWidget *parent)
00025   : WSuggestionPopup(WSuggestionPopup::generateMatcherJS(contactOptions),
00026                      WSuggestionPopup::generateReplacerJS(contactOptions),
00027                      parent)
00028 { }
00029 
00030 void ContactSuggestions::setAddressBook(const std::vector<Contact>& contacts)
00031 {
00032   clearSuggestions();
00033 
00034   for (unsigned i = 0; i < contacts.size(); ++i)
00035     addSuggestion(contacts[i].formatted(), contacts[i].formatted());
00036 }

Generated on Fri Mar 30 2012 for the C++ Web Toolkit (Wt) by doxygen 1.7.5.1