Go to the documentation of this file.00001
00002
00003
00004
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>",
00016 "</b>",
00017 ',',
00018 " \\n",
00019 "-., \"@\\n;",
00020 ", "
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 }