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"
33 #include "../frmMain.h"
34 #include "../frmContact.h"
35 #include "frmSearchAccounts.h"
36 #include "../common/preferences.h"
37 #include "../common/dirs.h"
38 #include "../vcard/vcard.h"
42 #include <wx/fs_mem.h>
43 #include <wx/tokenzr.h>
46 //// end generated include
48 DECLARE_EVENT_TYPE(SE_ADDSEARCHSETTING, wxID_ANY)
49 DECLARE_EVENT_TYPE(SE_REMOVESEARCHSETTING, wxID_ANY)
50 DECLARE_EVENT_TYPE(SE_RELOADACCOUNTS, wxID_ANY)
51 DECLARE_EVENT_TYPE(SE_ADDRESULT, wxID_ANY)
52 DECLARE_EVENT_TYPE(SE_SBUPDATE, wxID_ANY)
53 DECLARE_EVENT_TYPE(SE_SEARCHFINISHED, wxID_ANY)
54 DECLARE_EVENT_TYPE(SE_UPDATERESULT, wxID_ANY)
55 DECLARE_EVENT_TYPE(SE_DELETERESULT, wxID_ANY)
56 DECLARE_EVENT_TYPE(SE_OPENCONTACT, wxID_ANY)
57 DECLARE_EVENT_TYPE(SE_EDITCONTACT, wxID_ANY)
58 DECLARE_EVENT_TYPE(SE_REVEALCONTACT, wxID_ANY)
61 vCardName ContactName;
62 wxString ContactNickname;
63 wxString ContactAccount;
64 wxString ContactAccountName;
65 wxString ContactFullFilename;
69 /** Implementing frmSearchADT */
70 class frmSearch : public frmSearchADT
73 std::map<int, void*> SearchFrames;
74 std::map<wxString, bool> SearchAccounts;
75 std::map<wxString, wxString> SearchAccountsNames;
76 std::map<wxString, wxString> SearchAccountsPaths;
77 std::map<long, wxString> SearchResultAccount;
78 std::map<long, wxString> SearchResultFilename;
79 std::map<wxString, wxString> SearchModeMemoryFSPtr;
82 bool SearchEnabled = FALSE;
83 bool StopMode = FALSE;
84 bool SearchMode = FALSE;
85 bool CheckDuplicate(wxString Filename,
87 std::map<long,wxString> *SRAcc,
88 std::map<long,wxString> *SRFN);
89 XABContactMenu *ContactMenu = new XABContactMenu(XABCONTACTMENU_SEARCH);
91 // Handlers for frmSearchADT events.
92 void SelectAccounts( wxCommandEvent& event );
93 void SearchContacts( wxCommandEvent& event );
94 void ResetContacts( wxCommandEvent& event );
95 void AddSearchSetting( wxCommandEvent& event );
96 void RemoveSearchSetting( wxCommandEvent& event );
97 void ReloadAccountList( wxCommandEvent& event );
98 void AddResult( wxCommandEvent& event );
99 void SearchBarUpdate( wxCommandEvent& event );
100 void SearchFinished( wxCommandEvent& event );
101 void SearchContactsThread();
102 void DisableAllSearchSettings(bool Enable);
103 void OpenContact( wxCommandEvent& event );
104 void EditContact( wxCommandEvent& event );
105 void RevealContact( wxCommandEvent& event );
106 void CloseWindow( wxCommandEvent& event );
107 void UpdateResult( wxCommandEvent& event );
108 void DeleteResult( wxCommandEvent& event );
109 void CloseWindow( wxCloseEvent& event );
110 void ShowContactMenu( wxMouseEvent& event );
113 frmSearch( wxWindow* parent );
114 void SetUID(int UID);
115 void SetSearchMode(bool SearchModeIn);
116 DECLARE_EVENT_TABLE()
117 //// end generated class members
121 #endif // __frmSearch__