diff options
Diffstat (limited to 'linden/indra/newview/authentication_model.h')
-rw-r--r-- | linden/indra/newview/authentication_model.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/linden/indra/newview/authentication_model.h b/linden/indra/newview/authentication_model.h new file mode 100644 index 0000000..858e936 --- /dev/null +++ b/linden/indra/newview/authentication_model.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * authentication_model.h | ||
3 | * SecondLife | ||
4 | * | ||
5 | * Created by RMS on 7/17/08. | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef PL_authentication_model_H | ||
10 | #define PL_authentication_model_H | ||
11 | |||
12 | #include <string> | ||
13 | #include <set> | ||
14 | #include <list> | ||
15 | #include <boost/signal.hpp> | ||
16 | #include <boost/bind.hpp> | ||
17 | #include "lluuid.h" | ||
18 | #include "llmemory.h" | ||
19 | #include "llsd.h" | ||
20 | |||
21 | class AuthenticationModel : public LLSingleton<AuthenticationModel> | ||
22 | { | ||
23 | public: | ||
24 | typedef boost::signal<void ()> event_t; | ||
25 | typedef boost::signals::connection connection_t; | ||
26 | |||
27 | AuthenticationModel(); | ||
28 | virtual ~AuthenticationModel(); | ||
29 | |||
30 | void loadPersistentData(); | ||
31 | void savePersistentData(); | ||
32 | void revert(); | ||
33 | |||
34 | /* generic update, pull model: */ | ||
35 | connection_t subscribeToModelUpdates(event_t::slot_function_type subscriber); | ||
36 | void unsubscribe(connection_t subscriber); | ||
37 | |||
38 | /* setters */ | ||
39 | void addAccount(const std::string &grid, const std::string &accountName, const std::string &accountPassword); | ||
40 | void removeAccount(const std::string &grid, const std::string &accountName); | ||
41 | void changePassword(const std::string &grid, const std::string &accountName, const std::string &newPassword); | ||
42 | |||
43 | /* getters */ | ||
44 | void getAllAccountNames(std::list<std::string> &names); | ||
45 | void getAccountNames(const std::string &grid, std::set<std::string> &names); | ||
46 | void getPassword(const std::string &grid, const std::string &accountName, std::string &password); | ||
47 | void requestUpdate(); | ||
48 | protected: | ||
49 | LLSD mAuthLLSD; | ||
50 | private: | ||
51 | event_t mEventUpdate; | ||
52 | }; | ||
53 | #endif // PL_authentication_model_H | ||