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