Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
macOS: Added languages.cpp/.h to Xcode project.
[xestiaab/.git] / source / search / frmSearch.h
1 // frmSearch.h - Search form header.
2 //
3 // (c) 2012-2017 Xestia Software Development.
4 //
5 // This file is part of Xestia Address Book.
6 //
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.
10 //
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.
15 //
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/>
19 #ifndef __frmSearch__
20 #define __frmSearch__
22 /**
23 @file
24 Subclass of frmSearchADT, which is generated by wxFormBuilder.
25 */
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"
40 #include <thread>
41 #include <map>
42 #include <wx/fs_mem.h>
43 #include <wx/tokenzr.h>
44 #include <wx/dir.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)
60 struct SRNotif{
61         vCardName ContactName;
62         wxString ContactNickname;
63         wxString ContactAccount;
64         wxString ContactAccountName;
65         wxString ContactFullFilename;
66         long SearchResultID;
67 };
69 /** Implementing frmSearchADT */
70 class frmSearch : public frmSearchADT
71 {
72         private:
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;
80                 int ScrollGen = 0;
81                 int SearchUID = 0;
82                 bool SearchEnabled = FALSE;
83                 bool StopMode = FALSE;
84                 bool SearchMode = FALSE;
85                 bool CheckDuplicate(wxString Filename, 
86                         wxString Account,
87                         std::map<long,wxString> *SRAcc,
88                         std::map<long,wxString> *SRFN);
89                 XABContactMenu *ContactMenu = new XABContactMenu(XABCONTACTMENU_SEARCH);
90         protected:
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 );
111         public:
112                 /** Constructor */
113                 frmSearch( wxWindow* parent );
114                 void SetUID(int UID);
115                 void SetSearchMode(bool SearchModeIn);
116                 DECLARE_EVENT_TABLE()
117         //// end generated class members
118         
119 };
121 #endif // __frmSearch__
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