forked from BlackIkeEagle/muttvcardsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
searchtemplates.cpp
38 lines (34 loc) · 1.54 KB
/
searchtemplates.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "searchtemplates.h"
SearchTemplates::SearchTemplates()
{
exportTemplate = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
exportTemplate += "<propfind xmlns=\"DAV:\" xmlns:CS=\"http://calendarserver.org/ns/\">";
exportTemplate += "<prop>";
exportTemplate += "<CS:getctag/>";
exportTemplate += "</prop>";
exportTemplate += "</propfind>";
searchTemplate = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
searchTemplate += "<C:addressbook-query xmlns:D=\"DAV:\" xmlns:C=\"urn:ietf:params:xml:ns:carddav\">";
searchTemplate += "<D:prop>";
searchTemplate += "<D:getetag/>";
searchTemplate += "<C:address-data>";
searchTemplate += "<C:prop name=\"EMAIL\"/>";
searchTemplate += "<C:prop name=\"FN\"/>";
searchTemplate += "</C:address-data>";
searchTemplate += "</D:prop>";
searchTemplate += "<C:filter test=\"anyof\">";
searchTemplate += "<C:prop-filter name=\"FN\">";
searchTemplate += "<C:text-match collation=\"i;unicode-casemap\" match-type=\"contains\">%s</C:text-match>";
searchTemplate += "</C:prop-filter>";
searchTemplate += "<C:prop-filter name=\"EMAIL\">";
searchTemplate += "<C:text-match collation=\"i;unicode-casemap\" match-type=\"contains\">%s</C:text-match>";
searchTemplate += "</C:prop-filter>";
searchTemplate += "</C:filter>";
searchTemplate += "</C:addressbook-query>";
}
std::string SearchTemplates::getDefaultExportTemplate() const {
return exportTemplate;
}
std::string SearchTemplates::getDefaultSearchTemplate() const {
return searchTemplate;
}