ISelector.h

Go to the documentation of this file.
00001 /*========================================================== */ 
00002 // header file automatically generated by PIDGEN - DO NOT MODIFY
00003 /*========================================================== */ 
00004 
00005 #ifndef SUPPORT_ISELECTOR_H
00006 #define SUPPORT_ISELECTOR_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 /* ============= Interface Class Declarations =========================== */
00030 
00031 #if _SUPPORTS_NAMESPACE
00032 namespace palmos {
00033 namespace support {
00034 #endif /* _SUPPORTS_NAMESPACE */
00035 
00037 
00038 class ISelector : public IInterface
00039 {
00040 public:
00041     B_DECLARE_META_INTERFACE(Selector)
00042     
00043     
00044     /* ------- Properties --------------------- */
00045     
00046     virtual SValue                  Value() const = 0;
00047     virtual void                    SetValue(const SValue& value) = 0;
00048     
00049     /* ------- Methods ------------------------ */
00050     
00051     virtual status_t                Register(const SValue& key, const sptr<IBinder>& binder, const SValue& property, uint32_t flags = 0) = 0;
00052     
00053     virtual status_t                Unregister(const SValue& key, const sptr<IBinder>& binder, const SValue& property, uint32_t flags = 0) = 0;
00054     
00055     /* ------- inline helpers ------------------------- */
00056     status_t LinkSelector(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00057     {
00058         return AsBinder()->Link(to, mappings, flags);
00059     }
00060     status_t UnlinkSelector(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00061     {
00062         return AsBinder()->Unlink(to, mappings, flags);
00063     }
00064 
00065 protected:
00066                                     ISelector() { }
00067     virtual                         ~ISelector();
00068 
00069 private:
00070     /* ------- copy/assignment protection ------------------ */
00071                                     ISelector(const ISelector& o);
00072             ISelector&              operator=(const ISelector& o);
00073 };
00074 
00075 
00076 /* ============= Local Class Declarations =============================== */
00077 
00078 class BnSelector : public ISelector, public BBinder
00079 {
00080 public:
00081     virtual SValue                  Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00082     virtual sptr<IInterface>        InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00083     
00084     /* ------- Push Properties ---------------- */
00085 public:
00086             void                    PushValue(const SValue& value);
00087 
00088 protected:
00089                                     BnSelector();
00090                                     BnSelector(const SContext& context);
00091     virtual                         ~BnSelector();
00092     
00093     virtual sptr<IBinder>           AsBinderImpl();
00094     virtual sptr<const IBinder>     AsBinderImpl() const;
00095     
00096     /* ------- Marshalling Details ------------ */
00097     virtual status_t                HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00098     virtual status_t                Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00099 
00100 private:
00101                                     BnSelector(const BnSelector& o);
00102             BnSelector&             operator=(const BnSelector& o);
00103 };
00104 
00105 
00106 #if _SUPPORTS_NAMESPACE
00107 } } // namespace palmos::support
00108 #endif /* _SUPPORTS_NAMESPACE */
00109 
00110 
00112 // namespace palmos::support
00113 
00114 #endif // SUPPORT_ISELECTOR_H
00115