IInstallHandler.h

Go to the documentation of this file.
00001 /*========================================================== */ 
00002 // header file automatically generated by PIDGEN - DO NOT MODIFY
00003 /*========================================================== */ 
00004 
00005 #ifndef PACKAGE_IINSTALLHANDLER_H
00006 #define PACKAGE_IINSTALLHANDLER_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  */
00024 
00025 /* ============= Interface Class Declarations =========================== */
00026 
00027 #if _SUPPORTS_NAMESPACE
00028 namespace palmos {
00029 namespace package {
00030 using namespace palmos::support;
00031 #endif /* _SUPPORTS_NAMESPACE */
00032 
00033 class IInstallHandler : public IInterface
00034 {
00035 public:
00036     B_DECLARE_META_INTERFACE(InstallHandler)
00037     
00038     
00039     /* ------- enums/structs --------------------- */
00040     enum  {
00041         INSTALL=0,
00042         BOOT=1
00043     };
00044     
00045     
00046     /* ------- Methods ------------------------ */
00047     
00048     virtual void                    OnInstall(uint32_t which) = 0;
00049     
00050     /* ------- inline helpers ------------------------- */
00051     status_t LinkInstallHandler(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00052     {
00053         return AsBinder()->Link(to, mappings, flags);
00054     }
00055     status_t UnlinkInstallHandler(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00056     {
00057         return AsBinder()->Unlink(to, mappings, flags);
00058     }
00059 
00060 protected:
00061                                     IInstallHandler() { }
00062     virtual                         ~IInstallHandler();
00063 
00064 private:
00065     /* ------- copy/assignment protection ------------------ */
00066                                     IInstallHandler(const IInstallHandler& o);
00067             IInstallHandler&        operator=(const IInstallHandler& o);
00068 };
00069 
00070 
00071 /* ============= Local Class Declarations =============================== */
00072 
00073 class BnInstallHandler : public IInstallHandler, public BBinder
00074 {
00075 public:
00076     virtual SValue                  Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00077     virtual sptr<IInterface>        InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00078 
00079 protected:
00080                                     BnInstallHandler();
00081                                     BnInstallHandler(const SContext& context);
00082     virtual                         ~BnInstallHandler();
00083     
00084     virtual sptr<IBinder>           AsBinderImpl();
00085     virtual sptr<const IBinder>     AsBinderImpl() const;
00086     
00087     /* ------- Marshalling Details ------------ */
00088     virtual status_t                HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00089     virtual status_t                Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00090 
00091 private:
00092                                     BnInstallHandler(const BnInstallHandler& o);
00093             BnInstallHandler&       operator=(const BnInstallHandler& o);
00094 };
00095 
00096 
00097 #if _SUPPORTS_NAMESPACE
00098 } } // namespace palmos::package
00099 #endif /* _SUPPORTS_NAMESPACE */
00100 
00101 
00102 // namespace palmos::package
00103 
00104 #endif // PACKAGE_IINSTALLHANDLER_H
00105