Translated using Weblate (Chinese (Simplified))
[cygwin-setup.git] / site.h
blob6ec7cf396b2ba292cfd7e662541424489019b9cf
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 OnInit ();
35 virtual void OnActivate ();
36 virtual long OnNext ();
37 virtual long OnBack ();
38 virtual long OnUnattended ();
40 virtual bool OnMessageCmd (int id, HWND hwndctl, UINT code);
42 void PopulateListBox();
43 void CheckControlsAndDisableAccordingly () const;
46 void do_download_site_info (HINSTANCE h, HWND owner);
48 class site_list_type
50 public:
51 site_list_type () : url (), displayed_url (), key () {};
52 site_list_type (const std::string& , const std::string& ,
53 const std::string& , const std::string&, bool, bool);
54 ~site_list_type () {};
55 std::string url;
56 // provided by mirrors.lst but not used
57 std::string servername;
58 std::string area;
59 std::string location;
60 // did this site come from mirrors.lst?
61 bool from_mirrors_lst;
62 // marked as "noshow"
63 bool noshow;
64 std::string displayed_url;
65 // sort key
66 std::string key;
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;
72 bool operator >= (const site_list_type &) const;
75 typedef std::vector <site_list_type> SiteList;
77 /* user chosen sites */
78 extern SiteList site_list;
79 /* potential sites */
80 extern SiteList all_site_list;
82 class SiteSetting
84 public:
85 SiteSetting ();
86 void save ();
87 ~SiteSetting ();
88 private:
89 bool saved;
90 void getSavedSites();
91 void registerSavedSite(char const *);
92 const char *lastMirrorKey();
95 #endif /* SETUP_SITE_H */