1 // frmSearch.h - Search form header.
3 // (c) 2012-2015 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/>
24 Subclass of frmSearchADT, which is generated by wxFormBuilder.
27 #include "../AppXestiaAddrBk.h"
28 #include "../vcard/vcard.h"
29 #include "../widgets/XABContactMenu.h"
30 #include "XABSearchPanel.h"
33 #include <wx/fs_mem.h>
34 #include <wx/tokenzr.h>
37 //// end generated include
39 DECLARE_EVENT_TYPE(SE_ADDSEARCHSETTING, wxID_ANY)
40 DECLARE_EVENT_TYPE(SE_REMOVESEARCHSETTING, wxID_ANY)
41 DECLARE_EVENT_TYPE(SE_RELOADACCOUNTS, wxID_ANY)
42 DECLARE_EVENT_TYPE(SE_ADDRESULT, wxID_ANY)
43 DECLARE_EVENT_TYPE(SE_SBUPDATE, wxID_ANY)
44 DECLARE_EVENT_TYPE(SE_SEARCHFINISHED, wxID_ANY)
45 DECLARE_EVENT_TYPE(SE_UPDATERESULT, wxID_ANY)
46 DECLARE_EVENT_TYPE(SE_DELETERESULT, wxID_ANY)
47 DECLARE_EVENT_TYPE(SE_OPENCONTACT, wxID_ANY)
48 DECLARE_EVENT_TYPE(SE_EDITCONTACT, wxID_ANY)
49 DECLARE_EVENT_TYPE(SE_REVEALCONTACT, wxID_ANY)
52 vCardName ContactName;
53 wxString ContactNickname;
54 wxString ContactAccount;
55 wxString ContactAccountName;
56 wxString ContactFullFilename;
60 /** Implementing frmSearchADT */
61 class frmSearch : public frmSearchADT
64 std::map<int, void*> SearchFrames;
65 std::map<wxString, bool> SearchAccounts;
66 std::map<wxString, wxString> SearchAccountsNames;
67 std::map<wxString, wxString> SearchAccountsPaths;
68 std::map<long, wxString> SearchResultAccount;
69 std::map<long, wxString> SearchResultFilename;
70 std::map<wxString, wxString> SearchModeMemoryFSPtr;
73 bool SearchEnabled = FALSE;
74 bool StopMode = FALSE;
75 bool SearchMode = FALSE;
76 bool CheckDuplicate(wxString Filename,
78 std::map<long,wxString> *SRAcc,
79 std::map<long,wxString> *SRFN);
80 XABContactMenu *ContactMenu = new XABContactMenu(XABCONTACTMENU_SEARCH);
82 // Handlers for frmSearchADT events.
83 void SelectAccounts( wxCommandEvent& event );
84 void SearchContacts( wxCommandEvent& event );
85 void ResetContacts( wxCommandEvent& event );
86 void AddSearchSetting( wxCommandEvent& event );
87 void RemoveSearchSetting( wxCommandEvent& event );
88 void ReloadAccountList( wxCommandEvent& event );
89 void AddResult( wxCommandEvent& event );
90 void SearchBarUpdate( wxCommandEvent& event );
91 void SearchFinished( wxCommandEvent& event );
92 void SearchContactsThread();
93 void DisableAllSearchSettings(bool Enable);
94 void OpenContact( wxCommandEvent& event );
95 void EditContact( wxCommandEvent& event );
96 void RevealContact( wxCommandEvent& event );
97 void CloseWindow( wxCommandEvent& event );
98 void UpdateResult( wxCommandEvent& event );
99 void DeleteResult( wxCommandEvent& event );
100 void CloseWindow( wxCloseEvent& event );
101 void ShowContactMenu( wxMouseEvent& event );
104 frmSearch( wxWindow* parent );
105 void SetUID(int UID);
106 void SetSearchMode(bool SearchModeIn);
107 DECLARE_EVENT_TABLE()
108 //// end generated class members
112 #endif // __frmSearch__