diff options
Diffstat (limited to 'indra/newview/llpanelavatar.h')
-rw-r--r-- | indra/newview/llpanelavatar.h | 204 |
1 files changed, 133 insertions, 71 deletions
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 2b0fbaf193..a6cf2a2d27 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -45,137 +45,199 @@ enum EOnlineStatus ONLINE_STATUS_YES = 1 }; - -class LLPanelProfileTab +/** +* Base class for any Profile View or Me Profile Panel. +*/ +class LLPanelProfileTab : public LLPanel , public LLAvatarPropertiesObserver { public: - - LLPanelProfileTab(const LLUUID& avatar_id); - LLPanelProfileTab(const Params& params ); - void setAvatarId(const LLUUID& avatar_id); + /** + * Sets avatar ID, sets panel as observer of avatar related info replies from server. + */ + virtual void setAvatarId(const LLUUID& id); - const LLUUID& getAvatarId(){return mAvatarId;} + /** + * Returns avatar ID. + */ + virtual const LLUUID& getAvatarId() { return mAvatarId; } + /** + * Sends update data request to server. + */ virtual void updateData() = 0; + /** + * Clears panel data if viewing avatar info for first time and sends update data request. + */ virtual void onOpen(const LLSD& key); - virtual void onActivate(const LLUUID& id); + /** + * Resets controls visibility, state, etc. + */ + virtual void resetControls(){}; - typedef enum e_profile_type - { - PT_UNKNOWN, - PT_OWN, - PT_OTHER - } EProfileType; + /** + * Clears all data received from server. + */ + virtual void resetData(){}; - virtual void onAddFriend(); + /*virtual*/ ~LLPanelProfileTab(); - virtual void onIM(); - - virtual void onTeleport(); +protected: - virtual void clear(){}; + LLPanelProfileTab(); -protected: - virtual ~LLPanelProfileTab(); - void setProfileType(); + /** + * Scrolls panel to top when viewing avatar info for first time. + */ + void scrollToTop(); private: - void scrollToTop(); -protected: - e_profile_type mProfileType; LLUUID mAvatarId; }; -class LLPanelAvatarProfile +/** +* Panel for displaying Avatar's first and second life related info. +*/ +class LLPanelAvatarProfile : public LLPanelProfileTab { public: - LLPanelAvatarProfile(const LLUUID& avatar_id = LLUUID::null); - LLPanelAvatarProfile(const Params& params ); - ~LLPanelAvatarProfile(); - - static void* create(void* data); + LLPanelAvatarProfile(); + + /*virtual*/ void onOpen(const LLSD& key); + /** + * Processes data received from server. + */ /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); - void updateData(); + /*virtual*/ BOOL postBuild(); - void clear(); + /*virtual*/ void updateData(); - virtual void clearControls(); + /*virtual*/ void resetControls(); - /*virtual*/ BOOL postBuild(void); - /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void resetData(); -private: - bool isOwnProfile(){return PT_OWN == mProfileType;} - bool isEditMode(){return mEditMode;} - void updateChildrenList(); - void onStatusChanged(); - void onStatusMessageChanged(); - void setCaptionText(const LLAvatarData* avatar_data); +protected: - static void onUrlTextboxClicked(std::string url); - void onHomepageTextboxClicked(); - void onUpdateAccountTextboxClicked(); - void onMyAccountTextboxClicked(); - void onPartnerEditTextboxClicked(); + /** + * Process profile related data received from server. + */ + virtual void processProfileProperties(const LLAvatarData* avatar_data); + + /** + * Processes group related data received from server. + */ + virtual void processGroupProperties(const LLAvatarGroups* avatar_groups); + + /** + * Fills common for Avatar profile and Me Profile fields. + */ + virtual void fillCommonData(const LLAvatarData* avatar_data); + + /** + * Fills partner data. + */ + virtual void fillPartnerData(const LLAvatarData* avatar_data); + + /** + * Fills Avatar's online status. + */ + virtual void fillOnlineStatus(const LLAvatarData* avatar_data); + + /** + * Fills account status. + */ + virtual void fillAccountStatus(const LLAvatarData* avatar_data); + void onUrlTextboxClicked(std::string url); + void onHomepageTextboxClicked(); void onAddFriendButtonClick(); void onIMButtonClick(); void onCallButtonClick(); void onTeleportButtonClick(); void onShareButtonClick(); +}; + +/** + * Panel for displaying own first and second life related info. + */ +class LLPanelAvatarMeProfile + : public LLPanelAvatarProfile +{ +public: + LLPanelAvatarMeProfile(); + + /*virtual*/ BOOL postBuild(); + +protected: + + /*virtual*/ void onOpen(const LLSD& key); + + /*virtual*/ void processProfileProperties(const LLAvatarData* avatar_data); + /** + * Fills Avatar status data. + */ + virtual void fillStatusData(const LLAvatarData* avatar_data); + + /*virtual*/ void resetControls(); protected: - bool mEditMode; + + void onStatusChanged(); + void onStatusMessageChanged(); + void onUpdateAccountTextboxClicked(); + void onMyAccountTextboxClicked(); + void onPartnerEditTextboxClicked(); private: - bool mUpdated; - LLComboBox * mStatusCombobox; - LLLineEditor * mStatusMessage; -}; + LLComboBox* mStatusCombobox; +}; +/** +* Panel for displaying Avatar's notes and modifying friend's rights. +*/ class LLPanelAvatarNotes : public LLPanelProfileTab { public: - LLPanelAvatarNotes(const LLUUID& id = LLUUID::null); - LLPanelAvatarNotes(const Params& params ); - ~LLPanelAvatarNotes(); + LLPanelAvatarNotes(); - static void* create(void* data); + /*virtual*/ void onOpen(const LLSD& key); - void onActivate(const LLUUID& id); + /*virtual*/ BOOL postBuild(); - BOOL postBuild(void); + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); - void onCommitRights(); + /*virtual*/ void updateData(); - void onCommitNotes(); +protected: - void clear(); + /*virtual*/ void resetControls(); - void processProperties(void* data, EAvatarProcessorType type); + /*virtual*/ void resetData(); - void updateData(); + /** + * Fills rights data for friends. + */ + void fillRightsData(); -protected: + void onCommitRights(); + void onCommitNotes(); - void updateChildrenList(); + void onAddFriendButtonClick(); + void onIMButtonClick(); + void onCallButtonClick(); + void onTeleportButtonClick(); + void onShareButtonClick(); }; - - -// helper funcs -void add_left_label(LLPanel *panel, const std::string& name, S32 y); - #endif // LL_LLPANELAVATAR_H |