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.
29 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
30 frameCECalAdr->SetEditorMode(FALSE);
31 intResult = GetLastInt(&ContactEditorData.CalendarList);
32 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarList,
33 &ContactEditorData.CalendarListAltID,
34 &ContactEditorData.CalendarListPID,
35 &ContactEditorData.CalendarListType,
36 &ContactEditorData.CalendarListTokens,
37 &ContactEditorData.CalendarListPref,
40 frameCECalAdr->ShowModal();
46 void frmContactEditor::ModifyCalendarAddress( wxCommandEvent& event )
49 // Bring up the window to modify the calendar address.
51 long longSelected = -1;
52 int intSelectedData = 0;
54 if (!GetSelectedItem(lboCalendarAddresses,
62 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
63 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarList,
64 &ContactEditorData.CalendarListAltID,
65 &ContactEditorData.CalendarListPID,
66 &ContactEditorData.CalendarListType,
67 &ContactEditorData.CalendarListTokens,
68 &ContactEditorData.CalendarListPref,
71 frameCECalAdr->SetEditorMode(TRUE);
72 frameCECalAdr->ShowModal();
78 void frmContactEditor::DeleteCalendarAddress( wxCommandEvent& event )
81 // Bring up the window to delete the calendar address.
83 long longSelected = -1;
84 int intSelectedData = 0;
86 if (!GetSelectedItem(lboCalendarAddresses,
94 lboCalendarAddresses->DeleteItem(longSelected);
96 DeleteMapData(intSelectedData, &ContactEditorData.CalendarList, &ContactEditorData.CalendarListAltID,
97 &ContactEditorData.CalendarListPID, &ContactEditorData.CalendarListType, &ContactEditorData.CalendarListTokens,
98 &ContactEditorData.CalendarListPref);
102 void frmContactEditor::AddCalendarRequest( wxCommandEvent& event )
105 // Bring up the window to add a calendar request address.
109 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
110 frameCECalAdr->SetEditorMode(FALSE);
111 intResult = GetLastInt(&ContactEditorData.CalendarRequestList);
112 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarRequestList,
113 &ContactEditorData.CalendarRequestListAltID,
114 &ContactEditorData.CalendarRequestListPID,
115 &ContactEditorData.CalendarRequestListType,
116 &ContactEditorData.CalendarRequestListTokens,
117 &ContactEditorData.CalendarRequestListPref,
118 lboCalendarRequestAddress,
120 frameCECalAdr->ShowModal();
121 delete frameCECalAdr;
122 frameCECalAdr = NULL;
126 void frmContactEditor::ModifyCalendarRequest( wxCommandEvent& event )
129 // Bring up the window to modify a calendar request address.
131 long longSelected = -1;
132 int intSelectedData = 0;
134 if (!GetSelectedItem(lboCalendarRequestAddress,
142 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
143 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarRequestList,
144 &ContactEditorData.CalendarRequestListAltID,
145 &ContactEditorData.CalendarRequestListPID,
146 &ContactEditorData.CalendarRequestListType,
147 &ContactEditorData.CalendarRequestListTokens,
148 &ContactEditorData.CalendarRequestListPref,
149 lboCalendarRequestAddress,
151 frameCECalAdr->SetEditorMode(TRUE);
152 frameCECalAdr->ShowModal();
153 delete frameCECalAdr;
154 frameCECalAdr = NULL;
158 void frmContactEditor::DeleteCalendarRequest( wxCommandEvent& event )
161 // Bring up the window to delete a calendar request address.
163 long longSelected = -1;
164 int intSelectedData = 0;
166 if (!GetSelectedItem(lboCalendarRequestAddress,
174 lboCalendarRequestAddress->DeleteItem(longSelected);
176 DeleteMapData(intSelectedData, &ContactEditorData.CalendarRequestList,
177 &ContactEditorData.CalendarRequestListAltID, &ContactEditorData.CalendarRequestListPID,
178 &ContactEditorData.CalendarRequestListType, &ContactEditorData.CalendarRequestListTokens,
179 &ContactEditorData.CalendarRequestListPref);
183 void frmContactEditor::AddFreeBusy( wxCommandEvent& event )
186 // Bring up the window to add a calendar free/busy address.
190 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
191 frameCECalAdr->SetEditorMode(FALSE);
192 intResult = GetLastInt(&ContactEditorData.FreeBusyList);
193 frameCECalAdr->SetupPointers(&ContactEditorData.FreeBusyList,
194 &ContactEditorData.FreeBusyListAltID,
195 &ContactEditorData.FreeBusyListPID,
196 &ContactEditorData.FreeBusyListType,
197 &ContactEditorData.FreeBusyListTokens,
198 &ContactEditorData.FreeBusyListPref,
199 lboFreeBusyAddresses,
201 frameCECalAdr->ShowModal();
202 delete frameCECalAdr;
203 frameCECalAdr = NULL;
207 void frmContactEditor::ModifyFreeBusy( wxCommandEvent& event )
210 // Bring up the window to modify a calendar free/busy address.
212 long longSelected = -1;
213 int intSelectedData = 0;
215 if (!GetSelectedItem(lboFreeBusyAddresses,
223 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
224 frameCECalAdr->SetupPointers(&ContactEditorData.FreeBusyList,
225 &ContactEditorData.FreeBusyListAltID,
226 &ContactEditorData.FreeBusyListPID,
227 &ContactEditorData.FreeBusyListType,
228 &ContactEditorData.FreeBusyListTokens,
229 &ContactEditorData.FreeBusyListPref,
230 lboFreeBusyAddresses,
232 frameCECalAdr->SetEditorMode(TRUE);
233 frameCECalAdr->ShowModal();
234 delete frameCECalAdr;
235 frameCECalAdr = NULL;
239 void frmContactEditor::DeleteFreeBusy( wxCommandEvent& event )
242 // Bring up the window to delete a calendar free/busy address.
244 long longSelected = -1;
245 int intSelectedData = 0;
247 if (!GetSelectedItem(lboFreeBusyAddresses,
255 lboFreeBusyAddresses->DeleteItem(longSelected);
257 DeleteMapData(intSelectedData, &ContactEditorData.FreeBusyList, &ContactEditorData.FreeBusyListAltID,
258 &ContactEditorData.FreeBusyListPID, &ContactEditorData.FreeBusyListType, &ContactEditorData.FreeBusyListTokens,
259 &ContactEditorData.FreeBusyListPref);