1 // frmContactEditor-Calendar.cpp - frmContactEditor Calendar tab subroutines.
3 // (c) 2012-2016 Xestia Software Development.
5 // This file is part of Xestia Address Book.
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include "frmContactEditor.h"
20 #include "frmContactEditorCalAdr.h"
22 void frmContactEditor::AddCalendarAddress( wxCommandEvent& event )
25 // Bring up the window to add the calendar address.
27 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
28 frameCECalAdr->SetEditorMode(FALSE);
29 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarList,
30 &ContactEditorData.CalendarListAltID,
31 &ContactEditorData.CalendarListPID,
32 &ContactEditorData.CalendarListType,
33 &ContactEditorData.CalendarListTokens,
34 &ContactEditorData.CalendarListPref,
37 frameCECalAdr->ShowModal();
43 void frmContactEditor::ModifyCalendarAddress( wxCommandEvent& event )
46 // Bring up the window to modify the calendar address.
48 long longSelected = -1;
49 int intSelectedData = 0;
51 if (lboCalendarAddresses->GetItemCount() == 0 || !GetSelectedItem(lboCalendarAddresses,
59 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
60 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarList,
61 &ContactEditorData.CalendarListAltID,
62 &ContactEditorData.CalendarListPID,
63 &ContactEditorData.CalendarListType,
64 &ContactEditorData.CalendarListTokens,
65 &ContactEditorData.CalendarListPref,
68 frameCECalAdr->SetEditorMode(TRUE);
69 frameCECalAdr->ShowModal();
75 void frmContactEditor::DeleteCalendarAddress( wxCommandEvent& event )
78 // Bring up the window to delete the calendar address.
80 long longSelected = -1;
81 int intSelectedData = 0;
83 if (lboCalendarAddresses->GetItemCount() == 0 || !GetSelectedItem(lboCalendarAddresses,
91 lboCalendarAddresses->DeleteItem(longSelected);
93 DeleteMapData(intSelectedData, &ContactEditorData.CalendarList, &ContactEditorData.CalendarListAltID,
94 &ContactEditorData.CalendarListPID, &ContactEditorData.CalendarListType, &ContactEditorData.CalendarListTokens,
95 &ContactEditorData.CalendarListPref);
99 void frmContactEditor::AddCalendarRequest( wxCommandEvent& event )
102 // Bring up the window to add a calendar request address.
104 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
105 frameCECalAdr->SetEditorMode(FALSE);
106 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarRequestList,
107 &ContactEditorData.CalendarRequestListAltID,
108 &ContactEditorData.CalendarRequestListPID,
109 &ContactEditorData.CalendarRequestListType,
110 &ContactEditorData.CalendarRequestListTokens,
111 &ContactEditorData.CalendarRequestListPref,
112 lboCalendarRequestAddress,
114 frameCECalAdr->ShowModal();
115 delete frameCECalAdr;
116 frameCECalAdr = NULL;
120 void frmContactEditor::ModifyCalendarRequest( wxCommandEvent& event )
123 // Bring up the window to modify a calendar request address.
125 long longSelected = -1;
126 int intSelectedData = 0;
128 if (lboCalendarRequestAddress->GetItemCount() == 0 || !GetSelectedItem(lboCalendarRequestAddress,
136 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
137 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarRequestList,
138 &ContactEditorData.CalendarRequestListAltID,
139 &ContactEditorData.CalendarRequestListPID,
140 &ContactEditorData.CalendarRequestListType,
141 &ContactEditorData.CalendarRequestListTokens,
142 &ContactEditorData.CalendarRequestListPref,
143 lboCalendarRequestAddress,
145 frameCECalAdr->SetEditorMode(TRUE);
146 frameCECalAdr->ShowModal();
147 delete frameCECalAdr;
148 frameCECalAdr = NULL;
152 void frmContactEditor::DeleteCalendarRequest( wxCommandEvent& event )
155 // Bring up the window to delete a calendar request address.
157 long longSelected = -1;
158 int intSelectedData = 0;
160 if (lboCalendarRequestAddress->GetItemCount() == 0 || !GetSelectedItem(lboCalendarRequestAddress,
168 lboCalendarRequestAddress->DeleteItem(longSelected);
170 DeleteMapData(intSelectedData, &ContactEditorData.CalendarRequestList,
171 &ContactEditorData.CalendarRequestListAltID, &ContactEditorData.CalendarRequestListPID,
172 &ContactEditorData.CalendarRequestListType, &ContactEditorData.CalendarRequestListTokens,
173 &ContactEditorData.CalendarRequestListPref);
177 void frmContactEditor::AddFreeBusy( wxCommandEvent& event )
180 // Bring up the window to add a calendar free/busy address.
182 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
183 frameCECalAdr->SetEditorMode(FALSE);
184 frameCECalAdr->SetupPointers(&ContactEditorData.FreeBusyList,
185 &ContactEditorData.FreeBusyListAltID,
186 &ContactEditorData.FreeBusyListPID,
187 &ContactEditorData.FreeBusyListType,
188 &ContactEditorData.FreeBusyListTokens,
189 &ContactEditorData.FreeBusyListPref,
190 lboFreeBusyAddresses,
192 frameCECalAdr->ShowModal();
193 delete frameCECalAdr;
194 frameCECalAdr = NULL;
198 void frmContactEditor::ModifyFreeBusy( wxCommandEvent& event )
201 // Bring up the window to modify a calendar free/busy address.
203 long longSelected = -1;
204 int intSelectedData = 0;
206 if (lboFreeBusyAddresses->GetItemCount() == 0 || !GetSelectedItem(lboFreeBusyAddresses,
214 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
215 frameCECalAdr->SetupPointers(&ContactEditorData.FreeBusyList,
216 &ContactEditorData.FreeBusyListAltID,
217 &ContactEditorData.FreeBusyListPID,
218 &ContactEditorData.FreeBusyListType,
219 &ContactEditorData.FreeBusyListTokens,
220 &ContactEditorData.FreeBusyListPref,
221 lboFreeBusyAddresses,
223 frameCECalAdr->SetEditorMode(TRUE);
224 frameCECalAdr->ShowModal();
225 delete frameCECalAdr;
226 frameCECalAdr = NULL;
230 void frmContactEditor::DeleteFreeBusy( wxCommandEvent& event )
233 // Bring up the window to delete a calendar free/busy address.
235 long longSelected = -1;
236 int intSelectedData = 0;
238 if (lboFreeBusyAddresses->GetItemCount() == 0 || !GetSelectedItem(lboFreeBusyAddresses,
246 lboFreeBusyAddresses->DeleteItem(longSelected);
248 DeleteMapData(intSelectedData, &ContactEditorData.FreeBusyList, &ContactEditorData.FreeBusyListAltID,
249 &ContactEditorData.FreeBusyListPID, &ContactEditorData.FreeBusyListType, &ContactEditorData.FreeBusyListTokens,
250 &ContactEditorData.FreeBusyListPref);