Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Initial import of code already done for Xestia Address Book
[xestiaab/.git] / source / common / getcontactinfo.cpp~
1 #include <iostream>
2 #include "getcontactinfo.h"
3 #include <wx/wx.h>
5 void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj){
6   
7     wxString strPageHeader;
8     wxString strPageFooter;
9     wxString strPageData;
10     wxString strFinal;
11     wxString strvCardData;
12   
13     strPageHeader = wxT("<html>\n\t<body>");
14     strPageFooter = wxT("\n\t</body>\n</html>");
15     
16     // Get the full name of the contact.
17     
18     strvCardData = vCardObj->Get(wxT("FN"));
19     
20     strPageData = wxT("<h2>") + strvCardData + wxT("</h2>");
21     strPageData.Append(wxT("<br><br>"));
22         
23     // Get nickname.
24     
25     strvCardData = vCardObj->Get(wxT("NICKNAME"));
26     
27     if (!strvCardData.IsEmpty()){
28     
29         strPageData.Append(wxT("Nickname: "));
30         strPageData.Append(strvCardData);
31         strPageData.Append(wxT("<br><br>"));
32     
33     }
34     
35     strvCardData = vCardObj->Get(wxT("TITLE"));
36     
37     if (!strvCardData.IsEmpty()){
38     
39         strPageData.Append(wxT("Title: "));
40         strPageData.Append(strvCardData);
41         strPageData.Append(wxT("<br><br>"));    
42     
43     }
44     
45     strvCardData = vCardObj->Get(wxT("ROLE"));
46     
47     if (!strvCardData.IsEmpty()){
48     
49         strPageData.Append(wxT("Role: "));
50         strPageData.Append(strvCardData);
51         strPageData.Append(wxT("<br><br>"));    
52     
53     }
54     
55     strvCardData = vCardObj->Get(wxT("GENDER"));
56     
57     if (!strvCardData.IsEmpty()){
58     
59         strPageData.Append(wxT("Gender: "));
60         
61         if (strvCardData == wxT("M")){
62             strPageData.Append(wxT("Male"));
63         } else if (strvCardData == wxT("F")){
64             strPageData.Append(wxT("Female"));
65         } else if (strvCardData == wxT("O")){
66             strPageData.Append(wxT("Other"));
67         } else if (strvCardData == wxT("N")){
68             strPageData.Append(wxT("None/Not Applicable"));
69         } else if (strvCardData == wxT("U")){
70             strPageData.Append(wxT("Unknown"));
71         }
72         
73         strPageData.Append(wxT("<br><br>"));    
74     
75     }    
76     
77     strFinal = strPageHeader + strPageData + strPageFooter;
78     
79     HTMLObj->SetPage(strFinal);
81 }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy