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();
44 void frmContactEditor::ModifyCalendarAddress( wxCommandEvent& event )
47 // Bring up the window to modify the calendar address.
49 long longSelected = -1;
50 int intSelectedData = 0;
52 if (lboCalendarAddresses->GetItemCount() == 0 || !GetSelectedItem(lboCalendarAddresses,
60 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
61 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarList,
62 &ContactEditorData.CalendarListAltID,
63 &ContactEditorData.CalendarListPID,
64 &ContactEditorData.CalendarListType,
65 &ContactEditorData.CalendarListTokens,
66 &ContactEditorData.CalendarListPref,
69 frameCECalAdr->SetEditorMode(TRUE);
70 frameCECalAdr->ShowModal();
76 void frmContactEditor::DeleteCalendarAddress( wxCommandEvent& event )
79 // Bring up the window to delete the calendar address.
81 long longSelected = -1;
82 int intSelectedData = 0;
84 if (lboCalendarAddresses->GetItemCount() == 0 || !GetSelectedItem(lboCalendarAddresses,
92 lboCalendarAddresses->DeleteItem(longSelected);
94 DeleteMapData(intSelectedData, &ContactEditorData.CalendarList, &ContactEditorData.CalendarListAltID,
95 &ContactEditorData.CalendarListPID, &ContactEditorData.CalendarListType, &ContactEditorData.CalendarListTokens,
96 &ContactEditorData.CalendarListPref);
100 void frmContactEditor::AddCalendarRequest( wxCommandEvent& event )
103 // Bring up the window to add a calendar request address.
105 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
106 frameCECalAdr->SetEditorMode(FALSE);
107 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarRequestList,
108 &ContactEditorData.CalendarRequestListAltID,
109 &ContactEditorData.CalendarRequestListPID,
110 &ContactEditorData.CalendarRequestListType,
111 &ContactEditorData.CalendarRequestListTokens,
112 &ContactEditorData.CalendarRequestListPref,
113 lboCalendarRequestAddress,
115 frameCECalAdr->ShowModal();
116 delete frameCECalAdr;
117 frameCECalAdr = NULL;
122 void frmContactEditor::ModifyCalendarRequest( wxCommandEvent& event )
125 // Bring up the window to modify a calendar request address.
127 long longSelected = -1;
128 int intSelectedData = 0;
130 if (lboCalendarRequestAddress->GetItemCount() == 0 || !GetSelectedItem(lboCalendarRequestAddress,
138 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
139 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarRequestList,
140 &ContactEditorData.CalendarRequestListAltID,
141 &ContactEditorData.CalendarRequestListPID,
142 &ContactEditorData.CalendarRequestListType,
143 &ContactEditorData.CalendarRequestListTokens,
144 &ContactEditorData.CalendarRequestListPref,
145 lboCalendarRequestAddress,
147 frameCECalAdr->SetEditorMode(TRUE);
148 frameCECalAdr->ShowModal();
149 delete frameCECalAdr;
150 frameCECalAdr = NULL;
154 void frmContactEditor::DeleteCalendarRequest( wxCommandEvent& event )
157 // Bring up the window to delete a calendar request address.
159 long longSelected = -1;
160 int intSelectedData = 0;
162 if (lboCalendarRequestAddress->GetItemCount() == 0 || !GetSelectedItem(lboCalendarRequestAddress,
170 lboCalendarRequestAddress->DeleteItem(longSelected);
172 DeleteMapData(intSelectedData, &ContactEditorData.CalendarRequestList,
173 &ContactEditorData.CalendarRequestListAltID, &ContactEditorData.CalendarRequestListPID,
174 &ContactEditorData.CalendarRequestListType, &ContactEditorData.CalendarRequestListTokens,
175 &ContactEditorData.CalendarRequestListPref);
179 void frmContactEditor::AddFreeBusy( wxCommandEvent& event )
182 // Bring up the window to add a calendar free/busy address.
184 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
185 frameCECalAdr->SetEditorMode(FALSE);
186 frameCECalAdr->SetupPointers(&ContactEditorData.FreeBusyList,
187 &ContactEditorData.FreeBusyListAltID,
188 &ContactEditorData.FreeBusyListPID,
189 &ContactEditorData.FreeBusyListType,
190 &ContactEditorData.FreeBusyListTokens,
191 &ContactEditorData.FreeBusyListPref,
192 lboFreeBusyAddresses,
194 frameCECalAdr->ShowModal();
195 delete frameCECalAdr;
196 frameCECalAdr = NULL;
201 void frmContactEditor::ModifyFreeBusy( wxCommandEvent& event )
204 // Bring up the window to modify a calendar free/busy address.
206 long longSelected = -1;
207 int intSelectedData = 0;
209 if (lboFreeBusyAddresses->GetItemCount() == 0 || !GetSelectedItem(lboFreeBusyAddresses,
217 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
218 frameCECalAdr->SetupPointers(&ContactEditorData.FreeBusyList,
219 &ContactEditorData.FreeBusyListAltID,
220 &ContactEditorData.FreeBusyListPID,
221 &ContactEditorData.FreeBusyListType,
222 &ContactEditorData.FreeBusyListTokens,
223 &ContactEditorData.FreeBusyListPref,
224 lboFreeBusyAddresses,
226 frameCECalAdr->SetEditorMode(TRUE);
227 frameCECalAdr->ShowModal();
228 delete frameCECalAdr;
229 frameCECalAdr = NULL;
233 void frmContactEditor::DeleteFreeBusy( wxCommandEvent& event )
236 // Bring up the window to delete a calendar free/busy address.
238 long longSelected = -1;
239 int intSelectedData = 0;
241 if (lboFreeBusyAddresses->GetItemCount() == 0 || !GetSelectedItem(lboFreeBusyAddresses,
249 lboFreeBusyAddresses->DeleteItem(longSelected);
251 DeleteMapData(intSelectedData, &ContactEditorData.FreeBusyList, &ContactEditorData.FreeBusyListAltID,
252 &ContactEditorData.FreeBusyListPID, &ContactEditorData.FreeBusyListType, &ContactEditorData.FreeBusyListTokens,
253 &ContactEditorData.FreeBusyListPref);