icalmapi.i 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. %module icalmapi
  2. %{
  3. #include "ICalToMAPI.h"
  4. #include "MAPIToICal.h"
  5. #include <mapitovcf.hpp>
  6. #include <vcftomapi.hpp>
  7. %}
  8. %include "std_string.i"
  9. %include "cstring.i"
  10. %include <kopano/typemap.i>
  11. // Create class output parameters (both conversions)
  12. %typemap(in,numinputs=0) (ICALMAPICLASS **) ($basetype *temp) {
  13. temp = NULL;
  14. $1 = &temp;
  15. }
  16. %typemap(argout) (ICALMAPICLASS **) {
  17. %append_output(SWIG_NewPointerObj((void*)*($1), $*1_descriptor, SWIG_SHADOW | SWIG_OWNER));
  18. }
  19. %apply ICALMAPICLASS **{ KC::ICalToMapi **, KC::MapiToICal **};
  20. %apply ICALMAPICLASS **{ KC::vcftomapi **, KC::mapitovcf **};
  21. /* GetItemInfo output parameters */
  22. %typemap(in,numinputs=0) (eIcalType *) (eIcalType temp) {
  23. $1 = &temp;
  24. }
  25. %typemap(argout) eIcalType* value {
  26. %append_output(SWIG_From_long(*$1));
  27. }
  28. %typemap(in,numinputs=0) (time_t *) (time_t temp) {
  29. $1 = &temp;
  30. }
  31. %typemap(argout) time_t* value {
  32. %append_output(SWIG_From_long(*$1));
  33. }
  34. %typemap(in,numinputs=0) (SBinary *) (SBinary temp) {
  35. $1 = &temp;
  36. }
  37. %typemap(argout,fragment="SWIG_FromCharPtrAndSize") (SBinary* ) {
  38. %append_output(SWIG_FromCharPtrAndSize((const char *)$1->lpb, $1->cb));
  39. }
  40. /* Finalize output parameters */
  41. %typemap(in,numinputs=0) (std::string *) (std::string temp) {
  42. $1 = &temp;
  43. }
  44. %typemap(argout) (std::string *) {
  45. /* @todo fix this not to go through a cstring */
  46. %append_output(SWIG_FromCharPtrAndSize($1->c_str(), $1->length()));
  47. }
  48. /* defines for the eIcalType */
  49. #define VEVENT 0
  50. #define VTODO 1
  51. #define VJOURNAL 2
  52. /* let swig know this is the same, so it cat get the conversion stuff from typemap.i */
  53. typedef IAddrBook* LPADRBOOK;
  54. typedef IMessage* LPMESSAGE;
  55. %include <kopano/zcdefs.h>
  56. %include "ICalToMAPI.h"
  57. %include "MAPIToICal.h"
  58. %include <mapitovcf.hpp>
  59. %include <vcftomapi.hpp>