diff options
author | Bryan O'Sullivan <bos@lindenlab.com> | 2009-06-22 15:02:19 -0700 |
---|---|---|
committer | Bryan O'Sullivan <bos@lindenlab.com> | 2009-06-22 15:02:19 -0700 |
commit | baa73fddd9287ddafd2d31551cb253b355ed910a (patch) | |
tree | e3f0986617fe6c0ee0a14df6aac13c6bb6f92507 /indra/newview/llpanelavatar.h | |
parent | dc3833f31b8a20220ddb1775e1625c016c397435 (diff) | |
parent | fcaa1ad46fd1df4cfec9dee12caf6e7b5bf32136 (diff) |
Merge with viewer-2.0.0-3 branch
Diffstat (limited to 'indra/newview/llpanelavatar.h')
-rw-r--r-- | indra/newview/llpanelavatar.h | 341 |
1 files changed, 77 insertions, 264 deletions
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 8c7112197f..f72eb1990d 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -37,10 +37,12 @@ #include "v3dmath.h" #include "lluuid.h" #include "llwebbrowserctrl.h" + #include "llavatarpropertiesprocessor.h" class LLButton; class LLCheckBoxCtrl; +class LLComboBox; class LLDropTarget; class LLInventoryItem; class LLLineEditor; @@ -57,6 +59,12 @@ class LLViewerObject; class LLMessageSystem; class LLIconCtrl; class LLWebBrowserCtrl; +class LLVector3d; +class LLFloaterReg; + +class LLPanelMeProfile; +class LLPanelPick; +class LLAgent; enum EOnlineStatus { @@ -64,322 +72,127 @@ enum EOnlineStatus ONLINE_STATUS_YES = 1 }; -// Base class for all sub-tabs inside the avatar profile. Many of these -// panels need to keep track of the parent panel (to get the avatar id) -// and only request data from the database when they are first drawn. JC -class LLPanelAvatarTab : public LLPanel -{ -public: - LLPanelAvatarTab(LLPanelAvatar* panel_avatar); - - // Calls refresh() once per frame when panel is visible - /*virtual*/ void draw(); - - LLPanelAvatar* getPanelAvatar() const { return mPanelAvatar; } - - void setDataRequested(bool requested) { mDataRequested = requested; } - bool isDataRequested() const { return mDataRequested; } - - // If the data for this tab has not yet been requested, - // send the request. Used by tabs that are filled in only - // when they are first displayed. - // type is one of "avatarnotesrequest", "avatarpicksrequest", - // or "avatarclassifiedsrequest" - void sendAvatarProfileRequestIfNeeded(const std::string& method); - -private: - LLPanelAvatar* mPanelAvatar; - bool mDataRequested; -}; - -class LLPanelAvatarFirstLife : public LLPanelAvatarTab +class LLPanelProfileTab + : public LLPanel + , public LLAvatarPropertiesObserver { public: - LLPanelAvatarFirstLife(LLPanelAvatar* panel_avatar); - - /*virtual*/ BOOL postBuild(void); - - void enableControls(BOOL own_avatar); -}; - - -class LLPanelAvatarSecondLife -: public LLPanelAvatarTab -{ -public: - LLPanelAvatarSecondLife(LLPanelAvatar* panel_avatar ); - - /*virtual*/ BOOL postBuild(void); - /*virtual*/ void refresh(); - - static void onClickImage( void *userdata); - static void onClickFriends( void *userdata); - static void onDoubleClickGroup(void* userdata); - static void onClickPublishHelp(void *userdata); - static void onClickPartnerHelp(void *userdata); - static bool onClickPartnerHelpLoadURL(const LLSD& notification, const LLSD& response); - static void onClickPartnerInfo(void *userdata); - - // Clear out the controls anticipating new network data. - void clearControls(); - void enableControls(BOOL own_avatar); - void updateOnlineText(BOOL online, BOOL have_calling_card); - void updatePartnerName(); - - void setPartnerID(LLUUID id) { mPartnerID = id; } -private: - LLUUID mPartnerID; -}; - + LLPanelProfileTab(const LLUUID& avatar_id); + LLPanelProfileTab(const Params& params ); -// WARNING! The order of the inheritance here matters!! Do not change. - KLW -class LLPanelAvatarWeb : - public LLPanelAvatarTab - , public LLWebBrowserCtrlObserver -{ -public: - LLPanelAvatarWeb(LLPanelAvatar* panel_avatar); - /*virtual*/ ~LLPanelAvatarWeb(); - /*virtual*/ BOOL postBuild(void); + void setAvatarId(const LLUUID& avatar_id); - /*virtual*/ void refresh(); + const LLUUID& getAvatarId(){return mAvatarId;} - void enableControls(BOOL own_avatar); - - void setWebURL(std::string url); - - void load(std::string url); - static void onURLKeystroke(LLLineEditor* editor, void* data); - static void onCommitLoad(LLUICtrl* ctrl, void* data); - static void onCommitURL(LLUICtrl* ctrl, void* data); - static void onClickWebProfileHelp(void *); + virtual void updateData() = 0; + + virtual void onActivate(const LLUUID& id); - // browser observer impls - virtual void onStatusTextChange( const EventType& eventIn ); - virtual void onLocationChange( const EventType& eventIn ); + typedef enum e_profile_type + { + PT_UNKNOWN, + PT_OWN, + PT_OTHER + } EProfileType; -private: - std::string mHome; - std::string mNavigateTo; - LLWebBrowserCtrl* mWebBrowser; -}; + virtual void onAddFriend(); + virtual void onIM(); -class LLPanelAvatarAdvanced : public LLPanelAvatarTab -{ -public: - LLPanelAvatarAdvanced(LLPanelAvatar* panel_avatar); + virtual void onTeleport(); - /*virtual*/ BOOL postBuild(void); + virtual void clear(){}; - void enableControls(BOOL own_avatar); - void setWantSkills(U32 want_to_mask, const std::string& want_to_text, - U32 skills_mask, const std::string& skills_text, - const std::string& languages_text); - void getWantSkills(U32* want_to_mask, std::string& want_to_text, - U32* skills_mask, std::string& skills_text, - std::string& languages_text); +protected: + virtual ~LLPanelProfileTab(); + void setProfileType(); -private: - S32 mWantToCount; - S32 mSkillsCount; - LLCheckBoxCtrl *mWantToCheck[8]; - LLLineEditor *mWantToEdit; - LLCheckBoxCtrl *mSkillsCheck[8]; - LLLineEditor *mSkillsEdit; +protected: + e_profile_type mProfileType; + LLUUID mAvatarId; }; - -class LLPanelAvatarNotes : public LLPanelAvatarTab +class LLPanelAvatarProfile + : public LLPanelProfileTab { public: - LLPanelAvatarNotes(LLPanelAvatar* panel_avatar); + LLPanelAvatarProfile(const LLUUID& avatar_id = LLUUID::null); + LLPanelAvatarProfile(const Params& params ); + ~LLPanelAvatarProfile(); + + static void* create(void* data); - /*virtual*/ BOOL postBuild(void); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); - /*virtual*/ void refresh(); + void updateData(); - void clearControls(); + void clear(); - static void onCommitNotes(LLUICtrl* field, void* userdata); -}; - - -class LLPanelAvatarClassified : public LLPanelAvatarTab -{ -public: - LLPanelAvatarClassified(LLPanelAvatar* panel_avatar); + virtual void clearControls(); /*virtual*/ BOOL postBuild(void); + void onOpen(const LLSD& key); - /*virtual*/ void refresh(); + void onAddFriendButtonClick(); - // If can close, return TRUE. If cannot close, pop save/discard dialog - // and return FALSE. - BOOL canClose(); + void onIMButtonClick(); - void apply(); + void onCallButtonClick(); - BOOL titleIsValid(); + void onTeleportButtonClick(); - // Delete all the classified sub-panels from the tab container - void deleteClassifiedPanels(); - - // Unpack the outline of classified for this avatar (count, names, but not - // actual data). - void processAvatarClassifiedReply(LLMessageSystem* msg, void**); + void onShareButtonClick(); private: - static void onClickNew(void* data); - static void onClickDelete(void* data); - - bool callbackDelete(const LLSD& notification, const LLSD& response); - bool callbackNew(const LLSD& notification, const LLSD& response); -}; - - -class LLPanelAvatarPicks : public LLPanelAvatarTab -{ -public: - LLPanelAvatarPicks(LLPanelAvatar* panel_avatar); + bool isOwnProfile(){return PT_OWN == mProfileType;} + bool isEditMode(){return mEditMode;} + void updateChildrenList(); + void onStatusChanged(); + void onStatusMessageChanged(); + void setCaptionText(const LLAvatarData* avatar_data); + void scrollToTop(); - /*virtual*/ BOOL postBuild(void); - /*virtual*/ void refresh(); - - // Delete all the pick sub-panels from the tab container - void deletePickPanels(); - - // Unpack the outline of picks for this avatar (count, names, but not - // actual data). - void processAvatarPicksReply(LLMessageSystem* msg, void**); - void processAvatarClassifiedReply(LLMessageSystem* msg, void**); +protected: + bool mEditMode; private: - static void onClickNew(void* data); - static void onClickDelete(void* data); - - bool callbackDelete(const LLSD& notification, const LLSD& response); + bool mUpdated; + LLComboBox * mStatusCombobox; + LLLineEditor * mStatusMessage; }; -class LLPanelAvatar : public LLPanel, public LLAvatarPropertiesObserver +class LLPanelAvatarNotes + : public LLPanelProfileTab { public: - LLPanelAvatar(BOOL allow_edit); - /*virtual*/ ~LLPanelAvatar(); + LLPanelAvatarNotes(const LLUUID& id = LLUUID::null); + LLPanelAvatarNotes(const Params& params ); + ~LLPanelAvatarNotes(); - /*virtual*/ BOOL postBuild(void); + static void* create(void* data); - // If can close, return TRUE. If cannot close, pop save/discard dialog - // and return FALSE. - BOOL canClose(); + BOOL postBuild(void); - void setAvatar(LLViewerObject *avatarp); + void onCommitRights(); - // Fill in the avatar ID and handle some field fill-in, as well as - // button enablement. - // Pass one of the ONLINE_STATUS_foo constants above. - void setAvatarID(const LLUUID &avatar_id, const std::string &name, EOnlineStatus online_status); + void onCommitNotes(); - void setOnlineStatus(EOnlineStatus online_status); + void clear(); - const LLUUID& getAvatarID() const { return mAvatarID; } - - void resetGroupList(); + void processProperties(void* data, EAvatarProcessorType type); - void sendAvatarStatisticsRequest(); + void updateData(); - void sendAvatarPropertiesRequest(); - void sendAvatarPropertiesUpdate(); - - void sendAvatarNotesRequest(); - void sendAvatarNotesUpdate(); - - void sendAvatarPicksRequest(); - - void selectTab(S32 tabnum); - void selectTabByName(std::string tab_name); - - BOOL haveData() { return mHaveProperties && mHaveStatistics; } - BOOL isEditable() const { return mAllowEdit; } - - // LLAvatarPropertiesProcessor observer trigger - virtual void processAvatarProperties(const LLAvatarData& avatar_data); - - static void processAvatarInterestsReply(LLMessageSystem *msg, void **); - static void processAvatarGroupsReply(LLMessageSystem* msg, void**); - static void processAvatarNotesReply(LLMessageSystem *msg, void **); - static void processAvatarPicksReply(LLMessageSystem *msg, void **); - static void processAvatarClassifiedReply(LLMessageSystem *msg, void **); - - static void onClickTrack( void *userdata); - static void onClickIM( void *userdata); - static void onClickOfferTeleport( void *userdata); - static void onClickPay( void *userdata); - static void onClickAddFriend(void* userdata); - static void onClickOK( void *userdata); - static void onClickCancel( void *userdata); - static void onClickKick( void *userdata); - static void onClickFreeze( void *userdata); - static void onClickUnfreeze(void *userdata); - static void onClickCSR( void *userdata); - static void onClickMute( void *userdata); - -private: - void enableOKIfReady(); - - static bool finishKick(const LLSD& notification, const LLSD& response); - static bool finishFreeze(const LLSD& notification, const LLSD& response); - static bool finishUnfreeze(const LLSD& notification, const LLSD& response); - - static void showProfileCallback(S32 option, void *userdata); +protected: +}; - static void* createPanelAvatar(void* data); - static void* createFloaterAvatarInfo(void* data); - static void* createPanelAvatarSecondLife(void* data); - static void* createPanelAvatarWeb(void* data); - static void* createPanelAvatarInterests(void* data); - static void* createPanelAvatarPicks(void* data); - static void* createPanelAvatarClassified(void* data); - static void* createPanelAvatarFirstLife(void* data); - static void* createPanelAvatarNotes(void* data); -public: - LLPanelAvatarSecondLife* mPanelSecondLife; - LLPanelAvatarAdvanced* mPanelAdvanced; - LLPanelAvatarClassified* mPanelClassified; - LLPanelAvatarPicks* mPanelPicks; - LLPanelAvatarNotes* mPanelNotes; - LLPanelAvatarFirstLife* mPanelFirstLife; - LLPanelAvatarWeb* mPanelWeb; - - LLDropTarget* mDropTarget; - - // Teen users are not allowed to see or enter data into the first life page, - // or their own about/interests text entry fields. - static BOOL sAllowFirstLife; - -private: - LLUUID mAvatarID; // for which avatar is this window? - BOOL mIsFriend; // Are we friends? - BOOL mHaveProperties; - BOOL mHaveStatistics; - // only update note if data received from database and - // note is changed from database version - bool mHaveNotes; - std::string mLastNotes; - LLTabContainer* mTab; - BOOL mAllowEdit; - - typedef std::list<LLPanelAvatar*> panel_list_t; - static panel_list_t sAllPanels; -}; // helper funcs void add_left_label(LLPanel *panel, const std::string& name, S32 y); - #endif // LL_LLPANELAVATAR_H |