lluserrelations.h

Go to the documentation of this file.
00001 
00034 #ifndef LL_LLUSERRELAIONS_H
00035 #define LL_LLUSERRELAIONS_H
00036 
00037 #include <map>
00038 #include "lluuid.h"
00039 
00052 class LLRelationship
00053 {
00054 public:
00058         LLRelationship();
00059         LLRelationship(S32 grant_to, S32 grant_from, bool is_online);
00060         
00061         static const LLRelationship DEFAULT_RELATIONSHIP;
00062 
00084         bool isOnline() const;
00085 
00093         void online(bool is_online);
00095 
00096         /* @name Granted rights
00097          */
00099 
00102         enum
00103         {
00104                 GRANT_NONE = 0x0,
00105                 GRANT_ONLINE_STATUS = 0x1,
00106                 GRANT_MAP_LOCATION = 0x2,
00107                 GRANT_MODIFY_OBJECTS = 0x4,
00108         };
00109 
00113         static const U8 GRANTED_VISIBLE_MASK;
00114 
00121         bool isRightGrantedTo(S32 rights) const;
00122 
00129         bool isRightGrantedFrom(S32 rights) const;
00130 
00136         S32 getRightsGrantedTo() const;
00137 
00143         S32 getRightsGrantedFrom() const;
00144 
00145         void setRightsTo(S32 to_agent) { mGrantToAgent = to_agent; mChangeSerialNum++; }
00146         void setRightsFrom(S32 from_agent) { mGrantFromAgent = from_agent; mChangeSerialNum++;}
00147 
00156         S32 getChangeSerialNum() const { return mChangeSerialNum; }
00157 
00167         void grantRights(S32 to_agent, S32 from_agent);
00168         
00178         void revokeRights(S32 to_agent, S32 from_agent);
00180 
00181 protected:
00182         S32 mGrantToAgent;
00183         S32 mGrantFromAgent;
00184         S32 mChangeSerialNum;
00185         bool mIsOnline;
00186 };
00187 
00188 #endif // LL_LLUSERRELAIONS_H

Generated on Fri May 16 08:32:14 2008 for SecondLife by  doxygen 1.5.5