-
Notifications
You must be signed in to change notification settings - Fork 3
/
ImageSearch.h
57 lines (46 loc) · 1.36 KB
/
ImageSearch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef IMAGE_SEARCH_APPLICATION_H
#define IMAGE_SEARCH_APPLICATION_H
#include <Wt/WApplication>
#include <string>
#include <vector>
#include <memory>
namespace Wt
{
class WFileUpload;
class WPushButton;
class WImage;
class WText;
class WResource;
};
namespace ImageSearch
{
class ImageSearchBackend;
class SearchResult;
class ImageSearchApplication : public Wt::WApplication
{
public:
ImageSearchApplication (const Wt::WEnvironment& env);
virtual ~ImageSearchApplication (void);
private:
Wt::WFileUpload *m_fileUpload;
Wt::WPushButton *m_searchButton;
Wt::WImage *m_currentSelection;
Wt::WText *m_resultText;
ImageSearchBackend *m_backend;
std::vector<SearchResult*> m_searchResults;
std::auto_ptr<Wt::WResource> m_currentSearchResource;
void p_uploadFile (void);
void p_afterSearch (const std::string &fileName);
void p_searchByUpload (void);
void p_searchByImageId (const unsigned long imageId);
void p_fileTooLarge (void);
void p_enableSearchButton (void);
void p_showCurrentSearch (const std::string &fileName);
void p_hideCurrentSearch (void);
void p_setupTopSection (void);
void p_setupInputs (void);
void p_setupSearchResults (void);
void p_updateSearchResults (void);
};
};
#endif // IMAGE_SEARCH_APPLICATION_H