Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Implemented all remaining elements to use ContactDataObject.
[xestiaab/.git] / source / contacteditor / frmContactEditor.h
index f4dccc0..c1f7547 100644 (file)
@@ -1,3 +1,21 @@
+// frmContactEditor.h - frmContactEditor form header.
+//
+// (c) 2012-2015 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 <http://www.gnu.org/licenses/>
+
 #ifndef __frmContactEditor__
 #define __frmContactEditor__
 
@@ -19,9 +37,33 @@ 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")
+#define CE_IM wxT("IM")
+#define CE_TELEPHONE wxT("Telephone")
+#define CE_LANG wxT("Languages")
+#define CE_TZ wxT("Timezone")
+#define CE_RELATED wxT("Related")
+#define CE_WEBSITE wxT("Websites")
+#define CE_TITLE wxT("Titles")
+#define CE_GEOPOSITION wxT("Geoposition")
+#define CE_ROLE wxT("Roles")
+#define CE_ORG wxT("Organisations")
+#define CE_NOTE wxT("Notes")
+#define CE_CATEGORIES wxT("Categories")
+#define CE_GROUPS wxT("Groups")
+#define CE_PICTURES wxT("Pictures")
+#define CE_SOUNDS wxT("Sounds")
+#define CE_CALENDAR wxT("Calendar")
+#define CE_KEY wxT("Key")
+#define CE_TOKEN wxT("Token")
+
 //// end generated include
 
 struct frmMain;
@@ -44,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<std::size_t>(TimeOffset.asSeconds() * getSampleRate() * getChannelCount());
-    }
-
-    std::vector<sf::Int16> m_samples;
-    std::size_t m_currentSample;
-    
-    */
     bool FilePlaying = TRUE;
 };
 
@@ -271,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 );
@@ -328,6 +316,7 @@ class frmContactEditor : public frmContactEditorADT
                void SetupPointers(frmActivityMgr *ActMgr, wxETagProcessTimer *ETagProc,
                                        frmMain *MainPtrInc);
                bool LoadContact(wxString Filename);
+               void SetMode(bool StartupEditMode);
                void SetUID(int UID);
        private:
        
@@ -614,12 +603,108 @@ class frmContactEditor : public frmContactEditorADT
                void ResetSaveProcessData();
                void ContactFileChanged( wxCommandEvent &event );
                void ClearContact();
+
+               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<int,wxString> *GroupList);
+               void LoadAddress(std::map<int, wxString> *GeneralAddressList,
+                       std::map<int, wxString> *GeneralAddressListTown,
+                       std::map<int, wxString> *GeneralAddressListCounty,
+                       std::map<int, wxString> *GeneralAddressListPostCode,
+                       std::map<int, int> *GeneralAddressListPref,
+                       std::map<int, wxString> *HomeAddressList,
+                       std::map<int, wxString> *HomeAddressListTown,
+                       std::map<int, wxString> *HomeAddressListCounty,
+                       std::map<int, wxString> *HomeAddressListPostCode,
+                       std::map<int, int> *HomeAddressListPref,
+                       std::map<int, wxString> *BusinessAddressList,
+                       std::map<int, wxString> *BusinessAddressListTown,
+                       std::map<int, wxString> *BusinessAddressListCounty,
+                       std::map<int, wxString> *BusinessAddressListPostCode,
+                       std::map<int, int> *BusinessAddressListPref, 
+                       int *AddressCount);
+               
+               void LoadData(std::map<int, wxString> *GeneralList,
+                       std::map<int, int> *GeneralListPref,
+                       wxListCtrl *GeneralListCtrl,
+                       std::map<int, wxString> *HomeList,
+                       std::map<int, int> *HomeListPref,
+                       wxListCtrl *HomeListCtrl,
+                       std::map<int, wxString> *BusinessList,
+                       std::map<int, int> *BusinessTZPref,
+                       wxListCtrl *BusinessListCtrl,
+                       int *DataCount);
+               
+               void LoadData(std::map<int, wxString> *GeneralList,
+                       std::map<int, int> *GeneralListPref,
+                       std::map<int, wxString> *GeneralListType,
+                       wxListCtrl *GeneralListCtrl,
+                       std::map<int, wxString> *HomeList,
+                       std::map<int, int> *HomeListPref,
+                       std::map<int, wxString> *HomeListType,
+                       wxListCtrl *HomeListCtrl,
+                       std::map<int, wxString> *BusinessList,
+                       std::map<int, int> *BusinessListPref,
+                       std::map<int, wxString> *BusinessListType,
+                       wxListCtrl *BusinessListCtrl,
+                       int *DataCount);
+               
+               void LoadData(std::map<int,wxString> *ItemList,
+                       std::map<int,int> *ItemListPref,
+                       wxListCtrl *ItemCtrl,
+                       int *DataCount);
+
+               void LoadData(std::map<int,wxString> *ItemList,
+                       std::map<int,int> *ItemListPref,
+                       std::map<int,wxString> *ItemListType,
+                       wxListCtrl *ItemCtrl,
+                       int *DataCount);
+       
+               void LoadData(wxString ItemName,
+                       std::map<int,wxString> *ItemList,
+                       std::map<int,int> *ItemListPref,
+                       std::map<int,wxString> *ItemListType,
+                       std::map<int,wxString> *ItemListDataType,
+                       wxListCtrl *ItemCtrl,
+                       int *DataCount);
+                       
+               void LoadPictureData(wxString ItemName, 
+                       std::map<int,std::string> *ItemList,
+                       std::map<int,int> *ItemListPref,
+                       std::map<int,wxString> *ItemListType,
+                       wxListCtrl *ItemCtrl,
+                       int *DataCount);
+                       
+               void LoadVendorData(std::map<int,wxString> *ItemListPEN,
+                       std::map<int,wxString> *ItemListElement,
+                       wxListCtrl *ItemCtrl,
+                       int *DataCount);
+
+               void LoadXTokenData(std::map<int,wxString> *ItemListTokens,
+                       wxListCtrl *ItemCtrl,
+                       int *DataCount);
+                       
+               void LoadData(std::map<int,wxString> *ItemList,
+                       wxComboBox *ItemCtrl);
+                       
+               void LoadRelatedData(std::map<int,wxString> *ItemList,
+                       std::map<int,int> *ItemListPref,
+                       std::map<int,wxString> *ItemListType,
+                       wxListCtrl *ItemCtrl,
+                       int *DataCount);
        
                int intValueSeek = 1;
                bool IsGroup = FALSE;
        
                /* Items on General Tab */
        
+               ContactDataObject ContactEditorData;
+       
                wxString NameTitle;
                wxString NameForename;
                wxString NameSurname;
@@ -1153,6 +1238,7 @@ class frmContactEditor : public frmContactEditorADT
                int intValue3 = 0;
                bool BinaryDataProc = FALSE;
                bool EditMode = FALSE;
+               bool StartupEditMode = FALSE;
                bool DialogOpen = FALSE;
                
                /*
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