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"
33 //// end generated include
35 DECLARE_EVENT_TYPE(SE_ADDSEARCHSETTING, wxID_ANY)
36 DECLARE_EVENT_TYPE(SE_REMOVESEARCHSETTING, wxID_ANY)
37 DECLARE_EVENT_TYPE(SE_RELOADACCOUNTS, wxID_ANY)
38 DECLARE_EVENT_TYPE(SE_ADDRESULT, wxID_ANY)
39 DECLARE_EVENT_TYPE(SE_SBUPDATE, wxID_ANY)
40 DECLARE_EVENT_TYPE(SE_SEARCHFINISHED, wxID_ANY)
41 DECLARE_EVENT_TYPE(SE_UPDATERESULT, wxID_ANY)
42 DECLARE_EVENT_TYPE(SE_DELETERESULT, wxID_ANY)
43 DECLARE_EVENT_TYPE(SE_OPENCONTACT, wxID_ANY)
44 DECLARE_EVENT_TYPE(SE_EDITCONTACT, wxID_ANY)
45 DECLARE_EVENT_TYPE(SE_REVEALCONTACT, wxID_ANY)
48 vCardName ContactName;
49 wxString ContactNickname;
50 wxString ContactAccount;
51 wxString ContactAccountName;
52 wxString ContactFullFilename;
56 /** Implementing frmSearchADT */
57 class frmSearch : public frmSearchADT
60 std::map<int, void*> SearchFrames;
61 std::map<wxString, bool> SearchAccounts;
62 std::map<wxString, wxString> SearchAccountsNames;
63 std::map<wxString, wxString> SearchAccountsPaths;
64 std::map<long, wxString> SearchResultAccount;
65 std::map<long, wxString> SearchResultFilename;
66 std::map<wxString, wxString> SearchModeMemoryFSPtr;
69 bool SearchEnabled = FALSE;
70 bool StopMode = FALSE;
71 bool SearchMode = FALSE;
72 bool CheckDuplicate(wxString Filename,
74 std::map<long,wxString> *SRAcc,
75 std::map<long,wxString> *SRFN);
76 XABContactMenu *ContactMenu = new XABContactMenu(XABCONTACTMENU_SEARCH);
78 // Handlers for frmSearchADT events.
79 void SelectAccounts( wxCommandEvent& event );
80 void SearchContacts( wxCommandEvent& event );
81 void ResetContacts( wxCommandEvent& event );
82 void AddSearchSetting( wxCommandEvent& event );
83 void RemoveSearchSetting( wxCommandEvent& event );
84 void ReloadAccountList( wxCommandEvent& event );
85 void AddResult( wxCommandEvent& event );
86 void SearchBarUpdate( wxCommandEvent& event );
87 void SearchFinished( wxCommandEvent& event );
88 void SearchContactsThread();
89 void DisableAllSearchSettings(bool Enable);
90 void OpenContact( wxCommandEvent& event );
91 void EditContact( wxCommandEvent& event );
92 void RevealContact( wxCommandEvent& event );
93 void CloseWindow( wxCommandEvent& event );
94 void UpdateResult( wxCommandEvent& event );
95 void DeleteResult( wxCommandEvent& event );
96 void CloseWindow( wxCloseEvent& event );
97 void ShowContactMenu( wxMouseEvent& event );
100 frmSearch( wxWindow* parent );
101 void SetUID(int UID);
102 void SetSearchMode(bool SearchModeIn);
103 DECLARE_EVENT_TABLE()
104 //// end generated class members
108 #endif // __frmSearch__