/indra/newview/llpanellogin.h

https://bitbucket.org/lindenlab/viewer-beta/ · C Header · 115 lines · 67 code · 20 blank · 28 comment · 0 complexity · 271fb41bc341f70d65ce57ca842d2365 MD5 · raw file

  1. /**
  2. * @file llpanellogin.h
  3. * @brief Login username entry fields.
  4. *
  5. * $LicenseInfo:firstyear=2002&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_LLPANELLOGIN_H
  27. #define LL_LLPANELLOGIN_H
  28. #include "llpanel.h"
  29. #include "llpointer.h" // LLPointer<>
  30. #include "llmediactrl.h" // LLMediaCtrlObserver
  31. #include <boost/scoped_ptr.hpp>
  32. class LLLineEditor;
  33. class LLUIImage;
  34. class LLPanelLoginListener;
  35. class LLSLURL;
  36. class LLCredential;
  37. class LLPanelLogin:
  38. public LLPanel,
  39. public LLViewerMediaObserver
  40. {
  41. LOG_CLASS(LLPanelLogin);
  42. public:
  43. LLPanelLogin(const LLRect &rect, BOOL show_server,
  44. void (*callback)(S32 option, void* user_data),
  45. void *callback_data);
  46. ~LLPanelLogin();
  47. virtual BOOL handleKeyHere(KEY key, MASK mask);
  48. virtual void draw();
  49. virtual void setFocus( BOOL b );
  50. // Show the XUI first name, last name, and password widgets. They are
  51. // hidden on startup for reg-in-client
  52. static void showLoginWidgets();
  53. static void show(const LLRect &rect, BOOL show_server,
  54. void (*callback)(S32 option, void* user_data),
  55. void* callback_data);
  56. static void setFields(LLPointer<LLCredential> credential, BOOL remember);
  57. static void getFields(LLPointer<LLCredential>& credential, BOOL& remember);
  58. static BOOL isGridComboDirty();
  59. static BOOL areCredentialFieldsDirty();
  60. static void setLocation(const LLSLURL& slurl);
  61. static void updateLocationCombo(bool force_visible); // simply update the combo box
  62. static void closePanel();
  63. void setSiteIsAlive( bool alive );
  64. static void loadLoginPage();
  65. static void giveFocus();
  66. static void setAlwaysRefresh(bool refresh);
  67. // inherited from LLViewerMediaObserver
  68. /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
  69. static void updateServer(); // update the combo box, change the login page to the new server, clear the combo
  70. private:
  71. friend class LLPanelLoginListener;
  72. void reshapeBrowser();
  73. void addFavoritesToStartLocation();
  74. void addUsersWithFavoritesToUsername();
  75. static void onClickConnect(void*);
  76. static void onClickNewAccount(void*);
  77. static void onClickVersion(void*);
  78. static void onClickForgotPassword(void*);
  79. static void onClickHelp(void*);
  80. static void onPassKey(LLLineEditor* caller, void* user_data);
  81. static void onSelectServer(LLUICtrl*, void*);
  82. static void onServerComboLostFocus(LLFocusableElement*);
  83. static void updateServerCombo();
  84. static void updateStartSLURL();
  85. static void updateLoginPanelLinks();
  86. private:
  87. LLPointer<LLUIImage> mLogoImage;
  88. boost::scoped_ptr<LLPanelLoginListener> mListener;
  89. void (*mCallback)(S32 option, void *userdata);
  90. void* mCallbackData;
  91. BOOL mPasswordModified;
  92. static LLPanelLogin* sInstance;
  93. static BOOL sCapslockDidNotification;
  94. };
  95. #endif