// frmContactEditor-Calendar.cpp - frmContactEditor Calendar tab subroutines. // // (c) 2012-2016 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 "frmContactEditor.h" #include "frmContactEditorCalAdr.h" void frmContactEditor::AddCalendarAddress( wxCommandEvent& event ) { // Bring up the window to add the calendar address. frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this ); frameCECalAdr->SetEditorMode(FALSE); frameCECalAdr->SetupPointers(&ContactEditorData.CalendarList, &ContactEditorData.CalendarListAltID, &ContactEditorData.CalendarListPID, &ContactEditorData.CalendarListType, &ContactEditorData.CalendarListTokens, &ContactEditorData.CalendarListPref, lboCalendarAddresses, (intValueSeek)); frameCECalAdr->ShowModal(); delete frameCECalAdr; frameCECalAdr = NULL; } void frmContactEditor::ModifyCalendarAddress( wxCommandEvent& event ) { // Bring up the window to modify the calendar address. long longSelected = -1; int intSelectedData = 0; if (lboCalendarAddresses->GetItemCount() == 0 || !GetSelectedItem(lboCalendarAddresses, &longSelected, &intSelectedData)){ return; } frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this ); frameCECalAdr->SetupPointers(&ContactEditorData.CalendarList, &ContactEditorData.CalendarListAltID, &ContactEditorData.CalendarListPID, &ContactEditorData.CalendarListType, &ContactEditorData.CalendarListTokens, &ContactEditorData.CalendarListPref, lboCalendarAddresses, intSelectedData); frameCECalAdr->SetEditorMode(TRUE); frameCECalAdr->ShowModal(); delete frameCECalAdr; frameCECalAdr = NULL; } void frmContactEditor::DeleteCalendarAddress( wxCommandEvent& event ) { // Bring up the window to delete the calendar address. long longSelected = -1; int intSelectedData = 0; if (lboCalendarAddresses->GetItemCount() == 0 || !GetSelectedItem(lboCalendarAddresses, &longSelected, &intSelectedData)){ return; } lboCalendarAddresses->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.CalendarList, &ContactEditorData.CalendarListAltID, &ContactEditorData.CalendarListPID, &ContactEditorData.CalendarListType, &ContactEditorData.CalendarListTokens, &ContactEditorData.CalendarListPref); } void frmContactEditor::AddCalendarRequest( wxCommandEvent& event ) { // Bring up the window to add a calendar request address. frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this ); frameCECalAdr->SetEditorMode(FALSE); frameCECalAdr->SetupPointers(&ContactEditorData.CalendarRequestList, &ContactEditorData.CalendarRequestListAltID, &ContactEditorData.CalendarRequestListPID, &ContactEditorData.CalendarRequestListType, &ContactEditorData.CalendarRequestListTokens, &ContactEditorData.CalendarRequestListPref, lboCalendarRequestAddress, (intValueSeek)); frameCECalAdr->ShowModal(); delete frameCECalAdr; frameCECalAdr = NULL; } void frmContactEditor::ModifyCalendarRequest( wxCommandEvent& event ) { // Bring up the window to modify a calendar request address. long longSelected = -1; int intSelectedData = 0; if (lboCalendarRequestAddress->GetItemCount() == 0 || !GetSelectedItem(lboCalendarRequestAddress, &longSelected, &intSelectedData)){ return; } frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this ); frameCECalAdr->SetupPointers(&ContactEditorData.CalendarRequestList, &ContactEditorData.CalendarRequestListAltID, &ContactEditorData.CalendarRequestListPID, &ContactEditorData.CalendarRequestListType, &ContactEditorData.CalendarRequestListTokens, &ContactEditorData.CalendarRequestListPref, lboCalendarRequestAddress, intSelectedData); frameCECalAdr->SetEditorMode(TRUE); frameCECalAdr->ShowModal(); delete frameCECalAdr; frameCECalAdr = NULL; } void frmContactEditor::DeleteCalendarRequest( wxCommandEvent& event ) { // Bring up the window to delete a calendar request address. long longSelected = -1; int intSelectedData = 0; if (lboCalendarRequestAddress->GetItemCount() == 0 || !GetSelectedItem(lboCalendarRequestAddress, &longSelected, &intSelectedData)){ return; } lboCalendarRequestAddress->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.CalendarRequestList, &ContactEditorData.CalendarRequestListAltID, &ContactEditorData.CalendarRequestListPID, &ContactEditorData.CalendarRequestListType, &ContactEditorData.CalendarRequestListTokens, &ContactEditorData.CalendarRequestListPref); } void frmContactEditor::AddFreeBusy( wxCommandEvent& event ) { // Bring up the window to add a calendar free/busy address. frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this ); frameCECalAdr->SetEditorMode(FALSE); frameCECalAdr->SetupPointers(&ContactEditorData.FreeBusyList, &ContactEditorData.FreeBusyListAltID, &ContactEditorData.FreeBusyListPID, &ContactEditorData.FreeBusyListType, &ContactEditorData.FreeBusyListTokens, &ContactEditorData.FreeBusyListPref, lboFreeBusyAddresses, (intValueSeek)); frameCECalAdr->ShowModal(); delete frameCECalAdr; frameCECalAdr = NULL; } void frmContactEditor::ModifyFreeBusy( wxCommandEvent& event ) { // Bring up the window to modify a calendar free/busy address. long longSelected = -1; int intSelectedData = 0; if (lboFreeBusyAddresses->GetItemCount() == 0 || !GetSelectedItem(lboFreeBusyAddresses, &longSelected, &intSelectedData)){ return; } frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this ); frameCECalAdr->SetupPointers(&ContactEditorData.FreeBusyList, &ContactEditorData.FreeBusyListAltID, &ContactEditorData.FreeBusyListPID, &ContactEditorData.FreeBusyListType, &ContactEditorData.FreeBusyListTokens, &ContactEditorData.FreeBusyListPref, lboFreeBusyAddresses, intSelectedData); frameCECalAdr->SetEditorMode(TRUE); frameCECalAdr->ShowModal(); delete frameCECalAdr; frameCECalAdr = NULL; } void frmContactEditor::DeleteFreeBusy( wxCommandEvent& event ) { // Bring up the window to delete a calendar free/busy address. long longSelected = -1; int intSelectedData = 0; if (lboFreeBusyAddresses->GetItemCount() == 0 || !GetSelectedItem(lboFreeBusyAddresses, &longSelected, &intSelectedData)){ return; } lboFreeBusyAddresses->DeleteItem(longSelected); DeleteMapData(intSelectedData, &ContactEditorData.FreeBusyList, &ContactEditorData.FreeBusyListAltID, &ContactEditorData.FreeBusyListPID, &ContactEditorData.FreeBusyListType, &ContactEditorData.FreeBusyListTokens, &ContactEditorData.FreeBusyListPref); }