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