summaryrefslogtreecommitdiff
path: root/indra/newview/lllocationhistory.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lllocationhistory.h')
-rw-r--r--indra/newview/lllocationhistory.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/indra/newview/lllocationhistory.h b/indra/newview/lllocationhistory.h
index 5f9976f87a..fb71fbaa0f 100644
--- a/indra/newview/lllocationhistory.h
+++ b/indra/newview/lllocationhistory.h
@@ -41,11 +41,13 @@
#include <boost/function.hpp>
class LLSD;
-
+/**
+ * This enum is responsible for identifying of history item.
+ */
enum ELocationType {
- TYPED_REGION_SURL//region name or surl
- ,LANDMARK // name of landmark
- ,TELEPORT_HISTORY
+ TYPED_REGION_SLURL//item added after the user had typed a region name or slurl
+ ,LANDMARK // item has been loaded from landmark folder
+ ,TELEPORT_HISTORY // item from session teleport history
};
class LLLocationHistoryItem {
@@ -109,9 +111,16 @@ class LLLocationHistory: public LLSingleton<LLLocationHistory>
LOG_CLASS(LLLocationHistory);
public:
+ enum EChangeType
+ {
+ ADD
+ ,CLEAR
+ ,LOAD
+ };
+
typedef std::vector<LLLocationHistoryItem> location_list_t;
- typedef boost::function<void()> loaded_callback_t;
- typedef boost::signals2::signal<void()> loaded_signal_t;
+ typedef boost::function<void(EChangeType event)> history_changed_callback_t;
+ typedef boost::signals2::signal<void(EChangeType event)> history_changed_signal_t;
LLLocationHistory();
@@ -120,8 +129,8 @@ public:
void removeItems();
size_t getItemCount() const { return mItems.size(); }
const location_list_t& getItems() const { return mItems; }
- bool getMatchingItems(std::string substring, location_list_t& result) const;
- boost::signals2::connection setLoadedCallback(loaded_callback_t cb) { return mLoadedSignal.connect(cb); }
+ bool getMatchingItems(const std::string& substring, location_list_t& result) const;
+ boost::signals2::connection setChangedCallback(history_changed_callback_t cb) { return mChangedSignal.connect(cb); }
void save() const;
void load();
@@ -131,7 +140,7 @@ private:
location_list_t mItems;
std::string mFilename; /// File to store the history to.
- loaded_signal_t mLoadedSignal;
+ history_changed_signal_t mChangedSignal;
};
#endif