PageRenderTime 21ms CodeModel.GetById 14ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/lldelayedgestureerror.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 77 lines | 24 code | 16 blank | 37 comment | 0 complexity | 19100be0a0a5008f0ddd9481e6c2578a MD5 | raw file
 1/** 
 2 * @file lldelayedgestureerror.h
 3 * @brief Delayed gesture error message -- try to wait until name has been retrieved
 4 * @author Dale Glass
 5 *
 6 * $LicenseInfo:firstyear=2004&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 */
27
28
29#ifndef LL_DELAYEDGESTUREERROR_H
30#define LL_DELAYEDGESTUREERROR_H
31
32#include <list>
33#include "lltimer.h"
34
35// TODO: Refactor to be more generic - this may be useful for other delayed notifications in the future
36
37class LLDelayedGestureError
38{
39public:
40	/**
41	 * @brief Generates a missing gesture error
42	 * @param id UUID of missing gesture
43	 * Delays message for up to 5 seconds if UUID can't be immediately converted to a text description
44	 */
45	static void gestureMissing(const LLUUID &id);
46
47	/**
48	 * @brief Generates a gesture failed to load error
49	 * @param id UUID of missing gesture
50	 * Delays message for up to 5 seconds if UUID can't be immediately converted to a text description
51	 */
52	static void gestureFailedToLoad(const LLUUID &id);
53
54private:
55	
56
57	struct LLErrorEntry
58	{
59		LLErrorEntry(const std::string& notify, const LLUUID &item) : mTimer(), mNotifyName(notify), mItemID(item) {}
60
61		LLTimer mTimer;
62		std::string mNotifyName;
63		LLUUID mItemID;
64	};
65
66
67	static bool doDialog(const LLErrorEntry &ent, bool uuid_ok = false);
68	static void enqueue(const LLErrorEntry &ent);
69	static void onIdle(void *userdata);
70
71	typedef std::list<LLErrorEntry> ErrorQueue;
72
73	static ErrorQueue sQueue;
74};
75
76
77#endif