X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcommon%2Fgetcontactinfo.cpp;h=2941aba67395e8328f52c3d416682708beef0e2a;hb=2cdadb5395d22642039184f48a8bfb880f4e7f30;hp=6c56df3b616e16a0d2c006b4b85727a156758072;hpb=45729fca56479bd9158486e0cda0c4a94b4dd1dc;p=xestiaab%2F.git diff --git a/source/common/getcontactinfo.cpp b/source/common/getcontactinfo.cpp index 6c56df3..2941aba 100644 --- a/source/common/getcontactinfo.cpp +++ b/source/common/getcontactinfo.cpp @@ -1,3 +1,21 @@ +// getcontactinfo.cpp - Contact Information subroutines. +// +// (c) 2012-2015 Xestia Software Development. +// +// This file is part of Xestia Address Book. +// +// Xestia Address Book is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by the +// Free Software Foundation, version 3 of the license. +// +// Xestia Address Book is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with Xestia Address Book. If not, see + #include #include #include @@ -18,12 +36,15 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, wxString OldSID, std::map *MemoryFSList){ + // Load the vCard contact data into the wxHTMLWindow given. + // Show message to user that the contact information is loading. + HTMLObj->SetBorders(0); + wxString PageData; wxFileSystem::AddHandler(new wxMemoryFSHandler); - //wxMemoryFSHandler::AddFile(); PageData.append(wxT("")); PageData.append(wxT("")); @@ -74,7 +95,6 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, // MAke sure new session ID doesn't conflict with existing // data. If there is a match, generate a new one and check again. - bool SIDMatch = FALSE; wxString SIDTemp; for (std::map::iterator striter = MemoryFSList->begin(); @@ -104,20 +124,32 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, PageData.append(wxT("")); PageData.append(wxT("Contact Information")); PageData.append(wxT("")); + + // Process the CSS section. + PageData.append(wxT("")); // Process the data in the vCard object. // Name (Display As) - PageData.append(wxT("")); + ArrayvCardOutData FNList; + FNList = vCardObj->GetByPartial(wxT("FN")); + + PageData.append(wxT("
")); PageData.append(wxT("")); - PageData.append(wxT("")); - PageData.append(wxT("
")); + PageData.append(wxT("")); PageData.append(wxT("

")); - PageData.append(vCardObj->Get(wxT("FN"))); + + if (FNList.PropCount > 0){ + FNList.PropValues[0].Trim(); + CaptureString(&FNList.PropValues[0], false); + PageData.append(FNList.PropValues[0]); + } + PageData.append(wxT("

")); PageData.append(wxT("
")); + PageData.append(wxT("")); // Define common variables for ADR. @@ -265,23 +297,6 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, } else { } - - /*int PointX = PointXBase; - int PointY = PointYBase; - int PointW = PointWBase; - int PointH = PointHBase;*/ - - // Bottom Left Method - - /*int PointX = wxAtoi(PhotoRectData.GetNextToken()); - int PointY = photo.GetHeight() - wxAtoi(PhotoRectData.GetNextToken()) - 340; - int PointW = wxAtoi(PhotoRectData.GetNextToken()); - int PointH = wxAtoi(PhotoRectData.GetNextToken());*/ - - // Bottom Right Method - - /*int PointXRemain = photo.GetWidth() - PointX - 140; - int PointYRemain = photo.GetHeight() - PointY - 140;*/ PhotoRectPoints.SetX(PointX); PhotoRectPoints.SetY(PointY); @@ -399,12 +414,13 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, ContactData = vCardObj->GetByPartial(wxT("PHOTO")); bool AddBreak = FALSE; + wxString TypePageData; if (ContactData.PropCount > 1){ - PageData.append(wxT("\""));")); + TypePageData.append(wxT("\""));")); AddBreak = TRUE; } @@ -413,9 +429,9 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, if (ContactData.PropCount > 1){ - PageData.append(wxT("\""));")); + TypePageData.append(wxT("\""));")); AddBreak = TRUE; } @@ -424,9 +440,9 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, if (ContactData.PropCount >= 1){ - PageData.append(wxT("\""));")); + TypePageData.append(wxT("\""));")); AddBreak = TRUE; } @@ -435,9 +451,9 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, if (ContactData.PropCount >= 1){ - PageData.append(wxT("\""));")); + TypePageData.append(wxT("\""));")); AddBreak = TRUE; } @@ -446,9 +462,9 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, if (ContactData.PropCount >= 1){ - PageData.append(wxT("\""));")); + TypePageData.append(wxT("\""));")); AddBreak = TRUE; } @@ -457,26 +473,27 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, if (ContactData.PropCount >= 1){ - PageData.append(wxT("\""));")); + TypePageData.append(wxT("\""));")); AddBreak = TRUE; } + if (!TypePageData.IsEmpty()){ + + PageData.append("
"); + PageData.append(TypePageData); + PageData.append("
"); + + } + if (AddBreak == TRUE){ PageData.append(wxT("

")); } - bool MultiLogoIcon = FALSE; - bool MultiPhotoIcon = FALSE; - bool SoundIcon = FALSE; - bool KeyIcon = FALSE; - bool VendorIcon = FALSE; - bool XTokenIcon = FALSE; - // Process Birthday ContactData = vCardObj->GetByPartial(wxT("BDAY")); @@ -508,6 +525,8 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, } + PageData.append("
"); + if (DataDisplay == TRUE){ DataLines.Trim(); @@ -1600,6 +1619,8 @@ void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID, // Display the HTML document on the screen. + PageData.append("
"); + PageData.append(wxT("")); PageData.append(wxT("")); @@ -1613,6 +1634,8 @@ void SplitPropertyData(wxString *PropertyLine, int intSize, std::map *SplitData){ + // Split the property data into SplitData. + wxString DataStr; wxStringTokenizer PropertyElement; wxString PropertyName;