aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/hippoGridManager.h
diff options
context:
space:
mode:
authorJacek Antonelli2009-09-10 02:31:50 -0500
committerJacek Antonelli2009-09-10 02:35:58 -0500
commitf57eabefa1291f4e047aa03416c9c544413b9f0e (patch)
tree25f1d75d05a8b00f3c2b7207731a9cfafdad9732 /linden/indra/newview/hippoGridManager.h
parentMerged 'armin/grid-manager5' into login-manager (diff)
downloadmeta-impy-f57eabefa1291f4e047aa03416c9c544413b9f0e.zip
meta-impy-f57eabefa1291f4e047aa03416c9c544413b9f0e.tar.gz
meta-impy-f57eabefa1291f4e047aa03416c9c544413b9f0e.tar.bz2
meta-impy-f57eabefa1291f4e047aa03416c9c544413b9f0e.tar.xz
Fixed line endings on hippo and grid manager files.
Diffstat (limited to 'linden/indra/newview/hippoGridManager.h')
-rw-r--r--linden/indra/newview/hippoGridManager.h342
1 files changed, 171 insertions, 171 deletions
diff --git a/linden/indra/newview/hippoGridManager.h b/linden/indra/newview/hippoGridManager.h
index 933a944..f6ee497 100644
--- a/linden/indra/newview/hippoGridManager.h
+++ b/linden/indra/newview/hippoGridManager.h
@@ -1,171 +1,171 @@
1#ifndef __HIPPO_GRID_MANAGER_H__ 1#ifndef __HIPPO_GRID_MANAGER_H__
2#define __HIPPO_GRID_MANAGER_H__ 2#define __HIPPO_GRID_MANAGER_H__
3 3
4 4
5#include <map> 5#include <map>
6#include <string> 6#include <string>
7 7
8#ifndef XML_STATIC 8#ifndef XML_STATIC
9#define XML_STATIC 9#define XML_STATIC
10#endif 10#endif
11#include <expat/expat.h> 11#include <expat/expat.h>
12 12
13 13
14class LLSD; 14class LLSD;
15 15
16 16
17class HippoGridInfo 17class HippoGridInfo
18{ 18{
19public: 19public:
20 enum Platform { 20 enum Platform {
21 PLATFORM_OTHER = 0, 21 PLATFORM_OTHER = 0,
22 PLATFORM_OPENSIM, 22 PLATFORM_OPENSIM,
23 PLATFORM_SECONDLIFE, 23 PLATFORM_SECONDLIFE,
24 PLATFORM_LAST 24 PLATFORM_LAST
25 }; 25 };
26 enum SearchType { 26 enum SearchType {
27 SEARCH_ALL_EMPTY, 27 SEARCH_ALL_EMPTY,
28 SEARCH_ALL_QUERY, 28 SEARCH_ALL_QUERY,
29 SEARCH_ALL_TEMPLATE 29 SEARCH_ALL_TEMPLATE
30 }; 30 };
31 31
32 explicit HippoGridInfo(const std::string &gridNick); 32 explicit HippoGridInfo(const std::string &gridNick);
33 33
34 Platform getPlatform() const { return mPlatform; } 34 Platform getPlatform() const { return mPlatform; }
35 const std::string &getGridNick() const { return mGridNick; } 35 const std::string &getGridNick() const { return mGridNick; }
36 const std::string &getGridName() const { return mGridName; } 36 const std::string &getGridName() const { return mGridName; }
37 const std::string &getLoginUri() const { return mLoginUri; } 37 const std::string &getLoginUri() const { return mLoginUri; }
38 const std::string &getLoginPage() const { return mLoginPage; } 38 const std::string &getLoginPage() const { return mLoginPage; }
39 const std::string &getHelperUri() const { return mHelperUri; } 39 const std::string &getHelperUri() const { return mHelperUri; }
40 const std::string &getWebSite() const { return mWebSite; } 40 const std::string &getWebSite() const { return mWebSite; }
41 const std::string &getSupportUrl() const { return mSupportUrl; } 41 const std::string &getSupportUrl() const { return mSupportUrl; }
42 const std::string &getRegisterUrl() const { return mRegisterUrl; } 42 const std::string &getRegisterUrl() const { return mRegisterUrl; }
43 const std::string &getPasswordUrl() const { return mPasswordUrl; } 43 const std::string &getPasswordUrl() const { return mPasswordUrl; }
44 const std::string &getSearchUrl() const { return mSearchUrl; } 44 const std::string &getSearchUrl() const { return mSearchUrl; }
45 const std::string &getFirstName() const { return mFirstName; } 45 const std::string &getFirstName() const { return mFirstName; }
46 const std::string &getLastName() const { return mLastName; } 46 const std::string &getLastName() const { return mLastName; }
47 const std::string &getAvatarPassword() const { return mAvatarPassword; } 47 const std::string &getAvatarPassword() const { return mAvatarPassword; }
48 std::string getSearchUrl(SearchType ty) const; 48 std::string getSearchUrl(SearchType ty) const;
49 bool isRenderCompat() const { return mRenderCompat; } 49 bool isRenderCompat() const { return mRenderCompat; }
50 50
51 const std::string &getCurrencySymbol() const { return mCurrencySymbol; } 51 const std::string &getCurrencySymbol() const { return mCurrencySymbol; }
52 const std::string &getRealCurrencySymbol() const { return mRealCurrencySymbol; } 52 const std::string &getRealCurrencySymbol() const { return mRealCurrencySymbol; }
53 std::string getUploadFee() const; 53 std::string getUploadFee() const;
54 std::string getGroupCreationFee() const; 54 std::string getGroupCreationFee() const;
55 std::string getDirectoryFee() const; 55 std::string getDirectoryFee() const;
56 56
57 bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM ); } 57 bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM ); }
58 bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); } 58 bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); }
59 59
60 void setPlatform (const std::string &platform); 60 void setPlatform (const std::string &platform);
61 void setPlatform (Platform platform); 61 void setPlatform (Platform platform);
62 void setGridName (const std::string &gridName) { mGridName = gridName; } 62 void setGridName (const std::string &gridName) { mGridName = gridName; }
63 void setLoginUri (const std::string &loginUri) { mLoginUri = loginUri; cleanUpUri(mLoginUri); } 63 void setLoginUri (const std::string &loginUri) { mLoginUri = loginUri; cleanUpUri(mLoginUri); }
64 void setLoginPage(const std::string &loginPage) { mLoginPage = loginPage; } 64 void setLoginPage(const std::string &loginPage) { mLoginPage = loginPage; }
65 void setHelperUri(const std::string &helperUri) { mHelperUri = helperUri; cleanUpUri(mHelperUri); } 65 void setHelperUri(const std::string &helperUri) { mHelperUri = helperUri; cleanUpUri(mHelperUri); }
66 void setWebSite (const std::string &website) { mWebSite = website; } 66 void setWebSite (const std::string &website) { mWebSite = website; }
67 void setSupportUrl(const std::string &url) { mSupportUrl = url; } 67 void setSupportUrl(const std::string &url) { mSupportUrl = url; }
68 void setRegisterUrl(const std::string &url) { mRegisterUrl = url; } 68 void setRegisterUrl(const std::string &url) { mRegisterUrl = url; }
69 void setPasswordUrl(const std::string &url) { mPasswordUrl = url; } 69 void setPasswordUrl(const std::string &url) { mPasswordUrl = url; }
70 void setSearchUrl(const std::string &url) { mSearchUrl = url; } 70 void setSearchUrl(const std::string &url) { mSearchUrl = url; }
71 void setRenderCompat(bool compat) { mRenderCompat = compat; } 71 void setRenderCompat(bool compat) { mRenderCompat = compat; }
72 void setFirstName(const std::string &firstName) { mFirstName = firstName; } //aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 72 void setFirstName(const std::string &firstName) { mFirstName = firstName; } //aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
73 void setLastName(const std::string &lastName) { mLastName = lastName; } 73 void setLastName(const std::string &lastName) { mLastName = lastName; }
74 void setAvatarPassword(const std::string &avatarPassword) { mAvatarPassword = avatarPassword; } 74 void setAvatarPassword(const std::string &avatarPassword) { mAvatarPassword = avatarPassword; }
75 75
76 void setCurrencySymbol(const std::string &sym) { mCurrencySymbol = sym.substr(0, 3); } 76 void setCurrencySymbol(const std::string &sym) { mCurrencySymbol = sym.substr(0, 3); }
77 void setRealCurrencySymbol(const std::string &sym) { mRealCurrencySymbol = sym.substr(0, 3); } 77 void setRealCurrencySymbol(const std::string &sym) { mRealCurrencySymbol = sym.substr(0, 3); }
78 void setDirectoryFee(int fee) { mDirectoryFee = fee; } 78 void setDirectoryFee(int fee) { mDirectoryFee = fee; }
79 79
80 bool retrieveGridInfo(); 80 bool retrieveGridInfo();
81 81
82 static const char *getPlatformString(Platform platform); 82 static const char *getPlatformString(Platform platform);
83 static void cleanUpGridNick(std::string &gridnick); 83 static void cleanUpGridNick(std::string &gridnick);
84 84
85 static HippoGridInfo FALLBACK_GRIDINFO; 85 static HippoGridInfo FALLBACK_GRIDINFO;
86 static void initFallback(); 86 static void initFallback();
87 87
88private: 88private:
89 Platform mPlatform; 89 Platform mPlatform;
90 std::string mGridNick; 90 std::string mGridNick;
91 std::string mGridName; 91 std::string mGridName;
92 std::string mLoginUri; 92 std::string mLoginUri;
93 std::string mLoginPage; 93 std::string mLoginPage;
94 std::string mHelperUri; 94 std::string mHelperUri;
95 std::string mWebSite; 95 std::string mWebSite;
96 std::string mSupportUrl; 96 std::string mSupportUrl;
97 std::string mRegisterUrl; 97 std::string mRegisterUrl;
98 std::string mPasswordUrl; 98 std::string mPasswordUrl;
99 std::string mSearchUrl; 99 std::string mSearchUrl;
100 std::string mFirstName; 100 std::string mFirstName;
101 std::string mLastName; 101 std::string mLastName;
102 std::string mAvatarPassword; 102 std::string mAvatarPassword;
103 bool mRenderCompat; 103 bool mRenderCompat;
104 104
105 std::string mCurrencySymbol; 105 std::string mCurrencySymbol;
106 std::string mRealCurrencySymbol; 106 std::string mRealCurrencySymbol;
107 int mDirectoryFee; 107 int mDirectoryFee;
108 108
109 // for parsing grid info XML 109 // for parsing grid info XML
110 enum XmlState { 110 enum XmlState {
111 XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME, 111 XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME,
112 XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI, 112 XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI,
113 XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH 113 XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH
114 }; 114 };
115 XmlState mXmlState; 115 XmlState mXmlState;
116 116
117 static void cleanUpUri(std::string &uri); 117 static void cleanUpUri(std::string &uri);
118 void formatFee(std::string &fee, int cost, bool showFree) const; 118 void formatFee(std::string &fee, int cost, bool showFree) const;
119 119
120 static void onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts); 120 static void onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts);
121 static void onXmlElementEnd(void *userData, const XML_Char *name); 121 static void onXmlElementEnd(void *userData, const XML_Char *name);
122 static void onXmlCharacterData(void *userData, const XML_Char *s, int len); 122 static void onXmlCharacterData(void *userData, const XML_Char *s, int len);
123}; 123};
124 124
125 125
126class HippoGridManager 126class HippoGridManager
127{ 127{
128public: 128public:
129 HippoGridManager(); 129 HippoGridManager();
130 ~HippoGridManager(); 130 ~HippoGridManager();
131 131
132 void init(); 132 void init();
133 void saveFile(); 133 void saveFile();
134 void discardAndReload(); 134 void discardAndReload();
135 135
136 HippoGridInfo *getGrid(const std::string &grid) const; 136 HippoGridInfo *getGrid(const std::string &grid) const;
137 HippoGridInfo *getConnectedGrid() const { return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); } 137 HippoGridInfo *getConnectedGrid() const { return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); }
138 HippoGridInfo *getCurrentGrid() const; 138 HippoGridInfo *getCurrentGrid() const;
139 const std::string &getDefaultGridNick() const { return mDefaultGrid; } 139 const std::string &getDefaultGridNick() const { return mDefaultGrid; }
140 const std::string &getCurrentGridNick() const { return mCurrentGrid; } 140 const std::string &getCurrentGridNick() const { return mCurrentGrid; }
141 141
142 void setDefaultGrid(const std::string &grid); 142 void setDefaultGrid(const std::string &grid);
143 void setCurrentGrid(const std::string &grid); 143 void setCurrentGrid(const std::string &grid);
144 void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); } 144 void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); }
145 145
146 void addGrid(HippoGridInfo *grid); 146 void addGrid(HippoGridInfo *grid);
147 void deleteGrid(const std::string &grid); 147 void deleteGrid(const std::string &grid);
148 148
149 typedef std::map<std::string, HippoGridInfo*>::iterator GridIterator; 149 typedef std::map<std::string, HippoGridInfo*>::iterator GridIterator;
150 GridIterator beginGrid() { return mGridInfo.begin(); } 150 GridIterator beginGrid() { return mGridInfo.begin(); }
151 GridIterator endGrid() { return mGridInfo.end(); } 151 GridIterator endGrid() { return mGridInfo.end(); }
152 152
153private: 153private:
154 std::map<std::string, HippoGridInfo*> mGridInfo; 154 std::map<std::string, HippoGridInfo*> mGridInfo;
155 std::string mDefaultGrid; 155 std::string mDefaultGrid;
156 std::string mCurrentGrid; 156 std::string mCurrentGrid;
157 HippoGridInfo *mConnectedGrid; 157 HippoGridInfo *mConnectedGrid;
158 int mDefaultGridsVersion; 158 int mDefaultGridsVersion;
159 159
160 void cleanup(); 160 void cleanup();
161 void loadFromFile(); 161 void loadFromFile();
162 void parseFile(const std::string &fileName, bool mergeIfNewer); 162 void parseFile(const std::string &fileName, bool mergeIfNewer);
163 void parseUrl(const char *url, bool mergeIfNewer); 163 void parseUrl(const char *url, bool mergeIfNewer);
164 void parseData(LLSD &gridInfo, bool mergeIfNewer); 164 void parseData(LLSD &gridInfo, bool mergeIfNewer);
165}; 165};
166 166
167 167
168extern HippoGridManager *gHippoGridManager; 168extern HippoGridManager *gHippoGridManager;
169 169
170 170
171#endif 171#endif