Informant.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005 Palmsource, Inc.
00003  * 
00004  * This software is licensed as described in the file LICENSE, which
00005  * you should have received as part of this distribution. The terms
00006  * are also available at http://www.openbinder.org/license.html.
00007  * 
00008  * This software consists of voluntary contributions made by many
00009  * individuals. For the exact contribution history, see the revision
00010  * history and logs, available at http://www.openbinder.org
00011  */
00012 
00013 #ifndef _SERVICES_INFORMANT_H
00014 #define _SERVICES_INFORMANT_H
00015 
00016 #include <services/IInformant.h>
00017 #include <support/Locker.h>
00018 #include <support/Handler.h>
00019 
00020 #if _SUPPORTS_NAMESPACE
00021 using namespace palmos::support;
00022 using namespace palmos::services;
00023 #endif
00024 
00025 struct _InformantData;
00026 
00027 
00036 class BInformant : public BnInformant, public BHandler
00037 {
00038 public:
00039 
00040                         BInformant();
00041                         BInformant(const SContext& context);
00042     
00051     virtual status_t    RegisterForCallback(    const SValue &key,
00052                                                 const sptr<IBinder>& target,
00053                                                 const SValue &method,
00054                                                 uint32_t flags = 0,
00055                                                 const SValue &cookie = B_UNDEFINED_VALUE);
00056     
00070     virtual status_t    RegisterForCreation(    const SValue &key,
00071                                                 const sptr<INode>& context,
00072                                                 const sptr<IProcess>& process,
00073                                                 const SString &component,
00074                                                 const SValue &interface,
00075                                                 const SValue &method,
00076                                                 uint32_t flags,
00077                                                 const SValue &cookie);
00078     
00079     virtual status_t    UnregisterForCallback(  const SValue &key,
00080                                                 const sptr<IBinder>& target,
00081                                                 const SValue &method,
00082                                                 uint32_t flags);
00083                                                 
00084     virtual status_t    UnregisterForCreation(  const SValue &key,
00085                                                 const sptr<INode>& context,
00086                                                 const sptr<IProcess>& process,
00087                                                 const SString &component,
00088                                                 const SValue &inspect,
00089                                                 const SValue &method,
00090                                                 uint32_t flags);
00091     
00092 protected:
00094     virtual status_t    Inform(const SValue &key, const SValue &information);
00095 
00096 
00097     // no user servicable parts below
00098     virtual             ~BInformant();
00099     
00100     virtual void        InitAtom();
00101     virtual status_t    FinishAtom(const void *id);
00102             
00103 public: // so as to not have friends, don't use this
00104     virtual status_t    HandleMessage(const SMessage &msg);
00105 
00106 private:
00107     explicit BInformant(const BInformant &); // unimplemented
00108     
00109     _InformantData * m_data;
00110 };
00111 
00112 
00113 #endif // _SERVICES_INFORMANT_H
00114