INode.h

Go to the documentation of this file.
00001 /*========================================================== */ 
00002 // header file automatically generated by PIDGEN - DO NOT MODIFY
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  * Copyright (c) 2005 Palmsource, Inc.
00015  * 
00016  * This software is licensed as described in the file LICENSE, which
00017  * you should have received as part of this distribution. The terms
00018  * are also available at http://www.openbinder.org/license.html.
00019  * 
00020  * This software consists of voluntary contributions made by many
00021  * individuals. For the exact contribution history, see the revision
00022  * history and logs, available at http://www.openbinder.org
00023  */
00030 /* ============= Interface Class Declarations =========================== */
00031 
00032 #if _SUPPORTS_NAMESPACE
00033 namespace palmos {
00034 namespace support {
00035 #endif /* _SUPPORTS_NAMESPACE */
00036 
00038 
00050 class INode : public IInterface
00051 {
00052 public:
00053     B_DECLARE_META_INTERFACE(Node)
00054     
00055     
00056     /* ------- enums/structs --------------------- */
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     /* ------- Properties --------------------- */
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     /* ------- Methods ------------------------ */
00147     
00149 
00251     virtual status_t                Walk(SString* path, uint32_t flags, SValue* node) = 0;
00252     
00253     /* ------- Events ------------------------ */
00254     
00275     /* ------- inline helpers ------------------------- */
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     /* ------- copy/assignment protection ------------------ */
00291                                     INode(const INode& o);
00292             INode&                  operator=(const INode& o);
00293 };
00294 
00295 
00296 /* ============= Local Class Declarations =============================== */
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     /* ------- Events ------------------------- */
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     /* ------- Push Properties ---------------- */
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     /* ------- Marshalling Details ------------ */
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 } } // namespace palmos::support
00399 #endif /* _SUPPORTS_NAMESPACE */
00400 
00401 
00402 // namespace palmos::support
00403 
00404 #endif // SUPPORT_INODE_H
00405