De-clutter the mirror selection listbox
[cygwin-setup.git] / site.h
blob69265f23079f8bbcde2d17aeaf4389adcd278cca
1 /*
2 * Copyright (c) 2001, Robert Collins.
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.
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
12 * Written by Robert Collins <rbtcollins@hotmail.com>
16 #ifndef SETUP_SITE_H
17 #define SETUP_SITE_H
19 #include <string>
20 #include <vector>
22 #include "proppage.h"
24 class SitePage : public PropertyPage
26 public:
27 SitePage ();
28 virtual ~ SitePage ()
32 bool Create ();
34 virtual void OnActivate ();
35 virtual long OnNext ();
36 virtual long OnBack ();
37 virtual long OnUnattended ();
39 virtual bool OnMessageCmd (int id, HWND hwndctl, UINT code);
41 void PopulateListBox();
42 void CheckControlsAndDisableAccordingly () const;
45 void do_download_site_info (HINSTANCE h, HWND owner);
47 class site_list_type
49 public:
50 site_list_type () : url (), displayed_url (), key () {};
51 site_list_type (const std::string& , const std::string& ,
52 const std::string& , const std::string&, bool, bool);
53 ~site_list_type () {};
54 std::string url;
55 // provided by mirrors.lst but not used
56 std::string servername;
57 std::string area;
58 std::string location;
59 // did this site come from mirrors.lst?
60 bool from_mirrors_lst;
61 // marked as "noshow"
62 bool noshow;
63 std::string displayed_url;
64 // sort key
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;
74 typedef std::vector <site_list_type> SiteList;
76 /* user chosen sites */
77 extern SiteList site_list;
78 /* potential sites */
79 extern SiteList all_site_list;
81 class SiteSetting
83 public:
84 SiteSetting ();
85 void save ();
86 ~SiteSetting ();
87 private:
88 bool saved;
89 void getSavedSites();
90 void registerSavedSite(char const *);
91 const char *lastMirrorKey();
94 #endif /* SETUP_SITE_H */