00001
00002
00003
00004
00005 #ifndef SUPPORT_ICATALOG_H
00006 #define SUPPORT_ICATALOG_H
00007
00008 #include <support/IInterface.h>
00009 #include <support/Binder.h>
00010 #include <support/Context.h>
00011 #include <support/String.h>
00012
00013
00014
00015
00016
00017
00023 #include <support/IDatum.h>
00024 #include <support/INode.h>
00025
00026
00027
00028 #if _SUPPORTS_NAMESPACE
00029 namespace palmos {
00030 namespace support {
00031 #endif
00032
00034
00059 class ICatalog : public IInterface
00060 {
00061 public:
00062 B_DECLARE_META_INTERFACE(Catalog)
00063
00064
00065
00066
00067
00068
00101 virtual status_t AddEntry(const SString& name, const SValue& entry) = 0;
00102
00104
00109 virtual status_t RemoveEntry(const SString& name) = 0;
00110
00112
00120 virtual status_t RenameEntry(const SString& entry, const SString& name) = 0;
00121
00123
00160 virtual sptr<INode> CreateNode(SString* name, status_t* err) = 0;
00161
00163
00181 virtual sptr<IDatum> CreateDatum(SString* name, uint32_t flags, status_t* err) = 0;
00182
00183
00184 status_t LinkCatalog(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00185 {
00186 return AsBinder()->Link(to, mappings, flags);
00187 }
00188 status_t UnlinkCatalog(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00189 {
00190 return AsBinder()->Unlink(to, mappings, flags);
00191 }
00192
00193 protected:
00194 ICatalog() { }
00195 virtual ~ICatalog();
00196
00197 private:
00198
00199 ICatalog(const ICatalog& o);
00200 ICatalog& operator=(const ICatalog& o);
00201 };
00202
00203
00204
00205
00206 class BnCatalog : public ICatalog, public BBinder
00207 {
00208 public:
00209 virtual SValue Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00210 virtual sptr<IInterface> InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00211
00212 protected:
00213 BnCatalog();
00214 BnCatalog(const SContext& context);
00215 virtual ~BnCatalog();
00216
00217 virtual sptr<IBinder> AsBinderImpl();
00218 virtual sptr<const IBinder> AsBinderImpl() const;
00219
00220
00221 virtual status_t HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00222 virtual status_t Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00223
00224 private:
00225 BnCatalog(const BnCatalog& o);
00226 BnCatalog& operator=(const BnCatalog& o);
00227 };
00228
00229
00230 #if _SUPPORTS_NAMESPACE
00231 } }
00232 #endif
00233
00234
00235
00236
00237 #endif // SUPPORT_ICATALOG_H
00238