PageRenderTime 198ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/indra/newview/llsyswellitem.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 81 lines | 36 code | 16 blank | 29 comment | 0 complexity | 19b61342663217bdfb6be8f232b8d263 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llsyswellitem.h
  3. * @brief // TODO
  4. *
  5. * $LicenseInfo:firstyear=2003&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLSYSWELLITEM_H
  27. #define LL_LLSYSWELLITEM_H
  28. #include "llpanel.h"
  29. #include "lltextbox.h"
  30. #include "llbutton.h"
  31. #include "lliconctrl.h"
  32. #include <string>
  33. class LLSysWellItem : public LLPanel
  34. {
  35. public:
  36. struct Params : public LLInitParam::Block<Params, LLPanel::Params>
  37. {
  38. LLUUID notification_id;
  39. std::string title;
  40. Params() {};
  41. };
  42. LLSysWellItem(const Params& p);
  43. virtual ~LLSysWellItem();
  44. // title
  45. void setTitle( std::string title );
  46. // get item's ID
  47. LLUUID getID() { return mID; }
  48. // handlers
  49. virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
  50. virtual void onMouseEnter(S32 x, S32 y, MASK mask);
  51. virtual void onMouseLeave(S32 x, S32 y, MASK mask);
  52. //callbacks
  53. typedef boost::function<void (LLSysWellItem* item)> syswell_item_callback_t;
  54. typedef boost::signals2::signal<void (LLSysWellItem* item)> syswell_item_signal_t;
  55. syswell_item_signal_t mOnItemClose;
  56. syswell_item_signal_t mOnItemClick;
  57. boost::signals2::connection setOnItemCloseCallback(syswell_item_callback_t cb) { return mOnItemClose.connect(cb); }
  58. boost::signals2::connection setOnItemClickCallback(syswell_item_callback_t cb) { return mOnItemClick.connect(cb); }
  59. private:
  60. void onClickCloseBtn();
  61. LLTextBox* mTitle;
  62. LLButton* mCloseBtn;
  63. LLUUID mID;
  64. };
  65. #endif // LL_LLSYSWELLITEM_H