home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / palmos / linkmaster-src-1.0.4.tar.gz / linkmaster-src-1.0.4.tar / linkmaster-1.0.4 / proxy / db / linkaware.h < prev    next >
C/C++ Source or Header  |  2000-10-21  |  5KB  |  128 lines

  1. /* linkaware.h
  2.    This file released to the public domain by Ben Darnell.
  3.    You may use this file however you wish to make
  4.    LinkMaster-compatible applications.
  5. */
  6. /* You may #define the following symbols to reduce the compiled size of
  7.    linkaware.c:
  8.    NO_LINKSIMPLE
  9.    NO_LINKCONTAINER
  10.    NO_LINKHISTORY
  11.    NO_LINKGLOBALS - removes a static variable from linkaware.c
  12. */
  13. #ifndef _linkaware_h
  14. #define _linkaware_h
  15.  
  16. /* All link-aware applications should include a resource of type
  17.    'Link', number 1, containing a character indicating what version
  18.    of the LinkMaster protocol the application implements.  For this
  19.    version, that character should be 'a'.
  20.  
  21.    If you are using the GNU tools, you can create this resource by
  22.    executing "echo a > Link0001.bin" and including Link0001.bin
  23.    in your build-prc command.
  24. */
  25.  
  26. typedef struct {
  27.    DWord creator;
  28.    Char data[60];
  29. } LinkInfoType;
  30. typedef LinkInfoType* LinkInfoPtr;
  31.  
  32.  
  33. #define linkAppLaunchRequestLink 0x8901
  34. /* Sending: An application should send this launch code to LinkMaster to
  35.    request a link.  The parameter block consists of one LinkInfoType
  36.    structure, which will be returned with the link.
  37.  
  38.    Recieving: LinkMaster will send this launch code to an application
  39.    when the user selects the application via the "New Link" command.
  40.    No parameters will be sent.  The application is not required to
  41.    behave specially in response to this launch code, but may for instance
  42.    open in an index mode instead of viewing the previously edited record.
  43. */
  44.  
  45. #define linkAppLaunchReturnLink 0x8902
  46. /* Sending: An application should send this launch code to LinkMaster after
  47.    the user has selected a record to link to.  This may be done at any time,
  48.    not just after recieving a linkAppLaunchRequestLink.  If there are no
  49.    pending link requests, the link will be added to a list within
  50.    LinkMaster.  The parameter block consists of one LinkInfoType structure
  51.    plus an optional null-terminated string, which may be used to identify
  52.    the link.
  53.  
  54.    Recieving: LinkMaster will send this launch code to an application which
  55.    has previously requested a link.  The parameter block consists of two
  56.    LinkInfoType structures - the one initially passed with
  57.    linkAppLaunchRequestLink, and the one selected by the user - and a null-
  58.    terminated string which identifies the link..
  59. */
  60.  
  61. #define linkAppLaunchFollowLink 0x8903
  62. /* NOTE: see linkAppLaunchFollowLinkSubCall below
  63.   Recieving: This code is sent to applications when the user follows
  64.   a link.  The parameter block consist of the LinkInfoType structure
  65.   that defines the link.  The application should display the record
  66.   indicated by the link.
  67. */
  68.  
  69. #define linkAppLaunchHistoryPush 0x8904
  70. /* Sending: An app passes a LinkInfoType structure to LinkMaster with
  71.    this launch code to have it put in the history list
  72. */
  73.  
  74. #define linkAppLaunchHistoryBack 0x8905
  75. #define linkAppLaunchHistoryForward 0x8906
  76. /* Sending: Send one of these to LinkMaster with no parameters to go to
  77.    the next or previous item in the history list
  78. */
  79.  
  80. #define linkAppLaunchFollowLinkSubCall 0x8907
  81. /* Recieving: An app recieves this launch code first  when the user follows
  82.    a link.  You should check to see if your globals are available
  83.    with sysAppLaunchFlagSubCall.  If they are (the flag is set), your app
  84.    is currently running and you should handle it in a similar way to
  85.    sysAppLaunchCmdGoTo (e.g. by posting a frmGotoEvent and exiting).
  86.    If not, you should switch to your app with SysUIAppSwitch, passing
  87.    linkAppLaunchFollowLink and cmdPBP.
  88.    Or, if you don't want to do that, you can SysUIAppSwitch in any case,
  89.    at the expense of some performance.
  90. */
  91.  
  92. Boolean LinkCheck(); /* returns true if LinkMaster is installed */
  93. void LinkPublish(LinkInfoPtr linkinfo);
  94.  
  95. #ifndef NO_LINKSIMPLE
  96. typedef struct {
  97.    DWord creator;
  98.    ULong record_id;
  99.    Char db_name[32];
  100. } LinkSimpleType;
  101. typedef LinkSimpleType* LinkSimplePtr;
  102.  
  103. LinkSimplePtr LinkSimpleNew(DmOpenRef db, Word record_index, CharPtr title);
  104. GoToParamsPtr LinkSimpleToGoToParams(LinkSimplePtr linkinfo);
  105. #endif /* NO_LINKSIMPLE */
  106.  
  107. #ifndef NO_LINKCONTAINER
  108. void LinkRequest(LinkInfoPtr linkinfo);
  109. void LinkFollow(LinkInfoPtr linkinfo);
  110. #endif /* NO_LINKCONTAINER */
  111.  
  112. #ifndef NO_LINKHISTORY
  113. /* this is stored in preference Link0000,
  114.    but it's not really for external use */
  115. typedef struct {
  116.    Word current;
  117.    Word max;
  118. } LinkHistoryPrefsType; 
  119.  
  120. void LinkHistoryPush(LinkInfoPtr linkinfo);
  121. Boolean LinkHistoryBack(); /* returns true on success */
  122. Boolean LinkHistoryForward();
  123. Boolean LinkHistoryBackCheck(); /* returns true if possible to go back */
  124. Boolean LinkHistoryForwardCheck();
  125. #endif /* NO_LINKHISTORY */
  126.  
  127. #endif /* _linkaware_h */
  128.