]>
Commit | Line | Data |
---|---|---|
de6a1a64 RC |
1 | /* |
2 | * Copyright (c) 2001, Robert Collins. | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * A copy of the GNU General Public License can be found at | |
10 | * http://www.gnu.org/ | |
11 | * | |
12 | * Written by Robert Collins <rbtcollins@hotmail.com> | |
13 | * | |
14 | */ | |
15 | ||
c93bc6d0 MB |
16 | #ifndef SETUP_SITE_H |
17 | #define SETUP_SITE_H | |
de6a1a64 | 18 | |
d60832c6 | 19 | #include <string> |
3bac26a1 | 20 | #include <vector> |
de6a1a64 | 21 | |
ab57ceaa RC |
22 | #include "proppage.h" |
23 | ||
d60832c6 | 24 | class SitePage : public PropertyPage |
ab57ceaa RC |
25 | { |
26 | public: | |
a8d753b6 | 27 | SitePage (); |
ab57ceaa RC |
28 | virtual ~ SitePage () |
29 | { | |
30 | }; | |
31 | ||
32 | bool Create (); | |
33 | ||
b7301c43 | 34 | virtual void OnActivate (); |
ab57ceaa RC |
35 | virtual long OnNext (); |
36 | virtual long OnBack (); | |
f2ff9838 | 37 | virtual long OnUnattended (); |
b7301c43 RC |
38 | |
39 | virtual bool OnMessageCmd (int id, HWND hwndctl, UINT code); | |
40 | ||
41 | void PopulateListBox(); | |
42 | void CheckControlsAndDisableAccordingly () const; | |
ab57ceaa RC |
43 | }; |
44 | ||
45 | void do_download_site_info (HINSTANCE h, HWND owner); | |
46 | ||
de6a1a64 RC |
47 | class site_list_type |
48 | { | |
49 | public: | |
d60832c6 MB |
50 | site_list_type () : url (), displayed_url (), key () {}; |
51 | site_list_type (const site_list_type &); | |
08678720 | 52 | site_list_type (const std::string& , const std::string& , |
c4ae0173 | 53 | const std::string& , const std::string&, bool); |
3c054baf | 54 | ~site_list_type () {}; |
d60832c6 MB |
55 | site_list_type &operator= (const site_list_type &); |
56 | std::string url; | |
c4ae0173 | 57 | // provided by mirrors.lst but not used |
e5e2eba8 CF |
58 | std::string servername; |
59 | std::string area; | |
60 | std::string location; | |
c4ae0173 KB |
61 | // did this site come from mirrors.lst? |
62 | bool from_mirrors_lst; | |
d60832c6 | 63 | std::string displayed_url; |
c4ae0173 | 64 | // sort key |
d60832c6 MB |
65 | std::string key; |
66 | bool operator == (const site_list_type &) const; | |
67 | bool operator != (const site_list_type &) const; | |
68 | bool operator < (const site_list_type &) const; | |
69 | bool operator <= (const site_list_type &) const; | |
70 | bool operator > (const site_list_type &) const; | |
71 | bool operator >= (const site_list_type &) const; | |
de6a1a64 RC |
72 | }; |
73 | ||
666bf37d | 74 | typedef std::vector <site_list_type> SiteList; |
3bac26a1 | 75 | |
de6a1a64 | 76 | /* user chosen sites */ |
3bac26a1 | 77 | extern SiteList site_list; |
de6a1a64 | 78 | /* potential sites */ |
3bac26a1 | 79 | extern SiteList all_site_list; |
de6a1a64 | 80 | |
f26f525f | 81 | class SiteSetting |
ead15931 RC |
82 | { |
83 | public: | |
f26f525f CF |
84 | SiteSetting (); |
85 | void save (); | |
86 | ~SiteSetting (); | |
dbdc1d9d | 87 | private: |
f26f525f | 88 | bool saved; |
dbdc1d9d RC |
89 | void getSavedSites(); |
90 | void registerSavedSite(char const *); | |
c123d344 | 91 | const char *lastMirrorKey(); |
ead15931 RC |
92 | }; |
93 | ||
c93bc6d0 | 94 | #endif /* SETUP_SITE_H */ |