00001
00002
00003
00004
00005 #ifndef SUPPORT_INODE_H
00006 #define SUPPORT_INODE_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
00018
00019
00020
00021
00022
00023
00030
00031
00032 #if _SUPPORTS_NAMESPACE
00033 namespace palmos {
00034 namespace support {
00035 #endif
00036
00038
00050 class INode : public IInterface
00051 {
00052 public:
00053 B_DECLARE_META_INTERFACE(Node)
00054
00055
00056
00058
00060 enum {
00062
00066 REQUEST_DATA=0x1000,
00068
00074 COLLAPSE_NODE=0x2000,
00075 COLLAPSE_CATALOG=0x2000,
00078
00084 IGNORE_PROJECTION=0x4000
00085 };
00086
00088
00091 enum {
00092 CREATE_DATUM=0x0100,
00094 CREATE_NODE=0x0200,
00096 CREATE_CATALOG=0x0200,
00098 CREATE_MASK=0x0300
00100 };
00101
00103 enum {
00105
00112 CHANGE_DETAILS_SENT=0x0001
00113 };
00114
00115
00116
00117
00119
00129 virtual sptr<INode> Attributes() const = 0;
00130
00132 virtual SString MimeType() const = 0;
00134 virtual void SetMimeType(const SString& value) = 0;
00135
00137 virtual nsecs_t CreationDate() const = 0;
00139 virtual void SetCreationDate(nsecs_t value) = 0;
00140
00142 virtual nsecs_t ModifiedDate() const = 0;
00144 virtual void SetModifiedDate(nsecs_t value) = 0;
00145
00146
00147
00149
00251 virtual status_t Walk(SString* path, uint32_t flags, SValue* node) = 0;
00252
00253
00254
00275
00276 status_t LinkNode(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00277 {
00278 return AsBinder()->Link(to, mappings, flags);
00279 }
00280 status_t UnlinkNode(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00281 {
00282 return AsBinder()->Unlink(to, mappings, flags);
00283 }
00284
00285 protected:
00286 INode() { }
00287 virtual ~INode();
00288
00289 private:
00290
00291 INode(const INode& o);
00292 INode& operator=(const INode& o);
00293 };
00294
00295
00296
00297
00298 class BnNode : public INode, public BBinder
00299 {
00300 public:
00301 virtual SValue Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00302 virtual sptr<IInterface> InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00303
00304
00305 public:
00307
00317 void PushNodeChanged(const sptr<INode>& who, uint32_t flags, const SValue& hints);
00319
00329 void PushEntryCreated(const sptr<INode>& who, const SString& name, const sptr<IBinder>& entry);
00331
00341 void PushEntryModified(const sptr<INode>& who, const SString& name, const sptr<IBinder>& entry);
00343
00353 void PushEntryRemoved(const sptr<INode>& who, const SString& name);
00355
00370 void PushEntryRenamed(const sptr<INode>& who, const SString& old_name, const SString& new_name, const sptr<IBinder>& entry);
00371
00372
00373 public:
00374 void PushAttributes(const sptr<INode>& value);
00375 void PushMimeType(const SString& value);
00376 void PushCreationDate(nsecs_t value);
00377 void PushModifiedDate(nsecs_t value);
00378
00379 protected:
00380 BnNode();
00381 BnNode(const SContext& context);
00382 virtual ~BnNode();
00383
00384 virtual sptr<IBinder> AsBinderImpl();
00385 virtual sptr<const IBinder> AsBinderImpl() const;
00386
00387
00388 virtual status_t HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00389 virtual status_t Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00390
00391 private:
00392 BnNode(const BnNode& o);
00393 BnNode& operator=(const BnNode& o);
00394 };
00395
00396
00397 #if _SUPPORTS_NAMESPACE
00398 } }
00399 #endif
00400
00401
00402
00403
00404 #endif // SUPPORT_INODE_H
00405