00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _POLICY_HOSTEDAVATAR_HH_
00017 #define _POLICY_HOSTEDAVATAR_HH_
00018
00019
00020 #include <vos/corelibs/vos/vos.hh>
00021 #include <vos/metaobjects/property/property.hh>
00022
00023 #if defined(_WIN32) && defined(_MSC_VER)
00024 # ifdef POLICY_EXPORTS
00025 # define POLICY_API __declspec(dllexport)
00026 # else
00027 # define POLICY_API __declspec(dllimport)
00028 # endif
00029 #else
00030 # define POLICY_API
00031 #endif
00032
00033 class POLICY_API HostedAvatarAccessControl
00034 {
00035 public:
00036 virtual ~HostedAvatarAccessControl() { };
00037 virtual bool checkRequestAvatarPermission(Vobject& requester, Vobject* suppliedavatar) = 0;
00038 };
00039
00040 class POLICY_API NoHostedAvatarAccessControl : public HostedAvatarAccessControl
00041 {
00042 public:
00043 static NoHostedAvatarAccessControl static_;
00044 virtual ~NoHostedAvatarAccessControl() { };
00045 virtual bool checkRequestAvatarPermission(Vobject& requester, Vobject* suppliedavatar) { return true; }
00046 };
00047
00048
00049
00050
00051
00052
00053
00054 class POLICY_API HostedAvatar : public virtual MetaObject {
00055
00056 protected:
00057 PropertyAccessControl* accessControl;
00058
00059
00060 public:
00061
00062
00063 HostedAvatar(MetaObject* superobject);
00064
00065
00066 virtual ~HostedAvatar();
00067
00068
00069 virtual const string getType();
00070
00071
00072 static void registerExtenders();
00073
00074
00075 virtual void setPropertyAccessControl(PropertyAccessControl* ac);
00076
00077
00078 virtual PropertyAccessControl* getPropertyAccessControl();
00079
00080
00081
00082
00083
00084
00085 virtual string getHostedAvatarIsRequired();
00086
00087
00088 virtual string getHostedAvatarIsRequiredDatatype();
00089
00090
00091
00092
00093
00094
00095 virtual void setHostedAvatarIsRequired(const string& value, const string& datatype = "?", PropertyAccessControl* ac = NULL);
00096
00097
00098 virtual Vobject* getHostedAvatarIsRequiredObject();
00099
00100
00101
00102 virtual void setHostedAvatarIsRequiredObject(Vobject* newobj);
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 virtual Vobject& doRequestAvatar(Vobject* myavatar) = 0;
00113
00114
00115 };
00116
00117
00118
00119 class POLICY_API LocalHostedAvatar : public virtual HostedAvatar {
00120 protected:
00121 HostedAvatarAccessControl* hostedavatarAC;
00122 public:
00123
00124
00125 LocalHostedAvatar(MetaObject* superobject);
00126
00127
00128 ~LocalHostedAvatar();
00129
00130
00131 virtual void initialize(PropertyAccessControl* ac);
00132
00133
00134
00135
00136
00137
00138 virtual void initialize();
00139
00140
00141 static MetaObject* new_LocalHostedAvatar(MetaObject* superobject, const string& type);
00142
00143
00144
00145
00146
00147 virtual Vobject& doRequestAvatar(Vobject* myavatar);
00148
00149
00150
00151 virtual void setHostedAvatarAccessControl(HostedAvatarAccessControl* haac) { hostedavatarAC = haac; }
00152 virtual HostedAvatarAccessControl* getHostedAvatarAccessControl() { return hostedavatarAC; }
00153
00154 protected:
00155
00156
00157
00158
00159
00160 virtual void handleRequestAvatar(Message* m);
00161
00162
00163
00164
00165 };
00166
00167
00168
00169 class POLICY_API RemoteHostedAvatar : public virtual HostedAvatar {
00170
00171 public:
00172
00173
00174 RemoteHostedAvatar(MetaObject* superobject);
00175
00176
00177 virtual ~RemoteHostedAvatar();
00178
00179
00180 static MetaObject* new_RemoteHostedAvatar(MetaObject* superobject, const string& type);
00181
00182
00183
00184
00185
00186 virtual Vobject& doRequestAvatar(Vobject* myavatar);
00187
00188
00189
00190
00191
00192 protected:
00193
00194
00195
00196
00197
00198 virtual void handleRequestAvatarReply(Message* m);
00199
00200
00201
00202 };
00203
00204
00205 #endif // #ifndef _POLICY_HOSTEDAVATAR_HH_
00206