include/alp/postal_types.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * Copyright (c) 1999-2008 ACCESS CO., LTD. All rights reserved.
00003  * Copyright (c) 2006 PalmSource, Inc (an ACCESS company). All rights reserved.
00004  *****************************************************************************/
00018 #ifndef POSTAL_TYPES_H
00019 #define POSTAL_TYPES_H
00020 
00021 /******************************************************************************
00022  * Includes
00023  *****************************************************************************/
00024 
00025 #ifdef ALP_BUILD
00026 
00027 /* for size_t */
00028 #include <stdlib.h>
00029 /* for < typedef uint32_t alp_status_t > and < #define ALP_STATUS_OK 0 > */
00030 #include <alp/types.h>
00031 /* for < #define ALP_CLASS_POSTAL 0xXXXXXXXXX> System component identifier for postal traces and status */
00032 #include <alp/sysclass.h>
00033 
00034 #else // ACS
00035 
00036 /* for < #define ALP_CLASS_POSTAL   0xXXXXXXXXX> System component identifier for postal traces and status */
00037 #include <nmcs_alp_sysclass.h>
00038 #include <nmcs_alp_types.h>
00039 
00040 #endif // ALP_BUILD
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif /* __cplusplus */
00045 
00046 
00047 /******************************************************************************
00048  * Defines
00049  *****************************************************************************/
00050 
00052 typedef uint32_t alp_postal_object_id_t;
00053 
00055 #define ALP_POSTAL_INVALID_OBJECT_ID    0
00056 
00057 typedef int32_t alp_postal_time_t;
00058 
00059 // Common types
00060 
00061 typedef uint8_t alp_postal_number_id_t;
00062 
00067 typedef void* alp_postal_context_t;
00068 
00070 #define POSTAL_DEFAULT_CONTEXT NULL
00071 
00072 /* @}*/
00073 
00079 typedef uint8_t         alp_postal_service_id_t;
00080 
00082 typedef uint8_t         alp_postal_service_class_id_t;
00083 
00085 typedef struct _AlpPostalServiceIdList  AlpPostalServiceIdList;
00086 
00088 struct _AlpPostalServiceIdList
00089 {
00090         alp_postal_service_id_t*        serviceIdListP;         
00091         uint32_t                        count;                  
00092 };
00093 
00095 typedef struct _AlpPostalServiceAddressSchemeList       AlpPostalServiceAddressSchemeList;
00096 
00098 struct _AlpPostalServiceAddressSchemeList
00099 {
00100         char**          serviceAddressSchemeListPP;     
00101         uint32_t        count;                                          
00102 };
00103 
00104 /* @} */
00105 
00111 typedef alp_postal_object_id_t alp_postal_session_id_t;
00112 
00114 typedef struct _AlpPostalSessionIdList  AlpPostalSessionIdList;
00115 
00117 struct _AlpPostalSessionIdList
00118 {
00119         alp_postal_session_id_t*        sessionIdListP;         
00120         uint32_t                        count;                  
00121 };
00122 /* @} */
00123 
00130 typedef struct _AlpPostalEnvelope AlpPostalEnvelope; // declared here to avoid multiple definitions
00131 
00133 typedef alp_postal_object_id_t alp_postal_envelope_id_t;
00134 
00135 // postal folder related types
00137 typedef alp_postal_object_id_t alp_postal_folder_id_t;
00138 
00139 // postal account related types
00141 typedef alp_postal_object_id_t alp_postal_account_id_t;
00142 
00144 typedef struct _AlpPostalAccountIdList  AlpPostalAccountIdList;
00145 
00146 // postal rule related types
00148 typedef alp_postal_object_id_t alp_postal_rule_id_t;
00149 
00151 typedef uint32_t        alp_postal_property_id_t;
00152 
00154 struct _AlpPostalAccountIdList
00155 {
00156         alp_postal_account_id_t*        accountIdListP;         
00157         uint32_t                        count;                  
00158 };
00159 /* @} */
00160 
00162 typedef struct _AlpPostalProperty AlpPostalProperty;
00163 
00165 struct _AlpPostalProperty
00166 {
00167         AlpPostalProperty*              itsNext;
00168         AlpPostalProperty*              itsPrev;
00169         alp_postal_property_id_t        id;             
00170         uint16_t                        size;           
00172         union
00173         {
00174                 uint32_t                asInteger;      
00175                 bool                    asBool;         
00176                 alp_postal_time_t       asDate;         
00177                 char                    asString[1];    
00178                 uint8_t                 asBinary[1];    
00179         } value;
00180 };
00181 
00182 
00184 typedef struct _AlpPostalPropertyList AlpPostalPropertyList;
00185 
00187 struct _AlpPostalPropertyList {         
00188         AlpPostalProperty*      itsHead;        
00189         AlpPostalProperty*      itsTail;        
00190 };
00191 
00192 typedef struct _AlpPostalPropertyContainer AlpPostalPropertyContainer;
00193 
00194 typedef struct _AlpPostalPropertyContainerList AlpPostalPropertyContainerList;
00195 
00196 struct _AlpPostalPropertyContainerList {
00197         AlpPostalPropertyContainer* itsHead;
00198         AlpPostalPropertyContainer* itsTail;
00199 };
00200 
00201 struct _AlpPostalPropertyContainer {
00202         AlpPostalPropertyContainer*     itsNext;
00203         AlpPostalPropertyContainer*     itsPrev;
00204         AlpPostalPropertyList           propertyList;           
00208         AlpPostalPropertyContainerList containerList;                                   
00209 };
00210 
00211 
00212 
00218 typedef struct _AlpPostalEnumerator AlpPostalEnumerator;
00219 
00221 struct _AlpPostalEnumerator { 
00222         void*                           sqlStmtPtr;
00223         void*                           objectList; // depend of enumerator, envelope enum will store an envelope list, folder enum will store a folder list which is a propList
00224         void*                           currentNode; // depend of enumeratoro
00225         alp_postal_service_id_t         serviceId; // set to servceiId on get_xxx_enumerator and used by get_next and release
00226         alp_postal_session_id_t         sessionId; // set to sessionId on get_xxx_enumerator and used by get_next and release
00227         int                             currentIndex; // global index 0 based
00228         int                             currentOffset; // offset used the last time cache has been filled on client side.
00229         // [currentOffset, currentOffset+currentCacheSize] are the index accessible in cache on client side.
00230         int                             currentCacheSize; // number of object in objectList on client side
00231         int                             dbCacheSize; // cache to use on db size, 0 to use default
00232         int                             elemCount; // total number of object returned by the query
00233         int                             gotoIndex; // index that will be filled on gotoIndex. currentIndex will be equal to gotoIndex if get_next call after goto_index succeeds.
00234 };
00235 /* @} */
00236 
00242 typedef struct _AlpPostalPropertyContainer AlpPostalAddress;
00243 
00244 typedef struct _AlpPostalPropertyContainer AlpPostalAddressContainer;
00245 
00246 typedef struct _AlpPostalPropertyContainerList AlpPostalAddressContainerList;
00247 /* @} */
00248 
00255 typedef alp_postal_object_id_t alp_postal_log_id_t;
00256 
00257 /* @} */
00258 
00259 #ifdef __cplusplus
00260 }
00261 #endif /* __cplusplus */
00262 
00263 #endif // POSTAL_TYPES_H
00264 

Generated on Wed Jul 30 07:06:39 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.