PageRenderTime 49ms CodeModel.GetById 35ms 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
Possible License(s): LGPL-2.1
  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. #ifndef LL_DELAYEDGESTUREERROR_H
  28. #define LL_DELAYEDGESTUREERROR_H
  29. #include <list>
  30. #include "lltimer.h"
  31. // TODO: Refactor to be more generic - this may be useful for other delayed notifications in the future
  32. class LLDelayedGestureError
  33. {
  34. public:
  35. /**
  36. * @brief Generates a missing gesture error
  37. * @param id UUID of missing gesture
  38. * Delays message for up to 5 seconds if UUID can't be immediately converted to a text description
  39. */
  40. static void gestureMissing(const LLUUID &id);
  41. /**
  42. * @brief Generates a gesture failed to load error
  43. * @param id UUID of missing gesture
  44. * Delays message for up to 5 seconds if UUID can't be immediately converted to a text description
  45. */
  46. static void gestureFailedToLoad(const LLUUID &id);
  47. private:
  48. struct LLErrorEntry
  49. {
  50. LLErrorEntry(const std::string& notify, const LLUUID &item) : mTimer(), mNotifyName(notify), mItemID(item) {}
  51. LLTimer mTimer;
  52. std::string mNotifyName;
  53. LLUUID mItemID;
  54. };
  55. static bool doDialog(const LLErrorEntry &ent, bool uuid_ok = false);
  56. static void enqueue(const LLErrorEntry &ent);
  57. static void onIdle(void *userdata);
  58. typedef std::list<LLErrorEntry> ErrorQueue;
  59. static ErrorQueue sQueue;
  60. };
  61. #endif