INodeObserver.h

Go to the documentation of this file.
00001 /*========================================================== */ 
00002 // header file automatically generated by PIDGEN - DO NOT MODIFY
00003 /*========================================================== */ 
00004 
00005 #ifndef SUPPORT_INODEOBSERVER_H
00006 #define SUPPORT_INODEOBSERVER_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  */
00029 #include <support/INode.h>
00030 
00031 /* ============= Interface Class Declarations =========================== */
00032 
00033 #if _SUPPORTS_NAMESPACE
00034 namespace palmos {
00035 namespace support {
00036 #endif /* _SUPPORTS_NAMESPACE */
00037 
00039 
00040 class INodeObserver : public IInterface
00041 {
00042 public:
00043     B_DECLARE_META_INTERFACE(NodeObserver)
00044     
00045     
00046     /* ------- Methods ------------------------ */
00047     
00048     
00049     virtual void                    NodeChanged(const sptr<INode>& who, uint32_t flags, const SValue& hints) = 0;
00050     
00052     virtual void                    EntryCreated(const sptr<INode>& node, const SString& name, const sptr<IBinder>& entry) = 0;
00053     
00055     virtual void                    EntryModified(const sptr<INode>& node, const SString& name, const sptr<IBinder>& entry) = 0;
00056     
00058     virtual void                    EntryRemoved(const sptr<INode>& node, const SString& name) = 0;
00059     
00061     virtual void                    EntryRenamed(const sptr<INode>& node, const SString& old_name, const SString& new_name, const sptr<IBinder>& entry) = 0;
00062     
00063     /* ------- inline helpers ------------------------- */
00064     status_t LinkNodeObserver(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00065     {
00066         return AsBinder()->Link(to, mappings, flags);
00067     }
00068     status_t UnlinkNodeObserver(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00069     {
00070         return AsBinder()->Unlink(to, mappings, flags);
00071     }
00072 
00073 protected:
00074                                     INodeObserver() { }
00075     virtual                         ~INodeObserver();
00076 
00077 private:
00078     /* ------- copy/assignment protection ------------------ */
00079                                     INodeObserver(const INodeObserver& o);
00080             INodeObserver&          operator=(const INodeObserver& o);
00081 };
00082 
00083 
00084 /* ============= Local Class Declarations =============================== */
00085 
00086 class BnNodeObserver : public INodeObserver, public BBinder
00087 {
00088 public:
00089     virtual SValue                  Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00090     virtual sptr<IInterface>        InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00091 
00092 protected:
00093                                     BnNodeObserver();
00094                                     BnNodeObserver(const SContext& context);
00095     virtual                         ~BnNodeObserver();
00096     
00097     virtual sptr<IBinder>           AsBinderImpl();
00098     virtual sptr<const IBinder>     AsBinderImpl() const;
00099     
00100     /* ------- Marshalling Details ------------ */
00101     virtual status_t                HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00102     virtual status_t                Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00103 
00104 private:
00105                                     BnNodeObserver(const BnNodeObserver& o);
00106             BnNodeObserver&         operator=(const BnNodeObserver& o);
00107 };
00108 
00109 
00110 #if _SUPPORTS_NAMESPACE
00111 } } // namespace palmos::support
00112 #endif /* _SUPPORTS_NAMESPACE */
00113 
00114 
00115 // namespace palmos::support
00116 
00117 #endif // SUPPORT_INODEOBSERVER_H
00118