ITable.h

Go to the documentation of this file.
00001 /*========================================================== */ 
00002 // header file automatically generated by PIDGEN - DO NOT MODIFY
00003 /*========================================================== */ 
00004 
00005 #ifndef SUPPORT_ITABLE_H
00006 #define SUPPORT_ITABLE_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 /* ============= Forward Declarations =========================== */
00031 
00032 #if _SUPPORTS_NAMESPACE
00033 namespace palmos {
00034 namespace support {
00035 #endif /* _SUPPORTS_NAMESPACE */
00036 
00037 class INode;
00038 
00039 /* ============= Interface Class Declarations =========================== */
00040 
00042 
00077 class ITable : public IInterface
00078 {
00079 public:
00080     B_DECLARE_META_INTERFACE(Table)
00081     
00082     
00083     /* ------- enums/structs --------------------- */
00085     enum  {
00087 
00094         CHANGE_DETAILS_SENT=0x0001
00095     };
00096     
00097     
00098     /* ------- Properties --------------------- */
00099     
00101 
00102     virtual SValue                  ColumnNames() const = 0;
00103     
00105 
00106     virtual SValue                  Schema() const = 0;
00107     
00108     /* ------- Methods ------------------------ */
00109     
00111 
00134     virtual status_t                CreateRow(SString* name, const SValue& columns, uint32_t flags = 0, sptr<INode>* createdRow = NULL) = 0;
00135     
00137 
00150     virtual status_t                RemoveRow(const sptr<INode>& row) = 0;
00151     
00153 
00168     virtual status_t                AddColumn(const SString& name, uint32_t typeCode, size_t maxSize, uint32_t flags, const SValue& extras) = 0;
00169     
00171 
00179     virtual status_t                RemoveColumn(const SString& name) = 0;
00180     
00181     /* ------- Events ------------------------ */
00182     
00191     /* ------- inline helpers ------------------------- */
00192     status_t LinkTable(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00193     {
00194         return AsBinder()->Link(to, mappings, flags);
00195     }
00196     status_t UnlinkTable(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00197     {
00198         return AsBinder()->Unlink(to, mappings, flags);
00199     }
00200 
00201 protected:
00202                                     ITable() { }
00203     virtual                         ~ITable();
00204 
00205 private:
00206     /* ------- copy/assignment protection ------------------ */
00207                                     ITable(const ITable& o);
00208             ITable&                 operator=(const ITable& o);
00209 };
00210 
00211 
00212 /* ============= Local Class Declarations =============================== */
00213 
00214 class BnTable : public ITable, public BBinder
00215 {
00216 public:
00217     virtual SValue                  Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00218     virtual sptr<IInterface>        InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00219     
00220     /* ------- Events ------------------------- */
00221 public:
00223 
00237             void                    PushTableChanged(const sptr<ITable>& who, uint32_t flags, const SValue& hints);
00239 
00250             void                    PushCellModified(const sptr<ITable>& who, const SString& row, const SString& column, const sptr<IBinder>& entry);
00251     
00252     /* ------- Push Properties ---------------- */
00253 public:
00254             void                    PushColumnNames(const SValue& value);
00255             void                    PushSchema(const SValue& value);
00256 
00257 protected:
00258                                     BnTable();
00259                                     BnTable(const SContext& context);
00260     virtual                         ~BnTable();
00261     
00262     virtual sptr<IBinder>           AsBinderImpl();
00263     virtual sptr<const IBinder>     AsBinderImpl() const;
00264     
00265     /* ------- Marshalling Details ------------ */
00266     virtual status_t                HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00267     virtual status_t                Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00268 
00269 private:
00270                                     BnTable(const BnTable& o);
00271             BnTable&                operator=(const BnTable& o);
00272 };
00273 
00274 
00275 #if _SUPPORTS_NAMESPACE
00276 } } // namespace palmos::support
00277 #endif /* _SUPPORTS_NAMESPACE */
00278 
00279 
00280 // namespace palmos::support
00281 
00282 #endif // SUPPORT_ITABLE_H
00283