X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor.h;h=1cd897ec4eeee344189ac3eb40d439e7a4194079;hb=65e83a58c7d3e09a83f77eb897df3b73f1bae4f8;hp=7123fc52f42a19c1641e4ea6c0d4c0f5029f3ae9;hpb=616fa8b7c718ffaf13815ba5bad3d7b54f55c6b1;p=xestiaab%2F.git
diff --git a/source/contacteditor/frmContactEditor.h b/source/contacteditor/frmContactEditor.h
index 7123fc5..1cd897e 100644
--- a/source/contacteditor/frmContactEditor.h
+++ b/source/contacteditor/frmContactEditor.h
@@ -1,3 +1,21 @@
+// frmContactEditor.h - frmContactEditor form header.
+//
+// (c) 2012-2016 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see
+
#ifndef __frmContactEditor__
#define __frmContactEditor__
@@ -19,9 +37,11 @@ Subclass of frmContactEditorADT, which is generated by wxFormBuilder.
#include "../common/etag.h"
#include "../common/timers.h"
-#include "../frmActivityMgr.h"
+#include "../actmgr/frmActivityMgr.h"
#include "../frmMain.h"
+#include "cdo/ContactDataObject.h"
+
#define CE_NICKNAME wxT("Nickname")
#define CE_ADDRESS wxT("Address")
#define CE_EMAIL wxT("Email")
@@ -66,63 +86,6 @@ public:
void OnMusicEnd() { }
bool GetPlayingStatus(){ return FilePlaying; }
-
-/*
- void load(const sf::SoundBuffer& buffer)
- {
- // extract the audio samples from the sound buffer to our own container
- m_samples.assign(buffer.getSamples(), buffer.getSamples() + buffer.getSampleCount());
-
- // reset the current playing position
- m_currentSample = 0;
-
- // initialize the base class
- initialize(buffer.getChannelCount(), buffer.getSampleRate());
- }
-
- bool GetPlayingStatus(){ return FilePlaying; }
-
-private:
-
- virtual bool onGetData(Chunk& data)
- {
- // number of samples to stream every time the function is called;
- // in a more robust implementation, it would rather be a fixed
- // amount of time rather than an arbitrary number of samples
- const int samplesToStream = 50000;
-
- // set the pointer to the next audio samples to be played
- data.samples = &m_samples[m_currentSample];
-
- // have we reached the end of the sound?
- if (m_currentSample + samplesToStream <= m_samples.size())
- {
- // end not reached: stream the samples and continue
- data.sampleCount = samplesToStream;
- m_currentSample += samplesToStream;
- FilePlaying = TRUE;
- return true;
- }
- else
- {
- // end of stream reached: stream the remaining samples and stop playback
- data.sampleCount = m_samples.size() - m_currentSample;
- m_currentSample = m_samples.size();
- FilePlaying = FALSE;
- return false;
- }
- }
-
- virtual void onSeek(sf::Time TimeOffset)
- {
- // compute the corresponding sample index according to the sample rate and channel count
- m_currentSample = static_cast(TimeOffset.asSeconds() * getSampleRate() * getChannelCount());
- }
-
- std::vector m_samples;
- std::size_t m_currentSample;
-
- */
bool FilePlaying = TRUE;
};
@@ -293,13 +256,16 @@ class frmContactEditor : public frmContactEditorADT
void ModifyPicture( wxCommandEvent& event );
void DeletePicture( wxCommandEvent& event );
void LoadPicture( wxListEvent& event );
+ void SavePicture( wxCommandEvent& event);
void AddLogo( wxCommandEvent& event );
void ModifyLogo( wxCommandEvent& event );
void DeleteLogo( wxCommandEvent& event );
- void LoadLogo( wxListEvent& event );
+ void LoadLogo( wxListEvent& event );
+ void SaveLogo( wxCommandEvent& event);
void AddSound( wxCommandEvent& event );
void ModifySound( wxCommandEvent& event );
void DeleteSound( wxCommandEvent& event );
+ void SaveSound( wxCommandEvent& event);
void PlaySoundDetach();
void PlaySound( wxCommandEvent& event );
void StopSound( wxCommandEvent& event );
@@ -436,6 +402,7 @@ class frmContactEditor : public frmContactEditorADT
ProcessSaveDataB(args...);
std::map::iterator strIter;
+ std::map::iterator strDataTypeIter;
wxString strMainValue;
int intSeekData = (*iterDataStringPtr)->first;
@@ -637,548 +604,107 @@ class frmContactEditor : public frmContactEditorADT
void ResetSaveProcessData();
void ContactFileChanged( wxCommandEvent &event );
void ClearContact();
-
- /* Functions for loading contacts */
- void LoadKind(wxString KindType);
- void LoadMember(wxString MemberData, int *GroupCount);
- void LoadFN(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *FNCount,
- bool *FNProcessed, vCard *ContactData);
- void LoadN(wxString wxSPropertySeg1, wxString wxSPropertySeg2, bool *NameProcessed,
- vCard *ContactData);
- void LoadNickname(wxString wxSpropertySeg1, wxString wxSPropertySeg2,
- int *NicknameCount, vCard *ContactData);
- void LoadGender(wxString wxSPropertySeg1, wxString wxSPropertySeg2, bool *GenderProcessed,
- vCard *ContactData);
- void LoadBDay(wxString wxSPropertySeg1, wxString wxSPropertySeg2, bool *BirthdayProcessed);
- void LoadAnniversary(wxString wxSPropertySeg1, wxString wxSPropertySeg2, bool *AnniversaryProcessed);
- void LoadTimeZone(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *TZCount);
- void LoadADR(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *ADRCount);
- void LoadEmail(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *ADRCount);
- void LoadIM(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *IMPPCount);
- void LoadTelephone(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *TelCount);
- void LoadLanguage(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *LangCount);
- void LoadGeo(wxString wxSProptertySeg1, wxString wxSPropertySeg2, int *GeoCount);
- void LoadRelated(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *RelatedCount);
- void LoadURL(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *URLCount);
- void LoadTitle(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *TitleCount);
- void LoadRole(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *RoleCount);
- void LoadOrg(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *OrgCount);
- void LoadNote(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *NoteCount);
- void LoadCategory(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *CategoryCount);
- void LoadPhoto(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *PhotoCount);
- void LoadLogo(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *PhotoCount);
- void LoadSound(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *SoundCount);
- void LoadCalURI(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *CalAdrCount);
- void LoadCalAdrURI(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *CalReqAdrCount);
- void LoadCalFreeBusy(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *FreeBusyCount);
- void LoadKey(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *KeyCount);
+
+ void LoadKind(ContactKindType *KindType);
+ void LoadBirthday(wxString *BirthdayData, bool *BirthdayText);
+ void LoadAnniversary(wxString *AnniversaryData, bool *AnniversaryText);
+ void LoadGender(wxString *GenderComponent, wxString *GenderIdentity);
+ void LoadName(wxString *NameTitle, wxString *NameForename,
+ wxString *NameSurname, wxString *NameOtherNames,
+ wxString *NameSuffix);
+ void LoadMember(std::map *GroupList);
+ void LoadAddress(std::map *GeneralAddressList,
+ std::map *GeneralAddressListTown,
+ std::map *GeneralAddressListCounty,
+ std::map *GeneralAddressListPostCode,
+ std::map *GeneralAddressListPref,
+ std::map *HomeAddressList,
+ std::map *HomeAddressListTown,
+ std::map *HomeAddressListCounty,
+ std::map *HomeAddressListPostCode,
+ std::map *HomeAddressListPref,
+ std::map *BusinessAddressList,
+ std::map *BusinessAddressListTown,
+ std::map *BusinessAddressListCounty,
+ std::map *BusinessAddressListPostCode,
+ std::map *BusinessAddressListPref,
+ int *AddressCount);
+
+ void LoadData(std::map *GeneralList,
+ std::map *GeneralListPref,
+ wxListCtrl *GeneralListCtrl,
+ std::map *HomeList,
+ std::map *HomeListPref,
+ wxListCtrl *HomeListCtrl,
+ std::map *BusinessList,
+ std::map *BusinessTZPref,
+ wxListCtrl *BusinessListCtrl,
+ int *DataCount);
+
+ void LoadData(std::map *GeneralList,
+ std::map *GeneralListPref,
+ std::map *GeneralListType,
+ wxListCtrl *GeneralListCtrl,
+ std::map *HomeList,
+ std::map *HomeListPref,
+ std::map *HomeListType,
+ wxListCtrl *HomeListCtrl,
+ std::map *BusinessList,
+ std::map *BusinessListPref,
+ std::map *BusinessListType,
+ wxListCtrl *BusinessListCtrl,
+ int *DataCount);
+
+ void LoadData(std::map *ItemList,
+ std::map *ItemListPref,
+ wxListCtrl *ItemCtrl,
+ int *DataCount);
+
+ void LoadData(std::map *ItemList,
+ std::map *ItemListPref,
+ std::map *ItemListType,
+ wxListCtrl *ItemCtrl,
+ int *DataCount);
+
+ void LoadData(wxString ItemName,
+ std::map *ItemList,
+ std::map *ItemListPref,
+ std::map *ItemListType,
+ std::map *ItemListDataType,
+ wxListCtrl *ItemCtrl,
+ int *DataCount);
+
+ void LoadPictureData(wxString ItemName,
+ std::map *ItemList,
+ std::map *ItemListPref,
+ std::map *ItemListType,
+ wxListCtrl *ItemCtrl,
+ int *DataCount);
+
+ void LoadVendorData(std::map *ItemListPEN,
+ std::map *ItemListElement,
+ wxListCtrl *ItemCtrl,
+ int *DataCount);
+
+ void LoadXTokenData(std::map *ItemListTokens,
+ wxListCtrl *ItemCtrl,
+ int *DataCount);
+
+ void LoadData(std::map *ItemList,
+ wxComboBox *ItemCtrl);
+
+ void LoadRelatedData(std::map *ItemList,
+ std::map *ItemListPref,
+ std::map *ItemListType,
+ wxListCtrl *ItemCtrl,
+ int *DataCount);
int intValueSeek = 1;
bool IsGroup = FALSE;
/* Items on General Tab */
- wxString NameTitle;
- wxString NameForename;
- wxString NameSurname;
- wxString NameOtherNames;
- wxString NameSuffix;
- wxString NameNickname;
- wxString NameDisplayAs;
- wxString NameLanguage;
- wxString NameAltID;
- wxString NameTokens;
-
- wxString Birthday;
- wxString BirthdayAltID;
- wxString BirthdayCalScale;
- wxString BirthdayTokens;
- wxString Anniversary;
- wxString AnniversaryAltID;
- wxString AnniversaryCalScale;
- wxString AnniversaryTokens;
-
- wxString Gender;
- wxString GenderDetails;
- wxString GenderTokens;
-
- wxString UIDToken;
-
- /* We don't use these at the moment but we want to keep
- them for compatability reasons */
-
- /*std::map ExtraFullNames;*/
- /*std::map ExtraNicknames;*/
-
- std::map FullNamesList;
- std::map FullNamesListType;
- std::map FullNamesListLanguage;
- std::map FullNamesListAltID;
- std::map FullNamesListPID;
- std::map FullNamesListTokens;
- std::map FullNamesListPref;
-
- std::map GeneralNicknamesList;
- std::map GeneralNicknamesListType;
- std::map GeneralNicknamesListLanguage;
- std::map GeneralNicknamesListAltID;
- std::map GeneralNicknamesListPID;
- std::map GeneralNicknamesListTokens;
- std::map GeneralNicknamesListPref;
-
- std::map GeneralAddressList;
- std::map GeneralAddressListTown;
- std::map GeneralAddressListCounty;
- std::map GeneralAddressListPostCode;
- std::map GeneralAddressListCountry;
- std::map GeneralAddressListLabel;
- std::map GeneralAddressListLang;
- std::map GeneralAddressListAltID;
- std::map GeneralAddressListPID;
- std::map GeneralAddressListTokens;
- std::map GeneralAddressListGeo;
- std::map GeneralAddressListTimezone;
- std::map GeneralAddressListType;
- std::map GeneralAddressListMediatype;
- std::map GeneralAddressListPref;
-
- std::map GeneralEmailList;
- std::map GeneralEmailListAltID;
- std::map GeneralEmailListPID;
- std::map GeneralEmailListType;
- std::map GeneralEmailListTokens;
- std::map GeneralEmailListPref;
-
- std::map GeneralIMList;
- std::map GeneralIMListAltID;
- std::map GeneralIMListPID;
- std::map GeneralIMListType;
- std::map GeneralIMListTokens;
- std::map GeneralIMListMediatype;
- std::map GeneralIMListPref;
-
- std::map GeneralTelephoneList;
- std::map GeneralTelephoneListAltID;
- std::map GeneralTelephoneListPID;
- std::map GeneralTelephoneListType;
- std::map GeneralTelephoneListTokens;
- std::map GeneralTelephoneListPref;
-
- std::map GeneralLanguageList;
- std::map GeneralLanguageListAltID;
- std::map GeneralLanguageListPID;
- std::map GeneralLanguageListType;
- std::map GeneralLanguageListTokens;
- std::map GeneralLanguageListPref;
-
- std::map GeneralTZList;
- std::map GeneralTZListAltID;
- std::map GeneralTZListPID;
- std::map GeneralTZListType;
- std::map GeneralTZListTokens;
- std::map GeneralTZListMediatype;
- std::map GeneralTZListPref;
-
- std::map GeneralGeographyList;
- std::map GeneralGeographyListAltID;
- std::map GeneralGeographyListPID;
- std::map GeneralGeographyListType;
- std::map GeneralGeographyListTokens;
- std::map GeneralGeographyListMediatype;
- std::map GeneralGeographyListPref;
-
- std::map GeneralRelatedList;
- std::map GeneralRelatedListRelType;
- std::map GeneralRelatedListLanguage;
- std::map GeneralRelatedListAltID;
- std::map GeneralRelatedListPID;
- std::map GeneralRelatedListType;
- std::map GeneralRelatedListTokens;
- std::map GeneralRelatedListPref;
-
- std::map GeneralWebsiteList;
- std::map GeneralWebsiteListAltID;
- std::map GeneralWebsiteListPID;
- std::map GeneralWebsiteListType;
- std::map GeneralWebsiteListTokens;
- std::map GeneralWebsiteListMediatype;
- std::map GeneralWebsiteListPref;
-
- std::map GeneralTitleList;
- std::map GeneralTitleListLanguage;
- std::map GeneralTitleListAltID;
- std::map GeneralTitleListPID;
- std::map GeneralTitleListType;
- std::map GeneralTitleListTokens;
- std::map GeneralTitleListPref;
-
- std::map GeneralRoleList;
- std::map GeneralRoleListLanguage;
- std::map GeneralRoleListAltID;
- std::map GeneralRoleListPID;
- std::map GeneralRoleListType;
- std::map GeneralRoleListTokens;
- std::map GeneralRoleListPref;
-
- std::map GeneralOrganisationsList;
- std::map GeneralOrganisationsListLanguage;
- std::map GeneralOrganisationsListAltID;
- std::map GeneralOrganisationsListPID;
- std::map GeneralOrganisationsListType;
- std::map GeneralOrganisationsListTokens;
- std::map GeneralOrganisationsListSortAs;
- std::map GeneralOrganisationsListPref;
-
- std::map GeneralNoteList;
- std::map GeneralNoteListLanguage;
- std::map GeneralNoteListAltID;
- std::map GeneralNoteListPID;
- std::map GeneralNoteListType;
- std::map GeneralNoteListTokens;
- std::map GeneralNoteListPref;
-
- /* Items on Home Tab */
-
- std::map HomeNicknamesList;
- std::map HomeNicknamesListType;
- std::map HomeNicknamesListLanguage;
- std::map HomeNicknamesListAltID;
- std::map HomeNicknamesListPID;
- std::map HomeNicknamesListTokens;
- std::map HomeNicknamesListPref;
-
- std::map HomeAddressList;
- std::map HomeAddressListTown;
- std::map HomeAddressListCounty;
- std::map HomeAddressListPostCode;
- std::map HomeAddressListCountry;
- std::map HomeAddressListLabel;
- std::map HomeAddressListLang;
- std::map HomeAddressListAltID;
- std::map HomeAddressListPID;
- std::map HomeAddressListTokens;
- std::map HomeAddressListGeo;
- std::map HomeAddressListTimezone;
- std::map HomeAddressListType;
- std::map HomeAddressListMediatype;
- std::map HomeAddressListPref;
-
- std::map HomeEmailList;
- std::map HomeEmailListAltID;
- std::map HomeEmailListPID;
- std::map HomeEmailListType;
- std::map HomeEmailListTokens;
- std::map HomeEmailListPref;
-
- std::map HomeIMList;
- std::map HomeIMListAltID;
- std::map HomeIMListPID;
- std::map HomeIMListType;
- std::map HomeIMListTokens;
- std::map HomeIMListMediatype;
- std::map HomeIMListPref;
-
- std::map HomeTelephoneList;
- std::map HomeTelephoneListAltID;
- std::map HomeTelephoneListPID;
- std::map HomeTelephoneListType;
- std::map HomeTelephoneListTokens;
- std::map HomeTelephoneListPref;
-
- std::map HomeLanguageList;
- std::map HomeLanguageListAltID;
- std::map HomeLanguageListPID;
- std::map HomeLanguageListType;
- std::map HomeLanguageListTokens;
- std::map HomeLanguageListPref;
-
- std::map HomeTZList;
- std::map HomeTZListAltID;
- std::map HomeTZListPID;
- std::map HomeTZListType;
- std::map HomeTZListTokens;
- std::map HomeTZListMediatype;
- std::map HomeTZListPref;
-
- std::map HomeGeographyList;
- std::map HomeGeographyListAltID;
- std::map HomeGeographyListPID;
- std::map HomeGeographyListType;
- std::map HomeGeographyListTokens;
- std::map HomeGeographyListMediatype;
- std::map HomeGeographyListPref;
-
- std::map HomeRelatedList;
- std::map HomeRelatedListRelType;
- std::map HomeRelatedListLanguage;
- std::map HomeRelatedListAltID;
- std::map HomeRelatedListPID;
- std::map HomeRelatedListType;
- std::map HomeRelatedListTokens;
- std::map HomeRelatedListPref;
-
- std::map HomeWebsiteList;
- std::map HomeWebsiteListAltID;
- std::map HomeWebsiteListPID;
- std::map HomeWebsiteListType;
- std::map HomeWebsiteListTokens;
- std::map HomeWebsiteListMediatype;
- std::map HomeWebsiteListPref;
-
- std::map HomeTitleList;
- std::map HomeTitleListLanguage;
- std::map HomeTitleListAltID;
- std::map HomeTitleListPID;
- std::map HomeTitleListType;
- std::map HomeTitleListTokens;
- std::map HomeTitleListPref;
-
- std::map HomeRoleList;
- std::map HomeRoleListLanguage;
- std::map HomeRoleListAltID;
- std::map