Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
fabe5cb3456d71607fbdbabf6cbc0c39dae78868
[xestiaab/.git] / source / contacteditor / frmContactEditor.h
1 // frmContactEditor.h - frmContactEditor form header.
2 //
3 // (c) 2012-2016 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
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.
10 //
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.
15 //
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 #ifndef __frmContactEditor__
20 #define __frmContactEditor__
22 #include <wx/wx.h>
24 #include <map>
25 #include <string>
27 #include <SFML/Audio.hpp>
29 /**
30 @file
31 Subclass of frmContactEditorADT, which is generated by wxFormBuilder.
32 */
34 #include "../AppXestiaAddrBk.h"
35 #include "../vcard/vcard.h"
36 #include "../common/textprocessing.h"
37 #include "../common/etag.h"
38 #include "../common/timers.h"
40 #include "../actmgr/frmActivityMgr.h"
41 #include "../frmMain.h"
43 #include "cdo/ContactDataObject.h"
45 #define CE_NICKNAME wxT("Nickname")
46 #define CE_ADDRESS wxT("Address")
47 #define CE_EMAIL wxT("Email")
48 #define CE_IM wxT("IM")
49 #define CE_TELEPHONE wxT("Telephone")
50 #define CE_LANG wxT("Languages")
51 #define CE_TZ wxT("Timezone")
52 #define CE_RELATED wxT("Related")
53 #define CE_WEBSITE wxT("Websites")
54 #define CE_TITLE wxT("Titles")
55 #define CE_GEOPOSITION wxT("Geoposition")
56 #define CE_ROLE wxT("Roles")
57 #define CE_ORG wxT("Organisations")
58 #define CE_NOTE wxT("Notes")
59 #define CE_CATEGORIES wxT("Categories")
60 #define CE_GROUPS wxT("Groups")
61 #define CE_PICTURES wxT("Pictures")
62 #define CE_SOUNDS wxT("Sounds")
63 #define CE_CALENDAR wxT("Calendar")
64 #define CE_KEY wxT("Key")
65 #define CE_TOKEN wxT("Token")
67 //// end generated include
69 struct frmMain;
70 struct frmActivityMgr;
72 // Special Audio Stream for detecting when a sound has stopped playing.
73 class AudioStream: public sf::Music
74 {
75 private:
77    bool onGetData(SoundStream::Chunk& data)
78    {
79        FilePlaying = TRUE;
80        bool running = sf::Music::onGetData(data);
81        if(!running)
82            OnMusicEnd();
83        return running;
84    }
85 public:
86    void OnMusicEnd() { }
87    bool GetPlayingStatus(){ return FilePlaying; }   
89     bool FilePlaying = TRUE;
90 };
92 /** Implementing frmContactEditorADT */
93 class frmContactEditor : public frmContactEditorADT
94 {
95         protected:
96                 // Handlers for frmContactEditorADT events.
97                 void AddGeneralNickname( wxCommandEvent& event );
98                 void ModifyGeneralNickname( wxCommandEvent& event );
99                 void DeleteGeneralNickname( wxCommandEvent& event );
100                 void AddHomeNickname( wxCommandEvent& event );
101                 void ModifyHomeNickname( wxCommandEvent& event );
102                 void DeleteHomeNickname( wxCommandEvent& event );
103                 void AddBusinessNickname( wxCommandEvent& event );
104                 void ModifyBusinessNickname( wxCommandEvent& event );
105                 void DeleteBusinessNickname( wxCommandEvent& event );
106                 void AddGeneralAddress( wxCommandEvent& event );
107                 void ModifyGeneralAddress( wxCommandEvent& event );
108                 void DeleteGeneralAddress( wxCommandEvent& event );
109                 void AddGeneralEmail( wxCommandEvent& event );
110                 void ModifyGeneralEmail( wxCommandEvent& event );
111                 void DeleteGeneralEmail( wxCommandEvent& event );
112                 void AddGeneralIM( wxCommandEvent& event );
113                 void ModifyGeneralIM( wxCommandEvent& event );
114                 void DeleteGeneralIM( wxCommandEvent& event );
115                 void MoveGeneralIMUp( wxCommandEvent& event );
116                 void MoveGeneralIMDown( wxCommandEvent& event );
117                 void AddGeneralTelephone( wxCommandEvent& event );
118                 void ModifyGeneralTelephone( wxCommandEvent& event );
119                 void DeleteGeneralTelephone( wxCommandEvent& event );
120                 void AddGeneralLanguages( wxCommandEvent& event );
121                 void ModifyGeneralLanguages( wxCommandEvent& event );
122                 void DeleteGeneralLanguage( wxCommandEvent& event );
123                 void AddGeneralTimezone( wxCommandEvent& event );
124                 void ModifyGeneralTimezone( wxCommandEvent& event );
125                 void DeleteGeneralTimezone( wxCommandEvent& event );
126                 void AddGeneralGeoposition( wxCommandEvent& event );
127                 void ModifyGeneralGeoposition( wxCommandEvent& event );
128                 void DeleteGeneralGeoposition( wxCommandEvent& event ); 
129                 void AddGeneralRelated( wxCommandEvent& event );
130                 void ModifyGeneralRelated( wxCommandEvent& event );
131                 void DeleteGeneralRelated( wxCommandEvent& event );
132                 void AddGeneralWebsite( wxCommandEvent& event );
133                 void ModifyGeneralWebsite( wxCommandEvent& event );
134                 void DeleteGeneralWebsite( wxCommandEvent& event );
135                 void MoveGeneralWebsiteUp( wxCommandEvent& event );
136                 void MoveGeneralWebsiteDown( wxCommandEvent& event );
137                 void AddGeneralTitle( wxCommandEvent& event );
138                 void ModifyGeneralTitle( wxCommandEvent& event );
139                 void DeleteGeneralTitle( wxCommandEvent& event );
140                 void MoveGeneralTitleUp( wxCommandEvent& event );
141                 void MoveGeneralTitleDown( wxCommandEvent& event );
142                 void AddGeneralRole( wxCommandEvent& event );
143                 void ModifyGeneralRole( wxCommandEvent& event );
144                 void DeleteGeneralRole( wxCommandEvent& event );
145                 void MoveGeneralRoleUp( wxCommandEvent& event );
146                 void MoveGeneralRoleDown( wxCommandEvent& event );
147                 void AddGeneralOrganisation( wxCommandEvent& event );
148                 void ModifyGeneralOrganisation( wxCommandEvent& event );
149                 void DeleteGeneralOrganisation( wxCommandEvent& event );
150                 void MoveGeneralOrganisationUp( wxCommandEvent& event );
151                 void MoveGeneralOrganisationDown( wxCommandEvent& event );
152                 void AddGeneralNote( wxCommandEvent& event );
153                 void ModifyGeneralNote( wxCommandEvent& event );
154                 void DeleteGeneralNote( wxCommandEvent& event );
155                 void MoveGeneralNoteUp( wxCommandEvent& event );
156                 void MoveGeneralNoteDown( wxCommandEvent& event );
157                 void AddHomeAddress( wxCommandEvent& event );
158                 void ModifyHomeAddress( wxCommandEvent& event );
159                 void DeleteHomeAddress( wxCommandEvent& event );
160                 void AddHomeEmail( wxCommandEvent& event );
161                 void ModifyHomeEmail( wxCommandEvent& event );
162                 void DeleteHomeEmail( wxCommandEvent& event );          
163                 void AddHomeIM( wxCommandEvent& event );
164                 void ModifyHomeIM( wxCommandEvent& event );
165                 void DeleteHomeIM( wxCommandEvent& event );
166                 void AddHomeTelephone( wxCommandEvent& event );
167                 void ModifyHomeTelephone( wxCommandEvent& event );
168                 void DeleteHomeTelephone( wxCommandEvent& event );
169                 void AddHomeLanguage( wxCommandEvent& event );
170                 void ModifyHomeLanguage( wxCommandEvent& event );
171                 void DeleteHomeLanguage( wxCommandEvent& event );
172                 void AddHomeTimezone( wxCommandEvent& event );
173                 void ModifyHomeTimezone( wxCommandEvent& event );
174                 void DeleteHomeTimezone( wxCommandEvent& event );
175                 void AddHomeGeoposition( wxCommandEvent& event );
176                 void ModifyHomeGeoposition( wxCommandEvent& event );
177                 void DeleteHomeGeoposition( wxCommandEvent& event );
178                 void AddHomeRelated( wxCommandEvent& event );
179                 void ModifyHomeRelated( wxCommandEvent& event );
180                 void DeleteHomeRelated( wxCommandEvent& event );
181                 void AddHomeWebsite( wxCommandEvent& event );
182                 void ModifyHomeWebsite( wxCommandEvent& event );
183                 void DeleteHomeWebsite( wxCommandEvent& event );
184                 void AddHomeTitle( wxCommandEvent& event );
185                 void ModifyHomeTitle( wxCommandEvent& event );
186                 void DeleteHomeTitle( wxCommandEvent& event );
187                 void AddHomeRole( wxCommandEvent& event );
188                 void ModifyHomeRole( wxCommandEvent& event );
189                 void DeleteHomeRole( wxCommandEvent& event );
190                 void MoveHomeRoleUp( wxCommandEvent& event );
191                 void MoveHomeRoleDown( wxCommandEvent& event );
192                 void AddHomeOrganisation( wxCommandEvent& event );
193                 void ModifyHomeOrganisation( wxCommandEvent& event );
194                 void DeleteHomeOrganisation( wxCommandEvent& event );
195                 void MoveHomeOrganisationUp( wxCommandEvent& event );
196                 void MoveHomeOrganisationDown( wxCommandEvent& event );
197                 void AddHomeNote( wxCommandEvent& event );
198                 void ModifyHomeNote( wxCommandEvent& event );
199                 void DeleteHomeNote( wxCommandEvent& event );
200                 void MoveHomeNoteUp( wxCommandEvent& event );
201                 void MoveHomeNoteDown( wxCommandEvent& event );
202                 void AddBusinessAddress( wxCommandEvent& event );
203                 void ModifyBusinessAddress( wxCommandEvent& event );
204                 void DeleteBusinessAddress( wxCommandEvent& event );
205                 void AddBusinessEmail( wxCommandEvent& event );
206                 void ModifyBusinessEmail( wxCommandEvent& event );
207                 void DeleteBusinessEmail( wxCommandEvent& event );
208                 void AddBusinessIM( wxCommandEvent& event );
209                 void ModifyBusinessIM( wxCommandEvent& event );
210                 void DeleteBusinessIM( wxCommandEvent& event );
211                 void AddBusinessTelephone( wxCommandEvent& event );
212                 void ModifyBusinessTelephone( wxCommandEvent& event );
213                 void DeleteBusinessTelephone( wxCommandEvent& event );
214                 void AddBusinessLanguage( wxCommandEvent& event );
215                 void ModifyBusinessLanguage( wxCommandEvent& event );
216                 void DeleteBusinessLanguage( wxCommandEvent& event );
217                 void AddBusinessTimezone( wxCommandEvent& event );
218                 void ModifyBusinessTimezone( wxCommandEvent& event );
219                 void DeleteBusinessTimezone( wxCommandEvent& event );
220                 void AddBusinessGeoposition( wxCommandEvent& event );
221                 void ModifyBusinessGeoposition( wxCommandEvent& event );
222                 void DeleteBusinessGeoposition( wxCommandEvent& event );
223                 void AddBusinessRelated( wxCommandEvent& event );
224                 void ModifyBusinessRelated( wxCommandEvent& event );
225                 void DeleteBusinessRelated( wxCommandEvent& event );
226                 void AddBusinessWebsite( wxCommandEvent& event );
227                 void ModifyBusinessWebsite( wxCommandEvent& event );
228                 void DeleteBusinessWebsite( wxCommandEvent& event );
229                 void AddBusinessTitle( wxCommandEvent& event );
230                 void ModifyBusinessTitle( wxCommandEvent& event );
231                 void DeleteBusinessTitle( wxCommandEvent& event );
232                 void MoveBusinessTitleUp( wxCommandEvent& event );
233                 void MoveBusinessTitleDown( wxCommandEvent& event );
234                 void AddBusinessRole( wxCommandEvent& event );
235                 void ModifyBusinessRole( wxCommandEvent& event );
236                 void DeleteBusinessRole( wxCommandEvent& event );
237                 void MoveBusinessRoleUp( wxCommandEvent& event );
238                 void MoveBusinessRoleDown( wxCommandEvent& event );
239                 void AddBusinessOrganisation( wxCommandEvent& event );
240                 void ModifyBusinessOrganisation( wxCommandEvent& event );
241                 void DeleteBusinessOrganisation( wxCommandEvent& event );
242                 void MoveBusinessOrganisationUp( wxCommandEvent& event );
243                 void MoveBusinessOrganisationDown( wxCommandEvent& event );
244                 void AddBusinessNote( wxCommandEvent& event );
245                 void ModifyBusinessNote( wxCommandEvent& event );
246                 void DeleteBusinessNote( wxCommandEvent& event );
247                 void MoveBusinessNoteUp( wxCommandEvent& event );
248                 void MoveBusinessNoteDown( wxCommandEvent& event );
249                 void AddCategory( wxCommandEvent& event );
250                 void ModifyCategory( wxCommandEvent& event );
251                 void DeleteCategory( wxCommandEvent& event );
252                 void AddGroup( wxCommandEvent& event );
253                 void ModifyGroup( wxCommandEvent& event );
254                 void DeleteGroup( wxCommandEvent& event );
255                 void AddPicture( wxCommandEvent& event );
256                 void ModifyPicture( wxCommandEvent& event );
257                 void DeletePicture( wxCommandEvent& event );
258                 void LoadPicture( wxListEvent& event );
259                 void SavePicture( wxCommandEvent& event);
260                 void AddLogo( wxCommandEvent& event );
261                 void ModifyLogo( wxCommandEvent& event );
262                 void DeleteLogo( wxCommandEvent& event );               
263                 void LoadLogo( wxListEvent& event );
264                 void SaveLogo( wxCommandEvent& event);  
265                 void AddSound( wxCommandEvent& event );
266                 void ModifySound( wxCommandEvent& event );
267                 void DeleteSound( wxCommandEvent& event );
268                 void SaveSound( wxCommandEvent& event); 
269                 void PlaySoundDetach();
270                 void PlaySound( wxCommandEvent& event );
271                 void StopSound( wxCommandEvent& event );
272                 void AddCalendarAddress( wxCommandEvent& event );
273                 void ModifyCalendarAddress( wxCommandEvent& event );
274                 void DeleteCalendarAddress( wxCommandEvent& event );
275                 void AddCalendarRequest( wxCommandEvent& event );
276                 void ModifyCalendarRequest( wxCommandEvent& event );
277                 void DeleteCalendarRequest( wxCommandEvent& event );
278                 void AddFreeBusy( wxCommandEvent& event );
279                 void ModifyFreeBusy( wxCommandEvent& event );
280                 void DeleteFreeBusy( wxCommandEvent& event );
281                 void AddKey( wxCommandEvent& event );
282                 void ModifyKey( wxCommandEvent& event );
283                 void DeleteKey( wxCommandEvent& event );
284                 void AddVendorNamespace( wxCommandEvent& event );
285                 void ModifyVendorNamespace( wxCommandEvent& event );
286                 void DeleteVendorNamespace( wxCommandEvent& event );
287                 void MoveVendorNamespaceUp( wxCommandEvent& event );
288                 void MoveVendorNamespaceDown( wxCommandEvent& event );
289                 void AddXToken( wxCommandEvent& event );
290                 void ModifyXToken( wxCommandEvent& event );
291                 void DeleteXToken( wxCommandEvent& event );
292                 void MoveXTokenUp( wxCommandEvent& event );
293                 void MoveXTokenDown( wxCommandEvent& event );
294                 void SaveContact( wxCommandEvent& event );
295                 void SaveCloseContact( wxCommandEvent& event );
296                 void CloseContact( wxCommandEvent& event );
297                 void CloseWindow( wxCloseEvent& event );
298                 void CutText( wxCommandEvent& event );
299                 void CopyText( wxCommandEvent& event );
300                 void PasteText( wxCommandEvent& event );
301                 void SetupColumn(wxString ColumnType, wxListCtrl *ListCtrl);
302                 void UpdateMembersTab( wxCommandEvent &event );
303                 void UpdateDisplayAs( wxCommandEvent &event );
304                 void UpdateName( wxCommandEvent &event );
305                 bool GetSelectedItem(wxListCtrl *ListCtrlPtr, 
306                         long *longSelected,
307                         int *intSelectedData);
308                 int GetLastInt(std::map<int, wxString> *MapData);
309                 int GetLastInt(std::map<int, std::string> *MapData);
310                 bool ProcessEvent(wxEvent& event);
311         public:
312                 /** Constructor */
313                 frmContactEditor( wxWindow* parent );
314                 void SetupHeaders();
315                 void SetupContact(wxString AccountName);
316                 void SetupAccountData(bool UnsupportedAccount);
317                 void SetupPointers(frmActivityMgr *ActMgr, wxETagProcessTimer *ETagProc,
318                                         frmMain *MainPtrInc);
319                 bool LoadContact(wxString Filename);
320                 void SetMode(bool StartupEditMode);
321                 void SetUID(int UID);
322         private:
323         
324                 void DeleteMapDataProcess(int IndexNum, std::map<int, std::string>* MapData);
325                 void DeleteMapDataProcess(int IndexNum, std::map<int, wxString>* MapData);
326                 void DeleteMapDataProcess(int IndexNum, std::map<int, bool>* MapData);
327                 void DeleteMapDataProcess(int IndexNum, std::map<int, int>* MapData);
329                 void DeleteMapDataB () {} ;
330         
331                 template<typename MapData, typename... Args>
332                 void DeleteMapDataB(MapData* mapdata, Args*... args) {
334                         DeleteMapDataProcess(intSeekSelectedData, mapdata);
335                         DeleteMapDataB(args...);
337                 }
339                 template<typename... Args>
340                 void DeleteMapData(int IndexNum, Args*... args) {
342                         //int intSeekSelectedData = 0;
344                         //DeleteMapDataProcess(IndexNum, Moo);
346                         intSeekSelectedData = IndexNum;
347                         DeleteMapDataB(args...);
348         
349                 }
351                 void ProcessSaveDataProc(wxString PropName,
352                                 std::map<int,int>* MapData);
353                 void ProcessSaveDataProc(wxString PropName,
354                                 std::map<int,wxString>* MapData);
355                 void ProcessSaveDataStrProc(wxString PropName,
356                                 std::map<int,int>* MapData);
357                 void ProcessSaveDataStrProc(wxString PropName,
358                                 std::map<int,wxString>* MapData);
359                 void ProcessSaveDataStrProc(wxString PropName,
360                                 std::map<int,std::string>* MapData);
362                 
363                 void ProcessSaveDataB () {  } ;
364                 void ProcessSaveDataC () {  } ;
365                 
366                 template<typename PropName, typename MapData, typename... Args>
367                 void ProcessSaveDataB(PropName propname, MapData* mapdata, Args*... args) {
369                         ProcessSaveDataProc(propname, mapdata);
370                         ProcessSaveDataB(args...);
371                         
372                 }
373                 
374                 template<typename PropName, typename MapData, typename... Args>
375                 void ProcessSaveDataC(PropName propname, MapData* mapdata, Args*... args) {
377                         ProcessSaveDataStrProc(propname, mapdata);
378                         ProcessSaveDataC(args...);
379                         
380                 }
382                 template<typename... Args>
383                 void ProcessSaveData(wxString strPropertyName,
384                         wxString *strPropertyInc, 
385                         bool *boolAdditionalInc, bool *boolExtraInc, 
386                         std::map<int,wxString>::iterator *iterDataInc,
387                         std::map<int,wxString> *MainMapData,
388                         std::map<int,wxString>::iterator *iterFileTypeInc,
389                         std::map<int,wxString>::iterator *iterFileEncInc,                       
390                         vCard *vCardData,
391                         Args*... args) {
393                         //int intSeekSelectedData = 0;
395                         //DeleteMapDataProcess(IndexNum, Moo);
396                         
397                         strPropertyPtr = strPropertyInc;
398                         boolAdditionalPtr = boolAdditionalInc;
399                         boolExtraPtr = boolExtraInc;
400                         iterDataPtr = iterDataInc;
401                         iterFileTypePtr = iterFileTypeInc;
402                         iterFileEncPtr = iterFileEncInc;
403                         ProcessSaveDataB(args...);
404                         
405                         std::map<int,wxString>::iterator strIter;
406                         std::map<int,wxString>::iterator strDataTypeIter;
407                         wxString strMainValue;
408                         
409                         int intSeekData = (*iterDataStringPtr)->first;
410                         strIter = MainMapData->find(intSeekData);
411                         
412                         wxString strFileType = (*iterFileTypePtr)->second;
413                         wxString strFileEnc = (*iterFileEncPtr)->second;
414                         
415                         EscapeString(&strFileType, FALSE);
416                         EscapeString(&strFileEnc, FALSE);
418                         if (strIter->first == intSeekData){
419         
420                                 strMainValue = strIter->second;
421                                 strMainValue.insert(0, wxT("data:") + strFileType + wxT(";") + strFileEnc + wxT(","));
422         
423                         }
424                         
425                         if (*boolExtraPtr == TRUE){
427                                 vCardData->AddRaw(strPropertyName + wxT(";") + *strPropertyPtr, strMainValue);
429                         } else {
431                                 vCardData->AddRaw(strPropertyName, strMainValue);
433                         }
434                         
435                         boolExtraPtr = FALSE;
436                         iterDataPtr = 0;
437         
438                 }
440                 template<typename... Args>
441                 void ProcessSaveData(wxString strPropertyName,
442                         wxString *strPropertyInc, 
443                         bool *boolAdditionalInc, bool *boolExtraInc, 
444                         std::map<int,std::string>::iterator *iterDataInc,
445                         std::map<int,std::string> *MainMapData,
446                         std::map<int,wxString>::iterator *iterFileTypeInc,
447                         std::map<int,wxString>::iterator *iterFileEncInc,                       
448                         vCard *vCardData,
449                         Args*... args) {
451                         //int intSeekSelectedData = 0;
453                         //DeleteMapDataProcess(IndexNum, Moo);
454                         
455                         strPropertyPtr = strPropertyInc;
456                         boolAdditionalPtr = boolAdditionalInc;
457                         boolExtraPtr = boolExtraInc;
458                         iterDataStringPtr = iterDataInc;
459                         iterFileTypePtr = iterFileTypeInc;
460                         iterFileEncPtr = iterFileEncInc;                        
462                         ProcessSaveDataC(args...);
463                         
464                         std::map<int,std::string>::iterator strIter;
465                         wxString strMainValue;
466                         
467                         int intSeekData = (*iterDataStringPtr)->first;
468                         strIter = MainMapData->find(intSeekData);
469                         
470                         wxString strFileType = (*iterFileTypePtr)->second;
471                         wxString strFileEnc = (*iterFileEncPtr)->second;
473                         EscapeString(&strFileType, FALSE);
474                         EscapeString(&strFileEnc, FALSE);
476                         if (strIter->first == intSeekData){
477         
478                                 strMainValue = wxString::FromAscii(strIter->second.c_str());
479                                 strMainValue.insert(0, wxT("data:") + strFileType + wxT(";") + strFileEnc + wxT(","));
480         
481                         }
482                         
483                         if (*boolExtraPtr == TRUE && !strPropertyPtr->IsEmpty()){
485                                 vCardData->AddRaw(strPropertyName + wxT(";") + *strPropertyPtr, strMainValue);
487                         } else {
489                                 vCardData->AddRaw(strPropertyName, strMainValue);
491                         }
492                         
493                         *boolExtraPtr = FALSE;
494                         *boolAdditionalPtr = FALSE;
495                         iterDataStringPtr = 0;
496         
497                 }
498                 
499                 template<typename... Args>
500                 void ProcessSaveData(wxString strPropertyName,
501                         wxString *strPropertyInc, 
502                         bool *boolAdditionalInc, bool *boolExtraInc, 
503                         std::map<int,wxString>::iterator *iterDataInc,
504                         std::map<int,wxString> *MainMapData,
505                         vCard *vCardData,
506                         Args*... args) {
508                         //int intSeekSelectedData = 0;
510                         //DeleteMapDataProcess(IndexNum, Moo);
511                         strPropertyPtr = strPropertyInc;
512                         boolAdditionalPtr = boolAdditionalInc;
513                         boolExtraPtr = boolExtraInc;
514                         iterDataPtr = iterDataInc;
515                         ProcessSaveDataB(args...);
516                         
517                         std::map<int,wxString>::iterator strIter;
518                         wxString strMainValue;
519                         
520                         int intSeekData = (*iterDataPtr)->first;
521                         strIter = MainMapData->find(intSeekData);
522         
523                         if (strIter->first == intSeekData){
524         
525                             strMainValue = strIter->second;
526         
527                         }
528                         
529                         EscapeString(&strMainValue, FALSE);
530                         
531                         if (*boolExtraPtr == TRUE && !strPropertyPtr->IsEmpty()){
533                                 vCardData->AddRaw(strPropertyName + wxT(";") + *strPropertyPtr, strMainValue);
535                         } else {
537                                 vCardData->AddRaw(strPropertyName, strMainValue);
539                         }
540                         
541                         *boolExtraPtr = FALSE;
542                         *boolAdditionalPtr = FALSE;
543                         iterDataPtr = 0;
544         
545                 }
546                 
547                 template<typename... Args>
548                 void ProcessSaveData(wxString strPropertyName,
549                         wxString *strPropertyInc, 
550                         bool *boolAdditionalInc, bool *boolExtraInc, 
551                         std::map<int,wxString>::iterator *iterDataInc,
552                         wxString *MainData,
553                         vCard *vCardData,
554                         Args*... args) {
556                         //int intSeekSelectedData = 0;
558                         //DeleteMapDataProcess(IndexNum, Moo);
559                         strPropertyPtr = strPropertyInc;
560                         boolAdditionalPtr = boolAdditionalInc;
561                         boolExtraPtr = boolExtraInc;
562                         iterDataPtr = iterDataInc;
563                         
564                         ProcessSaveDataB(args...);
565                         
566                         std::map<int,wxString>::iterator strIter;
568                         if (*boolExtraPtr == TRUE && !strPropertyPtr->IsEmpty()){
570                                 vCardData->AddRaw(strPropertyName + wxT(";") + *strPropertyPtr, *MainData);
572                         } else {
574                                 vCardData->AddRaw(strPropertyName, *MainData);
576                         }
577                         
578                         *boolExtraPtr = FALSE;
579                         *boolAdditionalPtr = FALSE;
580                         iterDataPtr = 0;
581         
582                 }
584                 void ProcessCaptureStringsB () {} ;
585                 
586                 void ProcessCaptureStringsProc(wxString *strCapture);
587                 
588                 template<typename StringCapture, typename... Args>
589                 void ProcessCaptureStringsB(StringCapture *string, Args*... args) {
591                         ProcessCaptureStringsProc(string);
592                         ProcessCaptureStringsB(args...);
594                 }
595                 
596                 template<typename... Args>
597                 void ProcessCaptureStrings(Args*... args) {
599                         //int intSeekSelectedData = 0;
601                         ProcessCaptureStringsB(args...);
602         
603                 }
604                 
605                 void ResetSaveProcessData();
606                 void ContactFileChanged( wxCommandEvent &event );
607                 void ClearContact();
609                 void LoadKind(ContactKindType *KindType);
610                 void LoadBirthday(wxString *BirthdayData, bool *BirthdayText);
611                 void LoadAnniversary(wxString *AnniversaryData, bool *AnniversaryText);
612                 void LoadGender(wxString *GenderComponent, wxString *GenderIdentity);
613                 void LoadName(wxString *NameTitle, wxString *NameForename,
614                         wxString *NameSurname, wxString *NameOtherNames, 
615                         wxString *NameSuffix);
616                 void LoadMember(std::map<int,wxString> *GroupList);
617                 void LoadAddress(std::map<int, wxString> *GeneralAddressList,
618                         std::map<int, wxString> *GeneralAddressListTown,
619                         std::map<int, wxString> *GeneralAddressListCounty,
620                         std::map<int, wxString> *GeneralAddressListPostCode,
621                         std::map<int, int> *GeneralAddressListPref,
622                         std::map<int, wxString> *HomeAddressList,
623                         std::map<int, wxString> *HomeAddressListTown,
624                         std::map<int, wxString> *HomeAddressListCounty,
625                         std::map<int, wxString> *HomeAddressListPostCode,
626                         std::map<int, int> *HomeAddressListPref,
627                         std::map<int, wxString> *BusinessAddressList,
628                         std::map<int, wxString> *BusinessAddressListTown,
629                         std::map<int, wxString> *BusinessAddressListCounty,
630                         std::map<int, wxString> *BusinessAddressListPostCode,
631                         std::map<int, int> *BusinessAddressListPref, 
632                         int *AddressCount);
633                 
634                 void LoadData(std::map<int, wxString> *GeneralList,
635                         std::map<int, int> *GeneralListPref,
636                         wxListCtrl *GeneralListCtrl,
637                         std::map<int, wxString> *HomeList,
638                         std::map<int, int> *HomeListPref,
639                         wxListCtrl *HomeListCtrl,
640                         std::map<int, wxString> *BusinessList,
641                         std::map<int, int> *BusinessTZPref,
642                         wxListCtrl *BusinessListCtrl,
643                         int *DataCount);
644                 
645                 void LoadData(std::map<int, wxString> *GeneralList,
646                         std::map<int, int> *GeneralListPref,
647                         std::map<int, wxString> *GeneralListType,
648                         wxListCtrl *GeneralListCtrl,
649                         std::map<int, wxString> *HomeList,
650                         std::map<int, int> *HomeListPref,
651                         std::map<int, wxString> *HomeListType,
652                         wxListCtrl *HomeListCtrl,
653                         std::map<int, wxString> *BusinessList,
654                         std::map<int, int> *BusinessListPref,
655                         std::map<int, wxString> *BusinessListType,
656                         wxListCtrl *BusinessListCtrl,
657                         int *DataCount);
658                 
659                 void LoadData(std::map<int,wxString> *ItemList,
660                         std::map<int,int> *ItemListPref,
661                         wxListCtrl *ItemCtrl,
662                         int *DataCount);
664                 void LoadData(std::map<int,wxString> *ItemList,
665                         std::map<int,int> *ItemListPref,
666                         std::map<int,wxString> *ItemListType,
667                         wxListCtrl *ItemCtrl,
668                         int *DataCount);
669         
670                 void LoadData(wxString ItemName,
671                         std::map<int,wxString> *ItemList,
672                         std::map<int,int> *ItemListPref,
673                         std::map<int,wxString> *ItemListType,
674                         std::map<int,wxString> *ItemListDataType,
675                         wxListCtrl *ItemCtrl,
676                         int *DataCount);
677                         
678                 void LoadPictureData(wxString ItemName, 
679                         std::map<int,std::string> *ItemList,
680                         std::map<int,int> *ItemListPref,
681                         std::map<int,wxString> *ItemListType,
682                         wxListCtrl *ItemCtrl,
683                         int *DataCount);
684                         
685                 void LoadVendorData(std::map<int,wxString> *ItemListPEN,
686                         std::map<int,wxString> *ItemListElement,
687                         wxListCtrl *ItemCtrl,
688                         int *DataCount);
690                 void LoadXTokenData(std::map<int,wxString> *ItemListTokens,
691                         wxListCtrl *ItemCtrl,
692                         int *DataCount);
693                         
694                 void LoadData(std::map<int,wxString> *ItemList,
695                         wxComboBox *ItemCtrl);
696                         
697                 void LoadRelatedData(std::map<int,wxString> *ItemList,
698                         std::map<int,int> *ItemListPref,
699                         std::map<int,wxString> *ItemListType,
700                         wxListCtrl *ItemCtrl,
701                         int *DataCount);
702         
703                 int intValueSeek = 1;
704                 bool IsGroup = FALSE;
705         
706                 /* Items on General Tab */
707         
708                 ContactDataObject ContactEditorData;                    
709         
710                 /* Items regarding account and filename */
711                 
712                 wxString wxSContactFilename;
713                 wxString wxSContactAccount;
714                 bool boolContactModified;
715                 bool boolUnsupportedAccount = false;
716                 
717                 int intSeekSelectedData;
718                 
719                 /* Section for saving/loading data */
720                 
721                 wxString *strPropertyPtr;
722                 bool *boolAdditionalPtr;
723                 bool *boolExtraPtr;
724                 std::map<int,wxString>::iterator *iterDataPtr = 0;
725                 std::map<int,std::string>::iterator *iterDataStringPtr = 0;
726                 std::map<int,wxString>::iterator *iterFileTypePtr = 0;
727                 std::map<int,wxString>::iterator *iterFileEncPtr = 0;
728                 
729                 wxString ETag;
730                 wxString ETagOriginal;
731                 
732                 wxString strValue;
733                 wxString strValue2;
734                 wxString strValue3;
736                 bool boolValue = FALSE;
737                 bool boolValue2 = FALSE;
738                 size_t intValue = 0;
739                 int intValue2 = 0;
740                 int intValue3 = 0;
741                 bool BinaryDataProc = FALSE;
742                 bool EditMode = FALSE;
743                 bool StartupEditMode = FALSE;
744                 bool DialogOpen = FALSE;
745                 
746                 /*
747                 std::string base64dec;
748                 sf::Sound AudioPlayback;
749                 sf::SoundBuffer AudioBuffer;
750                 */
751                 
752                 size_t base64declen;
753                 std::string base64dec;
754                 sf::Music AudioPlayback;
755                 AudioStream AudioStreamPlayback;
756                 sf::SoundBuffer AudioBuffer;
757                 
758                 wxBitmap PictureImage;
759                 wxBitmap LogoImage;
760                 
761                 void SplitValues(wxString *PropertyLine,
762                         std::map<int,int> *SplitPoints, 
763                         std::map<int,int> *SplitLength, 
764                         int intSize);
765                 
766                 frmMain *MainPtr;
767                 frmActivityMgr *ActMgrPtr;
768                 wxETagProcessTimer *ETagTmrPtr;
769                 wxContactFileMonitorTimer FMTimer;
770                 
771                 int ContactEditorUID;
772                 
773                 DECLARE_EVENT_TABLE()
774         
775         //// end generated class members
776         
777 };
779 #endif // __frmContactEditor__
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy