diff options
author | Bryan O'Sullivan <bos@lindenlab.com> | 2009-09-08 14:49:49 -0700 |
---|---|---|
committer | Bryan O'Sullivan <bos@lindenlab.com> | 2009-09-08 14:49:49 -0700 |
commit | 1018b36b87d0d19e020c1e416c33c76b06125633 (patch) | |
tree | ef111a3f5b634ddc3aa23f6e6c3505142e54261a /indra/newview/llteleporthistorystorage.h | |
parent | 91aa2f37f409b7755d460c5a8e9c8d6a9a50557c (diff) | |
parent | 76001ce3f0b53391c674f315855017b78a3a2873 (diff) |
Merge
Diffstat (limited to 'indra/newview/llteleporthistorystorage.h')
-rw-r--r-- | indra/newview/llteleporthistorystorage.h | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/indra/newview/llteleporthistorystorage.h b/indra/newview/llteleporthistorystorage.h index fa836c0326..f67c4e2fb9 100644 --- a/indra/newview/llteleporthistorystorage.h +++ b/indra/newview/llteleporthistorystorage.h @@ -78,7 +78,10 @@ class LLTeleportHistoryStorage: public LLSingleton<LLTeleportHistoryStorage> public: - typedef std::vector<LLTeleportHistoryPersistentItem> item_list_list_t; + typedef std::vector<LLTeleportHistoryPersistentItem> slurl_list_t; + + typedef boost::function<void()> history_callback_t; + typedef boost::signals2::signal<void()> history_signal_t; LLTeleportHistoryStorage(); ~LLTeleportHistoryStorage(); @@ -86,7 +89,7 @@ public: /** * @return history items. */ - const item_list_list_t& getItems() const { return mItems; } + const slurl_list_t& getItems() const { return mItems; } void purgeItems(); void addItem(const std::string title, const LLVector3d& global_pos); @@ -99,10 +102,34 @@ public: void dump() const; + /** + * Set a callback to be called upon history changes. + * + * Multiple callbacks can be set. + */ + boost::signals2::connection setHistoryChangedCallback(history_callback_t cb); + + /** + * Go to specific item in the history. + * + * The item is specified by its index (starting from 0). + */ + void goToItem(S32 idx); + private: - item_list_list_t mItems; - std::string mFilename; + void onTeleportHistoryChange(); + bool compareByTitleAndGlobalPos(const LLTeleportHistoryPersistentItem& a, const LLTeleportHistoryPersistentItem& b); + + slurl_list_t mItems; + std::string mFilename; + + /** + * Signal emitted when the history gets changed. + * + * Invokes callbacks set with setHistoryChangedCallback(). + */ + history_signal_t mHistoryChangedSignal; }; #endif //LL_LLTELEPORTHISTORYSTORAGE_H |