Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Merge branch 'master' of ssh://gelforn.xestia.co.uk:/scmrepos/xestiaab
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 16 Mar 2016 00:15:57 +0000 (00:15 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Wed, 16 Mar 2016 00:15:57 +0000 (00:15 +0000)
source/vcard/vcard.cpp
source/vcard/vcard34conv-v3conv.cpp
source/vcard/vcard34conv-v4conv.cpp
source/vcard/vcard34conv.cpp
source/widgets/XABAccountView.cpp
source/widgets/XABContactMenu.cpp

index cb33358..b6a9ee9 100644 (file)
 // RFC 6350 specification.
 
 vCard::vCard(){
-    vCardBegin = FALSE;
-    vCardEnd = FALSE;
-    vCardFN = FALSE;
-    vCardVersion = 0.0;
-    SettingCount = 0;
+       
+       // Setup the vCard object.
+       
+       vCardBegin = FALSE;
+       vCardEnd = FALSE;
+       vCardFN = FALSE;
+       vCardVersion = 0.0;
+       SettingCount = 0;
+       
 }
 
 void vCard::Add(wxString SettingName, wxString SettingValue, bool ReplaceMode){  
     
-    // Check for backslashes used for commas, newlines and
-    // backslashes used for values.
+       // Add data to vCard object.
+       
+       // Check for backslashes used for commas, newlines and
+       // backslashes used for values.
     
-    if (ReplaceMode == TRUE){
+       if (ReplaceMode == TRUE){
     
-       SettingValue.Replace(wxT("\\n"), wxT("\n"));
-       SettingValue.Replace(wxT("\\,"), wxT(","));
-       SettingValue.Replace(wxT("\\:"), wxT(":"));
-       SettingValue.Replace(wxT("\\\\"), wxT("\\"));
+               SettingValue.Replace(wxT("\\n"), wxT("\n"));
+               SettingValue.Replace(wxT("\\,"), wxT(","));
+               SettingValue.Replace(wxT("\\:"), wxT(":"));
+               SettingValue.Replace(wxT("\\\\"), wxT("\\"));
     
-    } else {
+       } else {
 
-       SettingValue.Replace(wxT("\\"), wxT("\\\\"));
-       SettingValue.Replace(wxT("\n"), wxT("\\n"));
-       SettingValue.Replace(wxT(","), wxT("\\,"));
-       SettingValue.Replace(wxT(":"), wxT("\\:"));
-       SettingValue = SettingValue + wxT("\n");
+               SettingValue.Replace(wxT("\\"), wxT("\\\\"));
+               SettingValue.Replace(wxT("\n"), wxT("\\n"));
+               SettingValue.Replace(wxT(","), wxT("\\,"));
+               SettingValue.Replace(wxT(":"), wxT("\\:"));
+               SettingValue = SettingValue + wxT("\n");
     
-    }
+       }
   
-    // Check data to make sure that it meets the required
-    // vCard 4.0 specifications.
+       // Check data to make sure that it meets the required
+       // vCard 4.0 specifications.
     
        if (SettingName == wxT("BEGIN") && SettingValue == wxT("VCARD")){
                vCardBegin = TRUE;
@@ -82,87 +88,96 @@ void vCard::Add(wxString SettingName, wxString SettingValue, bool ReplaceMode){
                vCardVersion = 2.0;
        }
     
-    SettingValue.Trim();    
+       SettingValue.Trim();    
     
-    if (SettingValue.Right(2) != wxT("\r\n")){
+       if (SettingValue.Right(2) != wxT("\r\n")){
     
-       SettingValue.Append(wxT("\r\n"));
+               SettingValue.Append(wxT("\r\n"));
     
-    }
+       }
     
-    SettingNames.Add(SettingName, 1);
-    SettingValues.Add(SettingValue, 1);      
+       SettingNames.Add(SettingName, 1);
+       SettingValues.Add(SettingValue, 1);      
     
-    ++SettingCount;
+       ++SettingCount;
+       
 }
 
 void vCard::AddRaw(wxString SettingName, wxString SettingValue){  
   
-    // Check data to make sure that it meets the required
-    // vCard 4.0 specifications.
-    
-    if (SettingName == wxT("BEGIN") && SettingValue == wxT("VCARD")){
-       vCardBegin = TRUE;
-    }
+       // Add data to the vCard in raw mode.
+
+       // Check data to make sure that it meets the required
+       // vCard 4.0 specifications.
+       
+       if (SettingName == wxT("BEGIN") && SettingValue == wxT("VCARD")){
+               vCardBegin = TRUE;
+       }
     
-    if (SettingName == wxT("END") && SettingValue == wxT("VCARD")){
-       vCardEnd = TRUE;
-    }
+       if (SettingName == wxT("END") && SettingValue == wxT("VCARD")){
+               vCardEnd = TRUE;
+       }
     
-    if (SettingName.Mid(0,2) == wxT("FN")){
-       vCardFN = TRUE;
-    }
+       if (SettingName.Mid(0,2) == wxT("FN")){
+               vCardFN = TRUE;
+       }
     
-    if (SettingName == wxT("VERSION") && SettingValue == wxT("4.0")){   
-       vCardVersion = 4.0;
-    }
+       if (SettingName == wxT("VERSION") && SettingValue == wxT("4.0")){   
+               vCardVersion = 4.0;
+       }
 
-    if (SettingName == wxT("VERSION") && SettingValue == wxT("3.0")){   
-       vCardVersion = 3.0;
-    }
+       if (SettingName == wxT("VERSION") && SettingValue == wxT("3.0")){   
+               vCardVersion = 3.0;
+       }
     
-    if (SettingName == wxT("VERSION") && SettingValue == wxT("3.0")){   
-       vCardVersion = 2.0;
-    }
+       if (SettingName == wxT("VERSION") && SettingValue == wxT("3.0")){   
+               vCardVersion = 2.0;
+       }
     
-    SettingValue.Trim();
+       SettingValue.Trim();
     
-    if (SettingValue.Right(2) != wxT("\r\n")){
+       if (SettingValue.Right(2) != wxT("\r\n")){
     
-       SettingValue.Append(wxT("\r\n"));
+               SettingValue.Append(wxT("\r\n"));
     
-    }
+       }
         
-    SettingNames.Add(SettingName, 1);
-    SettingValues.Add(SettingValue, 1);      
+       SettingNames.Add(SettingName, 1);
+       SettingValues.Add(SettingValue, 1);      
     
-    ++SettingCount;
+       ++SettingCount;
+       
 }
 
 wxString vCard::Get(wxString SettingName){
   
-    wxString SettingValue;
-    
-    // Look for the setting name.
+       // Get values from the vCard object.
+       
+       wxString SettingValue;
     
-    for (int i = 0; i < SettingCount; i++){
+       // Look for the setting name.
+
+       for (int i = 0; i < SettingCount; i++){
       
-       if (SettingNames[i] == SettingName){
+               if (SettingNames[i] == SettingName){
        
-           SettingValue = SettingValues[i];
-           SettingValue.Trim(TRUE);
+                       SettingValue = SettingValues[i];
+                       SettingValue.Trim(TRUE);
                    
-           while (SettingValues[(i + 1)].Mid(0, 1) == wxT(" ") || SettingValues[(i + 1)].Mid(0, 1) == wxT("\t")){
+                       while (SettingValues[(i + 1)].Mid(0, 1) == wxT(" ") || SettingValues[(i + 1)].Mid(0, 1) == wxT("\t")){
                
-               SettingValue.Trim();
-               SettingValue.Append(SettingValues[(i + 1)]);
+                               SettingValue.Trim();
+                               SettingValue.Append(SettingValues[(i + 1)]);
                
-               i++;
-           }
+                               i++;
+                       
+                       }
            
-           return SettingValue;
+                       return SettingValue;
+               
+               }
+       
        }
-    }
 
        return wxEmptyString;
 
@@ -170,6 +185,8 @@ wxString vCard::Get(wxString SettingName){
 
 vCardName vCard::GetName(){
 
+       // Get the name from the vCard object.
+       
        vCardName NameData;
        ArrayvCardOutData NameArray = this->GetByPartial(wxT("N"));
        //wxString NameDataGet = NameArray.PropValues[0];
@@ -263,50 +280,52 @@ vCardName vCard::GetName(){
 
 ArrayvCardOutData vCard::GetByPartial(wxString SettingName){
 
-    ArrayvCardOutData vCardOutData;
-    wxArrayString SettingList;
-    wxString SettingValueCurrent;
-    wxString SettingValue;
-    int SettingNameLen;
-    int SettingNameSeek;
-    bool FirstToken = TRUE;
+       // Get data from the vCard object based on a partial match.
+       
+       ArrayvCardOutData vCardOutData;
+       wxArrayString SettingList;
+       wxString SettingValueCurrent;
+       wxString SettingValue;
+       int SettingNameLen;
+       int SettingNameSeek;
+       bool FirstToken = TRUE;
     
-    SettingNameLen = SettingName.Len();
-
-    for (int i = 0; i < SettingCount; i++){
+       SettingNameLen = SettingName.Len();
+       
+       for (int i = 0; i < SettingCount; i++){
     
-       if (SettingNames[i].Mid(0, SettingNameLen) == SettingName){
+               if (SettingNames[i].Mid(0, SettingNameLen) == SettingName){
            
-           SettingValue = SettingValues[i];
-           SettingNameSeek = i;            
+                       SettingValue = SettingValues[i];
+                       SettingNameSeek = i;        
            
-           while (SettingValues[(i + 1)].Mid(0, 1) == wxT(" ") || SettingValues[(i + 1)].Mid(0, 1) == wxT("\t")){
+               while (SettingValues[(i + 1)].Mid(0, 1) == wxT(" ") || SettingValues[(i + 1)].Mid(0, 1) == wxT("\t")){
                
-               if (FirstToken == TRUE){
+                       if (FirstToken == TRUE){
                
-                       SettingValue.Trim(FALSE);
-                       SettingValue.Trim(TRUE);                                
-                       FirstToken = FALSE;
+                               SettingValue.Trim(FALSE);
+                               SettingValue.Trim(TRUE);                                
+                               FirstToken = FALSE;
                
-               }
+                       }
                
-               SettingValueCurrent = SettingValues[(i + 1)];
-               SettingValueCurrent.Trim(FALSE);
-               SettingValueCurrent.Trim(TRUE);         
+                       SettingValueCurrent = SettingValues[(i + 1)];
+                       SettingValueCurrent.Trim(FALSE);
+                       SettingValueCurrent.Trim(TRUE);         
                
-               SettingValue.Append(SettingValueCurrent);
+                       SettingValue.Append(SettingValueCurrent);
                
-               i++;
+                       i++;
                
-           }
+               }
            
-           //SettingList.Add(SettingNames[SettingNameSeek] + wxT(":") + SettingValue);
-           vCardOutData.PropData.Add(SettingNames[SettingNameSeek]);
-           vCardOutData.PropValues.Add(SettingValue);
-           vCardOutData.PropCount++;
+               //SettingList.Add(SettingNames[SettingNameSeek] + wxT(":") + SettingValue);
+               vCardOutData.PropData.Add(SettingNames[SettingNameSeek]);
+               vCardOutData.PropValues.Add(SettingValue);
+               vCardOutData.PropCount++;
            
+               }
        }
-    }
     
     /*for (int i = 0; i < SettingCount; i++){
        if (SettingNames[i].Mid(0, SettingNameLen) == SettingName){
@@ -333,62 +352,68 @@ ArrayvCardOutData vCard::GetByPartial(wxString SettingName){
        }
     }*/
     
-    return vCardOutData;
+       return vCardOutData;
 
 }
 
 wxString vCard::GetById(int id){
+       
+       // Get data from the vCard object based on ID.
+       
        // Unimplemented.
        return wxT("");
+       
 }
 
 int vCard::WriteFile(wxString WriteFilename){
 
-    // Open the file and begin writing data into the file.
+       // Write the vCard to a file using the WriteFilename given.
+       
+       // Open the file and begin writing data into the file.
     
-    wxString SettingName;
-    wxString SettingValue;
-    wxString SettingLine;
+       wxString SettingName;
+       wxString SettingValue;
+       wxString SettingLine;
     
-    SettingCount = SettingNames.GetCount();
+       SettingCount = SettingNames.GetCount();
     
-    wxFile ContactFile;
-    if (ContactFile.Create(WriteFilename, TRUE, wxS_DEFAULT) == FALSE){
-       return 1;
-    }
+       wxFile ContactFile;
+       if (ContactFile.Create(WriteFilename, TRUE, wxS_DEFAULT) == FALSE){
+               return 1;
+       }
     
-    for (int i = 0; i < SettingCount; i++){
+       for (int i = 0; i < SettingCount; i++){
     
-       SettingLine = SettingNames[i] + wxT(":") + SettingValues[i];
+               SettingLine = SettingNames[i] + wxT(":") + SettingValues[i];
     
-       int SettingLineLen = SettingLine.Len();
-       int intDivider = 74;
-       int intTimes = floor((SettingLine.Len() / intDivider));
-       int intSeek = 0;
-       int intLineSeek = 0;
-       int intPrevLine;
-       bool FirstLine = TRUE;
+               int SettingLineLen = SettingLine.Len();
+               int intDivider = 74;
+               int intTimes = floor((SettingLine.Len() / intDivider));
+               int intSeek = 0;
+               int intLineSeek = 0;
+               int intPrevLine;
+               bool FirstLine = TRUE;
     
-       // Remember to round down the calculation.
+               // Remember to round down the calculation.
 
-       while (intSeek < SettingLineLen){
+               while (intSeek < SettingLineLen){
        
-               if ((intLineSeek == intDivider && FirstLine == TRUE) ||
-               (intLineSeek == (intDivider - 1) && FirstLine == FALSE)){
+                       if ((intLineSeek == intDivider && FirstLine == TRUE) ||
+                               (intLineSeek == (intDivider - 1) && FirstLine == FALSE)){
                
-                       SettingLine.insert(intSeek, wxT("\r\n "));
-                       intSeek = intSeek + 3;
-                       SettingLineLen = SettingLineLen + 3;
-                       intLineSeek = 0;
-                       intPrevLine = intSeek;
-                       FirstLine = FALSE;
+                               SettingLine.insert(intSeek, wxT("\r\n "));
+                               intSeek = intSeek + 3;
+                               SettingLineLen = SettingLineLen + 3;
+                               intLineSeek = 0;
+                               intPrevLine = intSeek;
+                               FirstLine = FALSE;
                
-               }
+                       }
        
-               intSeek++;
-               intLineSeek++;
+                       intSeek++;
+                       intLineSeek++;
        
-       }
+               }
 
        /*
 
@@ -410,44 +435,46 @@ int vCard::WriteFile(wxString WriteFilename){
        
        */
        
-       ContactFile.Write(SettingLine);
+               ContactFile.Write(SettingLine);
        
-    }
+       }
     
-    ContactFile.Close();
+       ContactFile.Close();
 
-    return 0;
+       return 0;
 
 }
 
 int vCard::LoadFile(wxString LoadFilename){
 
-    wxFFile ContactFile;
+       // Load data from a file using the LoadFilename given.
+       
+       wxFFile ContactFile;
   
-    wxString wxSContactString;
+       wxString wxSContactString;
   
-    vCardFilename = LoadFilename;
+       vCardFilename = LoadFilename;
        
-    // Check if we are using wxWidgets version 2.8 or less and
-    // execute the required command accordingly.
+       // Check if we are using wxWidgets version 2.8 or less and
+       // execute the required command accordingly.
     
 #if wxABI_VERSION < 20900
-    ContactFile.Open(LoadFilename.c_str(), wxT("r"));
+       ContactFile.Open(LoadFilename.c_str(), wxT("r"));
 #else
-    ContactFile.Open(LoadFilename, wxT("r"));
+       ContactFile.Open(LoadFilename, wxT("r"));
 #endif 
        
-    if (ContactFile.IsOpened() == FALSE){
+       if (ContactFile.IsOpened() == FALSE){
        
                return 1;
        
-    }
+       }
        
-    ContactFile.ReadAll(&wxSContactString, wxConvAuto());
+       ContactFile.ReadAll(&wxSContactString, wxConvAuto());
     
-    ContactFile.Close();
+       ContactFile.Close();
     
-    ProcessString(&wxSContactString);
+       ProcessString(&wxSContactString);
 
        return 0;
 
@@ -455,7 +482,9 @@ int vCard::LoadFile(wxString LoadFilename){
 
 int vCard::LoadString(wxString ContactData){
 
-    ProcessString(&ContactData);
+       // Load data from a wxString.
+       
+       ProcessString(&ContactData);
 
        return 0;
 
@@ -463,305 +492,317 @@ int vCard::LoadString(wxString ContactData){
 
 void vCard::ProcessString(wxString *ContactDataInc){
 
-    // Split the vCards (if there are more than one vCard in the file).
+       // Process data from a wxString pointer.
+       
+       // Split the vCards (if there are more than one vCard in the file).
 
-    wxString ContactLine;
+       wxString ContactLine;
 
-    int ContactLineLen;
-    bool ExtraLineSeek = FALSE;
-    int QuoteBreakPoint = 0;
+       int ContactLineLen;
+       bool ExtraLineSeek = FALSE;
+       int QuoteBreakPoint = 0;
     
-    bool PropertyFind = FALSE;
-    bool QuoteMode = FALSE;
+       bool PropertyFind = FALSE;
+       bool QuoteMode = FALSE;
    
-    wxString wxSPropertyNextLine;
-    wxString wxSProperty;
-    wxString wxSPropertySeg1;
-    wxString wxSPropertySeg2;
+       wxString wxSPropertyNextLine;
+       wxString wxSProperty;
+       wxString wxSPropertySeg1;
+       wxString wxSPropertySeg2;
     
-    bool FoundBegin = FALSE;
-    bool FoundEnd = FALSE;
-    bool FirstContact = TRUE;
-    wxString FirstContactData;
-    wxString ContactData;
-    int ContactCount = 0;
+       bool FoundBegin = FALSE;
+       bool FoundEnd = FALSE;
+       bool FirstContact = TRUE;
+       wxString FirstContactData;
+       wxString ContactData;
+       int ContactCount = 0;
     
-    wxStringTokenizer wSTContactFileLines(*ContactDataInc, wxT("\r\n"));
+       wxStringTokenizer wSTContactFileLines(*ContactDataInc, wxT("\r\n"));
     
-    while(wSTContactFileLines.HasMoreTokens() == TRUE){
+       while(wSTContactFileLines.HasMoreTokens() == TRUE){
     
-       ContactLine = wSTContactFileLines.GetNextToken();
+               ContactLine = wSTContactFileLines.GetNextToken();
        
-       if (ContactLine == wxT("BEGIN:VCARD")){
+               if (ContactLine == wxT("BEGIN:VCARD")){
                
-               if (FoundBegin == TRUE){
+                       if (FoundBegin == TRUE){
                
-                       // No END:VCARD was found so discard current data.
+                               // No END:VCARD was found so discard current data.
                        
-                       ContactData.Clear();
+                               ContactData.Clear();
                
-                       if (FirstContact == TRUE){
+                               if (FirstContact == TRUE){
                        
-                               FirstContactData.Clear();
+                                       FirstContactData.Clear();
                        
-                       }
+                               }
                
-               }
+                       }
                
-               FoundBegin = TRUE;
+                       FoundBegin = TRUE;
                
-               FirstContactData.Append(ContactLine + wxT("\r\n"));
-               ContactData.Append(ContactLine + wxT("\r\n"));
+                       FirstContactData.Append(ContactLine + wxT("\r\n"));
+                       ContactData.Append(ContactLine + wxT("\r\n"));
                
-       } else if (ContactLine == wxT("END:VCARD") && FoundBegin == TRUE){
+               } else if (ContactLine == wxT("END:VCARD") && FoundBegin == TRUE){
        
-               if (FirstContact == TRUE){
+                       if (FirstContact == TRUE){
                
-                       FirstContact = FALSE;
-                       FirstContactData.Append(ContactLine + wxT("\r\n"));
+                               FirstContact = FALSE;
+                               FirstContactData.Append(ContactLine + wxT("\r\n"));
                
-               }
+                       }
                
-               ContactData.Append(ContactLine + wxT("\r\n"));
+                       ContactData.Append(ContactLine + wxT("\r\n"));
                                
-               Cards.insert(std::make_pair(ContactCount, ContactData));
+                       Cards.insert(std::make_pair(ContactCount, ContactData));
        
-               ContactCount++;
+                       ContactCount++;
        
-       } else if (FoundBegin == TRUE){
+               } else if (FoundBegin == TRUE){
        
-               if (FirstContact == TRUE){
+                       if (FirstContact == TRUE){
                
-                       FirstContactData.Append(ContactLine + wxT("\r\n"));
+                               FirstContactData.Append(ContactLine + wxT("\r\n"));
                
-               }
+                       }
                
-               ContactData.Append(ContactLine + wxT("\r\n"));
+                       ContactData.Append(ContactLine + wxT("\r\n"));
        
-       }
+               }
     
-    }
+       }
 
-    ContactLine.Clear();
+       ContactLine.Clear();
     
-    // Split the lines.
+       // Split the lines.
        
-    std::map<int, wxString> ContactFileLines;
-    std::map<int, wxString>::iterator striter;
+       std::map<int, wxString> ContactFileLines;
+       std::map<int, wxString>::iterator striter;
        
-    wxStringTokenizer wSTFirstContactLines(FirstContactData, wxT("\r\n"));
+       wxStringTokenizer wSTFirstContactLines(FirstContactData, wxT("\r\n"));
 
-    int ContactLineSeek = 0;
+       int ContactLineSeek = 0;
 
-    while (wSTFirstContactLines.HasMoreTokens() == TRUE){
+       while (wSTFirstContactLines.HasMoreTokens() == TRUE){
 
-       ContactLine = wSTFirstContactLines.GetNextToken();
-       ContactFileLines.insert(std::make_pair(ContactLineSeek, ContactLine));
-       ContactLineSeek++;              
+               ContactLine = wSTFirstContactLines.GetNextToken();
+               ContactFileLines.insert(std::make_pair(ContactLineSeek, ContactLine));
+               ContactLineSeek++;              
        
-    }
+       }
     
-    for (std::map<int,wxString>::iterator iter = ContactFileLines.begin(); 
-       iter != ContactFileLines.end(); ++iter){
+       for (std::map<int,wxString>::iterator iter = ContactFileLines.begin(); 
+               iter != ContactFileLines.end(); ++iter){
 
-       // Find the colon which splits the start bit from the data part.
+               // Find the colon which splits the start bit from the data part.
        
-       ContactLine = iter->second;
+               ContactLine = iter->second;
        
-       while (ExtraLineSeek == TRUE){
+               while (ExtraLineSeek == TRUE){
        
-           // Check if there is extra data on the next line 
-           // (indicated by space or tab at the start) and add data.
+                       // Check if there is extra data on the next line 
+                       // (indicated by space or tab at the start) and add data.
        
-           iter++;
+                       iter++;
                
-           if (iter == ContactFileLines.end()){
+                       if (iter == ContactFileLines.end()){
                
-               iter--;
-               break;
+                               iter--;
+                               break;
                
-           }                   
+                       }
        
-           wxSPropertyNextLine = iter->second;
+                       wxSPropertyNextLine = iter->second;
                
+                       if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
+               
+                               wxSPropertyNextLine.Remove(0, 1);
+                               //wxSPropertyNextLine.Trim(FALSE);
+                               //ContactLine.Trim();
+                               ContactLine.Append(wxSPropertyNextLine);
        
-           if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
-       
-               wxSPropertyNextLine.Remove(0, 1);
-               //wxSPropertyNextLine.Trim(FALSE);
-               //ContactLine.Trim();
-               ContactLine.Append(wxSPropertyNextLine);
-       
-           } else {
+                       } else {
                
-               iter--;
-               ExtraLineSeek = FALSE;
+                               iter--;
+                               ExtraLineSeek = FALSE;
                
-           }
+                       }
        
-       }
+               }
 
-       ContactLineLen = ContactLine.Len();
+               ContactLineLen = ContactLine.Len();
        
-       // Make sure we are not in quotation mode.
-       // Make sure colon does not have \ or \\ before it.
+               // Make sure we are not in quotation mode.
+               // Make sure colon does not have \ or \\ before it.
        
-       for (int i = 0; i <= ContactLineLen; i++){
+               for (int i = 0; i <= ContactLineLen; i++){
        
-           if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
+                       if ((ContactLine.Mid(i, 1) == wxT(";") || ContactLine.Mid(i, 1) == wxT(":")) && PropertyFind == TRUE){
                
-                       PropertyFind = FALSE;
+                               PropertyFind = FALSE;
                
-           } else if (PropertyFind == TRUE){
+                       } else if (PropertyFind == TRUE){
                
-                       wxSProperty.Append(ContactLine.Mid(i, 1));
+                               wxSProperty.Append(ContactLine.Mid(i, 1));
                
-           }           
+                       }               
        
-           if (ContactLine.Mid(i, 1) == wxT("\"")){
+                       if (ContactLine.Mid(i, 1) == wxT("\"")){
                
-               if (QuoteMode == TRUE){
+                               if (QuoteMode == TRUE){
                        
-                   QuoteMode = FALSE;
+                                       QuoteMode = FALSE;
                        
-               } else {
+                               } else {
                
-                   QuoteMode = TRUE;
+                                       QuoteMode = TRUE;
                                
-               }
+                               }
                
-           }
+                       }
                
-           if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
+                       if (ContactLine.Mid(i, 1) == wxT(":") && ContactLine.Mid((i - 1), 1) != wxT("\\") && QuoteMode == FALSE){
                
-               QuoteBreakPoint = i;
-               break;
+                               QuoteBreakPoint = i;
+                               break;
                
-           }
+                       }
        
-       }
+               }
        
-       // Split that line at the point into two variables (ignore the colon).
+               // Split that line at the point into two variables (ignore the colon).
        
-       wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
-       wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
+               wxSPropertySeg1 = ContactLine.Mid(0, QuoteBreakPoint);
+               wxSPropertySeg2 = ContactLine.Mid((QuoteBreakPoint + 1));
        
-       // Insert both into the vCard data file.
+               // Insert both into the vCard data file.
        
-       AddRaw(wxSPropertySeg1, wxSPropertySeg2);
+               AddRaw(wxSPropertySeg1, wxSPropertySeg2);
        
-       QuoteMode = FALSE;
-       PropertyFind = TRUE;
-       ExtraLineSeek = TRUE;
-       ContactLineLen = 0;
-       QuoteBreakPoint = 0;
-       ContactLine.Clear();
-       wxSProperty.Clear();
+               QuoteMode = FALSE;
+               PropertyFind = TRUE;
+               ExtraLineSeek = TRUE;
+               ContactLineLen = 0;
+               QuoteBreakPoint = 0;
+               ContactLine.Clear();
+               wxSProperty.Clear();
        
-    }
+       }
 
 
 }
 
 wxString vCard::WriteString(){
 
-    // Open the file and begin writing data into the file.
+       // Write the vCard file into a wxString.
+       
+       // Open the file and begin writing data into the file.
     
-    wxString SettingName;
-    wxString SettingValue;
-    wxString SettingLine;
-    wxString SettingFinal;
+       wxString SettingName;
+       wxString SettingValue;
+       wxString SettingLine;
+       wxString SettingFinal;
     
-    SettingCount = SettingNames.GetCount();
+       SettingCount = SettingNames.GetCount();
     
-    for (int i = 0; i < SettingCount; i++){
+       for (int i = 0; i < SettingCount; i++){
     
-       SettingLine = SettingNames[i] + wxT(":") + SettingValues[i];
+               SettingLine = SettingNames[i] + wxT(":") + SettingValues[i];
     
-       int SettingLineLen = SettingLine.Len();
-       int intDivider = 74;
-       int intTimes = floor((SettingLine.Len() / intDivider));
-       int intSeek = 0;
-       int intLineSeek = 0;
-       int intPrevLine;
-       bool FirstLine = TRUE;
+               int SettingLineLen = SettingLine.Len();
+               int intDivider = 74;
+               int intTimes = floor((SettingLine.Len() / intDivider));
+               int intSeek = 0;
+               int intLineSeek = 0;
+               int intPrevLine;
+               bool FirstLine = TRUE;
     
-       // Remember to round down the calculation.
+               // Remember to round down the calculation.
 
-       while (intSeek < SettingLineLen){
+               while (intSeek < SettingLineLen){
        
-               if ((intLineSeek == intDivider && FirstLine == TRUE) ||
-               (intLineSeek == (intDivider - 1) && FirstLine == FALSE)){
+                       if ((intLineSeek == intDivider && FirstLine == TRUE) ||
+                       (intLineSeek == (intDivider - 1) && FirstLine == FALSE)){
                
-                       SettingLine.insert(intSeek, wxT("\r\n "));
-                       intSeek = intSeek + 3;
-                       SettingLineLen = SettingLineLen + 3;
-                       intLineSeek = 0;
-                       intPrevLine = intSeek;
-                       FirstLine = FALSE;
+                               SettingLine.insert(intSeek, wxT("\r\n "));
+                               intSeek = intSeek + 3;
+                               SettingLineLen = SettingLineLen + 3;
+                               intLineSeek = 0;
+                               intPrevLine = intSeek;
+                               FirstLine = FALSE;
                
-               }
+                       }
        
-               intSeek++;
-               intLineSeek++;
+                       intSeek++;
+                       intLineSeek++;
        
-       }
+               }
        
-       SettingFinal.Append(SettingLine);
+               SettingFinal.Append(SettingLine);
        
-    }
+       }
     
-    return SettingFinal;
+       return SettingFinal;
 
 }
 
 bool vCard::MeetBaseSpecification(){
-    // Check and see if the vCard object meets the base specification
-    // of vCard 4.0.
+       
+       // Check and see if the vCard object meets the base specification
+       // of vCard 4.0.
     
-    if (vCardBegin == TRUE && vCardEnd == TRUE && vCardFN == TRUE &&
-       vCardVersion == 4.0){
-       return TRUE;
-    } else {
-       return FALSE;
-    }
+       if (vCardBegin == TRUE && vCardEnd == TRUE && vCardFN == TRUE &&
+               vCardVersion == 4.0){
+
+               return TRUE;
+
+       } else {
+
+               return FALSE;
+
+       }
     
 }
 
 wxString vCard::Convert(wxString SettingValue, bool ReplaceMode){  
     
-    // Check for backslashes used for commas, newlines and
-    // backslashes used for values.
+       // Check for backslashes used for commas, newlines and
+       // backslashes used for values.
     
-    if (ReplaceMode == TRUE){
+       if (ReplaceMode == TRUE){
     
-       SettingValue.Replace(wxT("\\n"), wxT("\n"));
-       SettingValue.Replace(wxT("\\,"), wxT(","));
-       SettingValue.Replace(wxT("\\;"), wxT(";"));
-       SettingValue.Replace(wxT("\\\\"), wxT("\\"));
+               SettingValue.Replace(wxT("\\n"), wxT("\n"));
+               SettingValue.Replace(wxT("\\,"), wxT(","));
+               SettingValue.Replace(wxT("\\;"), wxT(";"));
+               SettingValue.Replace(wxT("\\\\"), wxT("\\"));
     
-    } else {
+       } else {
 
-       SettingValue.Replace(wxT("\\"), wxT("\\\\"));
-       SettingValue.Replace(wxT("\n"), wxT("\\n"));
-       SettingValue.Replace(wxT(","), wxT("\\,"));
-       SettingValue.Replace(wxT(";"), wxT("\\;"));
-       SettingValue = SettingValue + wxT("\n");
+               SettingValue.Replace(wxT("\\"), wxT("\\\\"));
+               SettingValue.Replace(wxT("\n"), wxT("\\n"));
+               SettingValue.Replace(wxT(","), wxT("\\,"));
+               SettingValue.Replace(wxT(";"), wxT("\\;"));
+               SettingValue = SettingValue + wxT("\n");
     
-    }
+       }
     
-    return SettingValue;
+       return SettingValue;
     
 }
 
 wxString vCard::GetFilename(){
 
-    return vCardFilename;
+       // Get the filename associated with the vCard object.
+       
+       return vCardFilename;
 
 }
 
 std::map<int,wxString>* vCard::GetAllCards(){
 
-    return &Cards;
+       // Get all of vCards within the vCard object.
+       
+       return &Cards;
 
 }
\ No newline at end of file
index 8639a74..67d69e9 100644 (file)
@@ -40,8 +40,6 @@ bool vCard34Conv::ConvertToV3(wxString Filename, wxString *wxSData){
 
        vCard ContactDatav3;
        
-       //wxSContactFilename = Filename;
-       
        // Check if we are using wxWidgets version 2.8 or less and
        // execute the required command accordingly.
        
@@ -130,11 +128,10 @@ bool vCard34Conv::ConvertToV3(wxString Filename, wxString *wxSData){
        int VendorCount = 0;
        int XTokenCount = 0;
        int ItemSeek = 1;
-       //int intValueSeek = 1;
        
        wxString strVer;
     
-    // Setup the version string.
+       // Setup the version string.
        
        strVer.Append(wxT("-//Xestia//Address Book Version "));
        strVer.Append(wxT(XSDAB_VERSION));
@@ -171,8 +168,6 @@ bool vCard34Conv::ConvertToV3(wxString Filename, wxString *wxSData){
                        if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
                
                                wxSPropertyNextLine.Remove(0, 1);
-                               //wxSPropertyNextLine.Trim(FALSE);
-                               //ContactLine.Trim();
                                ContactLine.Append(wxSPropertyNextLine);
                
                        } else {
@@ -243,8 +238,6 @@ bool vCard34Conv::ConvertToV3(wxString Filename, wxString *wxSData){
                        wxString PropertyValue;
                        wxString PropertyTokens;
                        int intPrevValue = 4;
-
-                       //SplitValues(&wxSPropertySeg1, &SplitPoints, &SplitLength, intPrevValue);
                        
                        intPrevValue = 3;
                        
@@ -913,8 +906,6 @@ bool vCard34Conv::ConvertToV3(wxString Filename, wxString *wxSData){
                                                
                                                } else if (TypePropertyName == wxT("textphone")){
                                                
-                                                       //if (!TelTypeOut.IsEmpty()){ TelTypeOut.Append(wxT(";")); }
-                                               
                                                        if (!FinalFriendlyString.IsEmpty()){  FinalFriendlyString.Append(_(", Textphone")); } else { FinalFriendlyString.Append(_("Textphone")); }
                                                
                                                        TelTypeOut.Append(wxT(";"));
index 7c32094..3e0ff06 100644 (file)
@@ -28,6 +28,8 @@
 
 bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
        
+       // Convert a vCard 3.0 format into the vCard 4.0 format.
+       
        std::map<int, wxString> ContactFileLines;
        std::map<int, bool> ContactFileProcessed;
        std::map<int, bool> ContactFileProcessedWorking;
@@ -119,12 +121,12 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
        vCardOut->AddRaw(wxT("VERSION"), wxT("4.0"));
        vCardOut->AddRaw(wxT("PRODID"), strVer);
        
-               // FN
-               // NICKNAME
-               // TITLE
-               // ORG
-               // NOTE
-               // PHOTO
+       // FN
+       // NICKNAME
+       // TITLE
+       // ORG
+       // NOTE
+       // PHOTO
                
        // Process the properties which have X-FIRST.
        
@@ -223,13 +225,10 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                        if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
                
                                wxSPropertyNextLine.Remove(0, 1);
-                               //wxSPropertyNextLine.Trim(FALSE);
-                               //ContactLine.Trim();
                                ContactLine.Append(wxSPropertyNextLine);
                                DataLineProcessOriginal.insert(std::make_pair(DataLineSeekOrig, iterboolsub->first));
                                DataLineSeekOrig++;
-                               //iterboolsub->second = TRUE;
-               
+                               
                        } else {
                        
                                ExtraLineSeek = FALSE;
@@ -298,16 +297,11 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                        for (std::map<int,wxString>::iterator itersub = ContactFileLines.begin(); 
                        itersub != ContactFileLines.end(); ++itersub){
                
-                               //DataLineProcess = DataLineProcessOriginal;
-                               //DataLineSeek = DataLineSeekOrig;
-               
                                ContactLineSub = itersub->second;
                
                                ExtraLineSeekSub = TRUE;
 
                                iterboolsub = ContactFileProcessed.find(itersub->first);
-                               //std::map<int,bool>::iterator iterorig = ContactFileProcessed.find(itersub->first);
-                               //std::map<int,bool>::iterator itersuborig;
                
                                // Ignore certain variables as they are not needed.
                
@@ -348,14 +342,10 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                                        continue;
                
                                }
-               
-                               //std::map<int,wxString>::iterator itersub = iter;
                                
                                DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
                                DataLineSeek++;
 
-
-
                                while (ExtraLineSeekSub == TRUE){
 
                                        if (itersub == ContactFileLines.end()){
@@ -373,10 +363,7 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                                        if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
 
                                                wxSPropertyNextLine.Remove(0, 1);
-                                               //wxSPropertyNextLine.Trim(FALSE);
-                                               //ContactLine.Trim();
                                                ContactLineSub.Append(wxSPropertyNextLine);
-                                               //iterboolsub->second = TRUE;
                                                DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
                                                DataLineSeek++;
 
@@ -388,55 +375,6 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                                        }
 
                                }
-
-                               /*while (ExtraLineSeekSub == TRUE && iterboolsub != ContactFileProcessedWorking.end()){
-               
-                                       // Check if there is extra data on the next line 
-                                       // (indicated by space or tab at the start) and add data.
-               
-                                       itersub++;
-
-                                       iterboolsub = ContactFileProcessedWorking.find(itersub->first);
-                       
-                                       if (iterboolsub->second == TRUE){
-                       
-                                               continue;
-                       
-                                       }
-                       
-                                       if (itersub == ContactFileLines.end()){
-                       
-                                               break;
-                       
-                                       }                       
-               
-                                       wxSPropertyNextLine = itersub->second;
-               
-                                       if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
-               
-                                               wxSPropertyNextLine.Remove(0, 1);
-                                               //wxSPropertyNextLine.Trim(FALSE);
-                                               //ContactLine.Trim();
-                                               ContactLineSub.Append(wxSPropertyNextLine);
-                                               //iterboolsub->second = TRUE;
-                                               DataLineProcess.insert(std::make_pair(DataLineSeek, itersub->first));
-                                               DataLineSeek++;
-               
-                                       } else {
-                       
-                                               itersub--;
-                                               ExtraLineSeekSub = FALSE;
-                       
-                                       }
-
-                                       if (iterboolsub == ContactFileProcessedWorking.end()){
-
-                                               break;
-                                               ExtraLineSeekSub = FALSE;
-
-                                       }
-               
-                               }*/
                
                                ContactLineSubLen = ContactLineSub.Len();
                                PropertyFind = TRUE;
@@ -537,8 +475,6 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                                        TempPropertyData.clear();
                        
                                } else {
-                               
-                                       wxT("PHOTODANCEMATCH!");
                        
                                        for (std::map<wxString, wxString>::iterator xfiter = TempPropertyData.begin(); 
                                        xfiter != TempPropertyData.end(); ++xfiter){
@@ -698,8 +634,6 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                wxSPropertyData.Clear();
                wxSPropertyXVCard4Value.Clear();
                wxSPropertyNameConv.Clear();
-               //FinalPropertyData.clear();
-               //FinalPropValue.clear();
                PropertyData.clear();
                PropertyLock.clear();
                ContactLine.clear();
@@ -806,8 +740,6 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                        if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
                
                                wxSPropertyNextLine.Remove(0, 1);
-                               //wxSPropertyNextLine.Trim(FALSE);
-                               //ContactLine.Trim();
                                ContactLine.Append(wxSPropertyNextLine);
                                iterboolsub->second = TRUE;
                
@@ -915,8 +847,6 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                wxSPropertyData.Clear();
                wxSPropertyXVCard4Value.Clear();
                wxSPropertyNameConv.Clear();
-               //FinalPropertyData.clear();
-               //FinalPropValue.clear();
                PropertyData.clear();
                PropertyLock.clear();
                ContactLine.clear();
@@ -959,7 +889,6 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
        size_t ItemStringSeekLen = 0;
        int ItemSeekSub = 0;
        int ItemSeekSecSub = 0;
-       //int intValueSeek = 1;
        
        std::map<int, wxString> NumberedName;
        std::map<int, wxString> NumberedData;
@@ -1003,7 +932,6 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
        SeekItemData = FALSE;
        
        std::map<wxString, void*> ItemMapIndex;
-       //std::map<wxString, wxString> ItemNameIndex;
        
        // Look for item in the initial line, process into a proper line then
        // look for other lines with the same item association.
@@ -1037,7 +965,6 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                
                // Get Item data.
 
-               //ContactLineSeekSub = ContactLineSeek;
                std::map<int,wxString>::iterator itersub = iter;
 
                while (ExtraLineSeek == TRUE){
@@ -1071,8 +998,6 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                        if (wxSPropertyNextLine.Mid(0, 1) == wxT(" ") || wxSPropertyNextLine.Mid(0, 1) == wxT("\t")){
                
                                wxSPropertyNextLine.Remove(0, 1);
-                               //wxSPropertyNextLine.Trim(FALSE);
-                               //ContactLine.Trim();
                                ContactLine.Append(wxSPropertyNextLine);
                                iterboolsub->second = TRUE;
                
@@ -1173,8 +1098,7 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                        iterboolsub->second = TRUE;
                
                }
-               
-               //ItemNameIndex.insert(std::make_pair(ItemStringSeek, ItemPropName));
+
                ItemListData->insert(std::make_pair(ItemIndex, ContactLineSub));
                ItemMapIndex.insert(std::make_pair(ItemStringSeek, ItemListData));
                
@@ -1255,8 +1179,6 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                                wxSPropertyData.Clear();
                                wxSPropertyXVCard4Value.Clear();
                                wxSPropertyNameConv.Clear();
-                               //FinalPropertyData.clear();
-                               //FinalPropValue.clear();
                                PropertyData.clear();
                                PropertyLock.clear();
                                ContactLine.clear();
@@ -1282,8 +1204,6 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                        wxSPropertyData.Clear();
                        wxSPropertyXVCard4Value.Clear();
                        wxSPropertyNameConv.Clear();
-                       //FinalPropertyData.clear();
-                       //FinalPropValue.clear();
                        PropertyData.clear();
                        PropertyLock.clear();
                        ContactLine.clear();
@@ -1346,8 +1266,6 @@ bool vCard34Conv::ConvertToV4(wxString *wxSData, vCard *vCardOut){
                VCard3Value = FALSE;
        
                TempData.clear();
-               //PropertyData.clear();
-               //PropertyLock.clear();
                
        }
        
index 4cccfa3..9137a58 100644 (file)
@@ -33,6 +33,8 @@
 // RFC 6350 specification.
 
 vCard34Conv::vCard34Conv(){
+
+       // Setup the vCard34Conv object.
        
        vCardBegin = FALSE;
        vCardEnd = FALSE;
@@ -50,6 +52,8 @@ void vCard34Conv::ConvertV4PropertyProc(wxString *wxSPropertyName,
        std::map<wxString,bool> *PropertyLockMap,
        bool ProcessItemData, bool *VCardV3Value, bool *XVCardV4Value){
 
+       // Convert and format data to vCard 4.0 specifications.
+               
        wxString wxSProperty;
        wxString wxSPropertySeg1Chopped;
        size_t intPropertyLen;
@@ -5953,7 +5957,9 @@ void vCard34Conv::ConvertV4PropertyProc(wxString *wxSPropertyName,
 
 void vCard34Conv::ProcessCaptureStringsProc(wxString *strCapture){
 
-    CaptureString(strCapture, FALSE);
+       // Process code for capturing the strings.
+       
+       CaptureString(strCapture, FALSE);
 
 }
 
@@ -5962,6 +5968,8 @@ void vCard34Conv::SplitValues(wxString *PropertyLine,
        std::map<int,int> *SplitLength, 
        int intSize){
        
+       // Split the values as required.
+               
        size_t intPropertyLen = PropertyLine->Len();
        int intSplitsFound = 0;
        int intSplitSize = 0;
@@ -6014,6 +6022,9 @@ void vCard34Conv::SplitValuesData(wxString *PropertyLine,
        int intSize,
        std::map<wxString,wxString> *SplitData){
        
+               
+       // Split the data values as required.
+               
        wxString DataStr;
        wxStringTokenizer PropertyElement;
        wxString PropertyName;
index fe7b8c6..8034968 100644 (file)
 #include "XABAccountView.h"
 
 BEGIN_EVENT_TABLE(XABAccountView, wxTreeCtrl)
-       //EVT_LEFT_UP(XABAccountView::OnMouseClick)
-       EVT_LEFT_DCLICK(XABAccountView::OnMouseClick)
-       EVT_TREE_ITEM_EXPANDED(-1, XABAccountView::ExpColProc)
-       EVT_TREE_ITEM_COLLAPSED(-1, XABAccountView::ExpColProc)
+EVT_LEFT_DCLICK(XABAccountView::OnMouseClick)
+EVT_TREE_ITEM_EXPANDED(-1, XABAccountView::ExpColProc)
+EVT_TREE_ITEM_COLLAPSED(-1, XABAccountView::ExpColProc)
 END_EVENT_TABLE()
 
 void XABAccountView::Init(){
 
+       // Initialise the XABAccountView object.
+       
        idx = -1;
 
 }
 
 bool XABAccountView::Create(wxWindow* parent){
 
+       // Create the XABAccountView control.
+       
        return wxTreeCtrl::Create(parent, 1, wxPoint(0,0), wxSize(100,100), wxTR_DEFAULT_STYLE|wxTR_HIDE_ROOT);
 
 }
 
 wxWindow* XABAccountView::GetControl(){
 
+       // Get the control pointer.
+       
        return this;
 
 }
 
 void XABAccountView::SetStringValue(const wxString& s){
 
+       // Set the string value for the XABAccountView control.
+       
        tid = wxTreeCtrl::GetSelection();
 
 }
 
 wxString XABAccountView::GetStringValue() const{
 
+       // Get the string value for the XABAccountView control.
+       
        if (tid.IsOk()){
                wxString wxStrName = wxTreeCtrl::GetItemText(tid);
                return wxStrName;
@@ -81,14 +90,19 @@ void XABAccountView::OnMouseClick(wxMouseEvent& WXUNUSED(event)){
 
 void XABAccountView::SetAccount(){
 
+       // Set the account for the XABAccountView control.
+       
        tid = wxTreeCtrl::GetSelection();
        Dismiss();
 
 }
 
-// Needed by SetStringValue
 wxTreeItemId XABAccountView::FindItemByText(wxTreeItemId parent, const wxString& text)
 {
+       
+       // Find an item based on the supplied wxString value.
+       // Return a wxTreeItemId object if found.
+       
        wxTreeItemIdValue cookie;
        wxTreeItemId child = GetFirstChild(parent, cookie);
        while (child.IsOk())
@@ -110,6 +124,9 @@ wxTreeItemId XABAccountView::FindItemByText(wxTreeItemId parent, const wxString&
 
 void XABAccountView::ExpColProc(wxTreeEvent& event){
 
+       // Function when pressing the down button on the
+       // XABAccountView control.
+       
        ixp = TRUE;
 
 }
\ No newline at end of file
index b468833..cfef818 100644 (file)
@@ -31,6 +31,8 @@ enum {
 
 XABContactMenu::XABContactMenu(int MenuTypeIn){
 
+       // Setup the XABContactMenu control.
+       
        MenuType = MenuTypeIn;
 
        // Setup the menu items.
@@ -70,6 +72,8 @@ XABContactMenu::XABContactMenu(int MenuTypeIn){
 
 XABContactMenu::~XABContactMenu(){
 
+       // Destory the XABContactMenu object.
+       
        // Delete the menu items.
        
        for (std::map<std::string, wxMenuItem*>::iterator MenuItemIter = MenuItems.begin(); 
@@ -94,6 +98,8 @@ void XABContactMenu::AppendMenuItem(wxString ObjectName,
        int ItemID,
        wxItemKind ItemType){
        
+       // Append a menu item to the XABContactMenu control.
+               
        wxMenuItem *menuitem = new wxMenuItem(
                NULL,
                ItemID,
@@ -113,6 +119,8 @@ void XABContactMenu::SetupPointersSearch(wxWindow* WindowPtrIn,
        wxListCtrl* ContactListCtrlIn,
        bool SearchModeOnlyIn){
 
+       // Setup the pointers when being used in the search window.
+               
        WindowPtr = WindowPtrIn;
        ContactListCtrl = ContactListCtrlIn;
        SearchModeOnly = SearchModeOnlyIn;
@@ -123,6 +131,8 @@ void XABContactMenu::SetupPointers(wxWindow* WindowPtrIn,
        wxListCtrl* ContactListCtrlIn, 
        bool EnableAccountSettingsIn){
 
+       // Setup the pointers.
+               
        WindowPtr = WindowPtrIn;
        ContactListCtrl = ContactListCtrlIn;
        EnableAccountSettings = EnableAccountSettingsIn;
@@ -131,6 +141,8 @@ void XABContactMenu::SetupPointers(wxWindow* WindowPtrIn,
 
 wxMenu* XABContactMenu::MenuPointer(){
 
+       // Process the menu pointer.
+       
        // Check for the following before passing the pointer:
        // If an account has been selected.
        // - Disable Refresh Address Book if not.
@@ -204,6 +216,9 @@ wxMenu* XABContactMenu::MenuPointer(){
 
 void XABContactMenu::ProcessMenuItemClick( wxCommandEvent& event){
 
+       // Process an action when a menu item in the XABContactMenu
+       // control is selected.
+       
        int ItemID = event.GetId();
        
        if (MenuType == XABCONTACTMENU_MAIN){
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