1 /*
2  * Part of WCM Commander
3  * https://github.com/corporateshark/WCMCommander
4  * wcm@linderdaum.com
5  */
6 
7 #pragma once
8 
9 #include <wal.h>
10 
11 using namespace wal;
12 
13 
14 #define EDIT_FIELD_SEARCH_TEXT			"search-text"
15 #define EDIT_FIELD_SEARCH_REPLACE_TEXT	"search-replace-text"
16 
17 #define EDIT_FIELD_APPLY_COMMAND			"apply-command"
18 #define EDIT_FIELD_MAKE_FOLDER			"make-folder"
19 #define EDIT_FIELD_FILE_MASK				"file-mask"
20 #define EDIT_FIELD_FILE_EDIT				"file-edit"
21 #define EDIT_FIELD_FILE_TARGET			"file-target"
22 
23 #define EDIT_FIELD_FTP_SERVER				"ftp-server"
24 #define EDIT_FIELD_FTP_USER				"ftp-user"
25 #define EDIT_FIELD_SFTP_SERVER			"sftp-server"
26 #define EDIT_FIELD_SFTP_USER				"sftp-user"
27 #define EDIT_FIELD_SMB_SERVER				"smb-server"
28 #define EDIT_FIELD_SMB_DOMAIN				"smb-domain"
29 #define EDIT_FIELD_SMB_USER				"smb-user"
30 
31 
32 typedef std::vector<std::vector<unicode_t>> HistCollect_t;
33 
34 void LoadFieldsHistory();
35 
36 void SaveFieldsHistory();
37 
38 HistCollect_t* GetFieldHistCollect( const char* FieldName );
39 
40 void AddFieldTextToHistory( const char* FieldName, const unicode_t* Txt );
41 
42 
43 class NCHistory
44 {
45 public:
NCHistory()46 	NCHistory(): m_List(), m_Current( -1 ) {}
~NCHistory()47 	~NCHistory() {}
48 
49 	void Clear();
50 	void Put( const unicode_t* str );
51 	void DeleteAll( const unicode_t* Str );
52 
53 	size_t Count() const;
54 	const unicode_t* operator[] ( size_t n );
55 
56 	const unicode_t* Prev();
57 	const unicode_t* Next();
58 
ResetToLast()59 	void ResetToLast() { m_Current = -1; }
60 
61 private:
62 	HistCollect_t m_List;
63 	int m_Current;
64 };
65