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 )
26 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
27 frameCECalAdr->SetEditorMode(FALSE);
28 intResult = GetLastInt(&ContactEditorData.CalendarList);
29 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarList,
30 &ContactEditorData.CalendarListAltID,
31 &ContactEditorData.CalendarListPID,
32 &ContactEditorData.CalendarListType,
33 &ContactEditorData.CalendarListTokens,
34 &ContactEditorData.CalendarListPref,
37 frameCECalAdr->ShowModal();
42 void frmContactEditor::ModifyCalendarAddress( wxCommandEvent& event )
44 long longSelected = -1;
45 int intSelectedData = 0;
47 if (!GetSelectedItem(lboCalendarAddresses,
53 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
54 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarList,
55 &ContactEditorData.CalendarListAltID,
56 &ContactEditorData.CalendarListPID,
57 &ContactEditorData.CalendarListType,
58 &ContactEditorData.CalendarListTokens,
59 &ContactEditorData.CalendarListPref,
62 frameCECalAdr->SetEditorMode(TRUE);
63 frameCECalAdr->ShowModal();
68 void frmContactEditor::DeleteCalendarAddress( wxCommandEvent& event )
70 long longSelected = -1;
71 int intSelectedData = 0;
73 if (!GetSelectedItem(lboCalendarAddresses,
79 lboCalendarAddresses->DeleteItem(longSelected);
81 DeleteMapData(intSelectedData, &ContactEditorData.CalendarList, &ContactEditorData.CalendarListAltID,
82 &ContactEditorData.CalendarListPID, &ContactEditorData.CalendarListType, &ContactEditorData.CalendarListTokens,
83 &ContactEditorData.CalendarListPref);
87 void frmContactEditor::AddCalendarRequest( wxCommandEvent& event )
91 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
92 frameCECalAdr->SetEditorMode(FALSE);
93 intResult = GetLastInt(&ContactEditorData.CalendarRequestList);
94 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarRequestList,
95 &ContactEditorData.CalendarRequestListAltID,
96 &ContactEditorData.CalendarRequestListPID,
97 &ContactEditorData.CalendarRequestListType,
98 &ContactEditorData.CalendarRequestListTokens,
99 &ContactEditorData.CalendarRequestListPref,
100 lboCalendarRequestAddress,
102 frameCECalAdr->ShowModal();
103 delete frameCECalAdr;
104 frameCECalAdr = NULL;
107 void frmContactEditor::ModifyCalendarRequest( wxCommandEvent& event )
109 long longSelected = -1;
110 int intSelectedData = 0;
112 if (!GetSelectedItem(lboCalendarRequestAddress,
118 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
119 frameCECalAdr->SetupPointers(&ContactEditorData.CalendarRequestList,
120 &ContactEditorData.CalendarRequestListAltID,
121 &ContactEditorData.CalendarRequestListPID,
122 &ContactEditorData.CalendarRequestListType,
123 &ContactEditorData.CalendarRequestListTokens,
124 &ContactEditorData.CalendarRequestListPref,
125 lboCalendarRequestAddress,
127 frameCECalAdr->SetEditorMode(TRUE);
128 frameCECalAdr->ShowModal();
129 delete frameCECalAdr;
130 frameCECalAdr = NULL;
133 void frmContactEditor::DeleteCalendarRequest( wxCommandEvent& event )
135 long longSelected = -1;
136 int intSelectedData = 0;
138 if (!GetSelectedItem(lboCalendarRequestAddress,
144 lboCalendarRequestAddress->DeleteItem(longSelected);
146 DeleteMapData(intSelectedData, &ContactEditorData.CalendarRequestList,
147 &ContactEditorData.CalendarRequestListAltID, &ContactEditorData.CalendarRequestListPID,
148 &ContactEditorData.CalendarRequestListType, &ContactEditorData.CalendarRequestListTokens,
149 &ContactEditorData.CalendarRequestListPref);
152 void frmContactEditor::AddFreeBusy( wxCommandEvent& event )
156 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
157 frameCECalAdr->SetEditorMode(FALSE);
158 intResult = GetLastInt(&ContactEditorData.FreeBusyList);
159 frameCECalAdr->SetupPointers(&ContactEditorData.FreeBusyList,
160 &ContactEditorData.FreeBusyListAltID,
161 &ContactEditorData.FreeBusyListPID,
162 &ContactEditorData.FreeBusyListType,
163 &ContactEditorData.FreeBusyListTokens,
164 &ContactEditorData.FreeBusyListPref,
165 lboFreeBusyAddresses,
167 frameCECalAdr->ShowModal();
168 delete frameCECalAdr;
169 frameCECalAdr = NULL;
172 void frmContactEditor::ModifyFreeBusy( wxCommandEvent& event )
174 long longSelected = -1;
175 int intSelectedData = 0;
177 if (!GetSelectedItem(lboFreeBusyAddresses,
183 frmContactEditorCalAdr *frameCECalAdr = new frmContactEditorCalAdr ( this );
184 frameCECalAdr->SetupPointers(&ContactEditorData.FreeBusyList,
185 &ContactEditorData.FreeBusyListAltID,
186 &ContactEditorData.FreeBusyListPID,
187 &ContactEditorData.FreeBusyListType,
188 &ContactEditorData.FreeBusyListTokens,
189 &ContactEditorData.FreeBusyListPref,
190 lboFreeBusyAddresses,
192 frameCECalAdr->SetEditorMode(TRUE);
193 frameCECalAdr->ShowModal();
194 delete frameCECalAdr;
195 frameCECalAdr = NULL;
198 void frmContactEditor::DeleteFreeBusy( wxCommandEvent& event )
200 long longSelected = -1;
201 int intSelectedData = 0;
203 if (!GetSelectedItem(lboFreeBusyAddresses,
209 lboFreeBusyAddresses->DeleteItem(longSelected);
211 DeleteMapData(intSelectedData, &ContactEditorData.FreeBusyList, &ContactEditorData.FreeBusyListAltID,
212 &ContactEditorData.FreeBusyListPID, &ContactEditorData.FreeBusyListType, &ContactEditorData.FreeBusyListTokens,
213 &ContactEditorData.FreeBusyListPref);