aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/rlvhelper.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/rlvhelper.h78
1 files changed, 77 insertions, 1 deletions
diff --git a/linden/indra/newview/rlvhelper.h b/linden/indra/newview/rlvhelper.h
index 42d10b8..25d8174 100644
--- a/linden/indra/newview/rlvhelper.h
+++ b/linden/indra/newview/rlvhelper.h
@@ -109,6 +109,80 @@ protected:
109}; 109};
110 110
111// ============================================================================ 111// ============================================================================
112// RlvAttachmentManager - Self contained helper class that automagically takes care of the nitty gritty of force detaching/reattaching
113//
114
115class RlvAttachmentManager
116{
117public:
118 RlvAttachmentManager() : m_pTimer(NULL) {}
119 ~RlvAttachmentManager() { delete m_pTimer; }
120
121 /*
122 * Member functions
123 */
124public:
125 static void forceAttach(const LLUUID& idItem, S32 idxAttachPt);
126 static void forceDetach(LLViewerJointAttachment* pAttachPt);
127protected:
128 void startTimer() { if (!m_pTimer) m_pTimer = new RlvAttachmentManagerTimer(this); }
129
130 /*
131 * Event handlers
132 */
133public:
134 void onAttach(LLViewerJointAttachment* pAttachPt);
135 void onDetach(LLViewerJointAttachment* pAttachPt);
136 void onSavedAssetIntoInventory(const LLUUID& idItem);
137 BOOL onTimer();
138 void onWearAttachment(const LLUUID& idItem);
139
140 /*
141 * Member variables
142 */
143protected:
144 typedef std::map<S32, LLUUID> rlv_detach_map_t;
145 rlv_detach_map_t m_PendingDetach;
146
147 struct RlvReattachInfo
148 {
149 RlvReattachInfo(const LLUUID& itemid) : idItem(itemid), fAssetSaved(false), tsAttach(0)
150 { tsDetach = LLFrameTimer::getElapsedSeconds(); }
151
152 LLUUID idItem;
153 bool fAssetSaved;
154 F64 tsDetach;
155 F64 tsAttach;
156 protected:
157 RlvReattachInfo();
158 };
159 typedef std::map<S32, RlvReattachInfo> rlv_attach_map_t;
160 rlv_attach_map_t m_PendingAttach;
161
162 struct RlvWearInfo
163 {
164 RlvWearInfo(LLUUID itemid) : idItem(itemid) { tsWear = LLFrameTimer::getElapsedSeconds(); }
165
166 LLUUID idItem;
167 F64 tsWear;
168 std::map<S32, LLUUID> attachPts;
169 protected:
170 RlvWearInfo();
171 };
172 typedef std::map<LLUUID, RlvWearInfo> rlv_wear_map_t;
173 rlv_wear_map_t m_PendingWear;
174
175 class RlvAttachmentManagerTimer : public LLEventTimer
176 {
177 public:
178 RlvAttachmentManagerTimer(RlvAttachmentManager* pMgr) : LLEventTimer(10), m_pMgr(pMgr) {}
179 virtual ~RlvAttachmentManagerTimer() { m_pMgr->m_pTimer = NULL; }
180 virtual BOOL tick() { return m_pMgr->onTimer(); }
181 RlvAttachmentManager* m_pMgr;
182 } *m_pTimer;
183};
184
185// ============================================================================
112// RlvCriteriaCategoryCollector - Criteria based folder matching filter used by @findfolder and @findfolders 186// RlvCriteriaCategoryCollector - Criteria based folder matching filter used by @findfolder and @findfolders
113// 187//
114 188
@@ -295,7 +369,10 @@ public:
295 369
296struct RlvSelectHasLockedAttach : public LLSelectedNodeFunctor 370struct RlvSelectHasLockedAttach : public LLSelectedNodeFunctor
297{ 371{
372 RlvSelectHasLockedAttach(ERlvLockMask eLock) : m_eLock(eLock) {}
298 virtual bool apply(LLSelectNode* pNode); 373 virtual bool apply(LLSelectNode* pNode);
374protected:
375 ERlvLockMask m_eLock;
299}; 376};
300 377
301struct RlvSelectIsOwnedByOrGroupOwned : public LLSelectedNodeFunctor 378struct RlvSelectIsOwnedByOrGroupOwned : public LLSelectedNodeFunctor
@@ -324,7 +401,6 @@ bool rlvIsEmote(const std::string& strUTF8Text);
324bool rlvIsValidReplyChannel(S32 nChannel); 401bool rlvIsValidReplyChannel(S32 nChannel);
325bool rlvIsWearingItem(const LLInventoryItem* pItem); 402bool rlvIsWearingItem(const LLInventoryItem* pItem);
326 403
327void rlvForceDetach(LLViewerJointAttachment* pAttachPt);
328void rlvSendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLUUID& idSession = LLUUID::null); 404void rlvSendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLUUID& idSession = LLUUID::null);
329bool rlvSendChatReply(const std::string& strChannel, const std::string& strReply); 405bool rlvSendChatReply(const std::string& strChannel, const std::string& strReply);
330bool rlvSendChatReply(S32 nChannel, const std::string& strReply); 406bool rlvSendChatReply(S32 nChannel, const std::string& strReply);