home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / IC Libraries ƒ / IC Headers ƒ / IC Component API Descriptions.h < prev    next >
Encoding:
Text File  |  1995-11-17  |  22.2 KB  |  433 lines  |  [TEXT/SPM ]

  1. a ICBegin/End pair.
  2.     
  3.     Call to configure this connection to IC.
  4.     Set count as the number of valid elements in folders.
  5.     Set folders to a pointer to the folders to search.
  6.     Setting count to 0 and folders to nil is OK.
  7.     Searches the specified folders and then the Preferences folder
  8.     in a unspecified manner.
  9. */
  10.  
  11. pascal ICError ICCFindUserConfigFile(internetConfigurationComponent inst, ICDirSpec *where)
  12. /*
  13.     Requires IC 1.1.
  14.     
  15.     It is illegal to call this routine inside a ICBegin/End pair.
  16.     
  17.     Similar to ICFindConfigFile except that it only searches the folder
  18.     specified in where.  If the input parameters are valid the routine
  19.     will always successful configure the instance, creating an
  20.     empty configuration if necessary
  21.     For use with double-clickable preference files.
  22. */
  23.  
  24. pascal ICError ICCGeneralFindConfigFile(internetConfigurationComponent inst, Boolean search_prefs, Boolean can_create,
  25.         short count, ICDirSpecArrayPtr folders)
  26. /*
  27.     Requires IC 1.2.
  28.     
  29.     It is illegal to call this routine inside a ICBegin/End pair.
  30.     
  31.     Call to configure this connection to IC.
  32.     This routine acts as a more general replacement for
  33.     ICFindConfigFile and ICFindUserConfigFile.
  34.     Set search_prefs to true if you want it to search the preferences folder.
  35.     Set can_create to true if you want it to be able to create a new config.
  36.     Set count as the number of valid elements in folders.
  37.     Set folders to a pointer to the folders to search.
  38.     Setting count to 0 and folders to nil is OK.
  39.     Searches the specified folders and then optionally the Preferences folder
  40.     in a unspecified manner.
  41. */
  42.  
  43. pascal ICError ICCChooseConfig(internetConfigurationComponent inst)
  44. /*
  45.     Requires IC 1.2.
  46.     
  47.     It is illegal to call this routine inside a ICBegin/End pair.
  48.     
  49.     Requests the user to choose a configuration, typically using some
  50.     sort of modal dialog. If the user cancels the dialog the configuration
  51.     state will be unaffected.
  52. */
  53.  
  54. pascal ICError ICCChooseNewConfig(internetConfigurationComponent inst)
  55. /*
  56.     Requires IC 1.2.
  57.     
  58.     It is illegal to call this routine inside a ICBegin/End pair.
  59.     
  60.     Requests the user to create a new configuration, typically using some
  61.     sort of modal dialog. If the user cancels the dialog the configuration
  62.     state will be unaffected.
  63. */
  64.  
  65. pascal ICError ICCGetConfigName(internetConfigurationComponent inst, Boolean longname, Str255 name)
  66. /*
  67.     Requires IC 1.2.
  68.     
  69.     You must specify a configuration before calling this routine.
  70.     Returns a string that describes the current configuration at a user
  71.     level. Set longname to true if you want a long name, up to 255
  72.     characters, or false if you want a short name, typically about 32
  73.     characters.
  74.     The returned string is for user display only. If you rely on the
  75.     exact format of it, you will conflict with any future IC
  76.     implementation that doesn't use explicit preference files.
  77. */
  78.  
  79. pascal ICError ICCGetConfigReference(internetConfigurationComponent inst, ICConfigRefHandle ref)
  80. /*
  81.     Requires IC 1.2.
  82.     
  83.     You must specify a configuration before calling this routine.
  84.     Returns a self-contained reference to the instance's current
  85.     configuration.
  86.     ref must be a valid non-nil handle and it will be resized to fit the
  87.     resulting data.
  88. */
  89.  
  90. pascal ICError ICCSetConfigReference(internetConfigurationComponent inst, ICConfigRefHandle ref, long flags)
  91. /*
  92.     Requires IC 1.2.
  93.     
  94.     It is illegal to call this routine inside a ICBegin/End pair.
  95.     
  96.     Reconfigures the instance using a configuration reference that was
  97.     got using ICGetConfigReference reference. Set the
  98.     icNoUserInteraction_bit in flags if you require that this routine
  99.     not present a modal dialog. Other flag bits are reserved and should
  100.     be set to zero.
  101.     ref must not be nil.
  102. */
  103.  
  104. pascal ICError ICCSpecifyConfigFile(internetConfigurationComponent inst, FSSpec *config)
  105. /*
  106.     It is illegal to call this routine inside a ICBegin/End pair.
  107.     
  108.     For use only by the IC application.
  109.     If you call this routine yourself, you will conflict with any
  110.     future IC implementation that doesn't use explicit preference files.
  111. */
  112.  
  113. /* ***** Getting Information ***** */
  114.  
  115. pascal ICError ICCGetSeed(internetConfigurationComponent inst, rm.
  116.     Returns icPermErr if current attr is locked, new attr is locked and buf <> nil.
  117. */
  118.  
  119. pascal ICError ICCFindPrefHandle(internetConfigurationComponent inst, ConstStr255Param key, ICAttr *attr, Handle prefh)
  120. /*
  121.     Requires IC 1.2.
  122.     
  123.     You must specify a configuration before calling this routine.
  124.     If you are getting or setting multiple preferences, you should place
  125.     these calls within an ICBegin/ICEnd pair.
  126.     If you call this routine outside of such a pair, it implicitly
  127.     calls ICBegin(inst, icReadWritePerm).
  128.     This routine effectively replaces ICGetPrefHandle.
  129.     Reads the preference specified by key from the IC database into
  130.     a handle, prefh.
  131.     key must not be the empty string.
  132.     attr is set to the attributes associated with the preference.
  133.     You must set prefh to a non-nil handle before calling this routine.
  134.     If the preference does not exist, icPrefNotFoundErr is returned.
  135. */
  136.  
  137. pascal ICError ICCGetPrefHandle(internetConfigurationComponent inst, ConstStr255Param key, ICAttr *attr, Handle *prefh)
  138. /*
  139.     Requires IC 1.1.
  140.     
  141.     You must specify a configuration before calling this routine.
  142.     If you are getting or setting multiple preferences, you should place
  143.     these calls within an ICBegin/ICEnd pair.
  144.     If you call this routine outside of such a pair, it implicitly
  145.     calls ICBegin(inst, icReadOnlyPerm).
  146.     This routine is now obsolete. Use ICFindPrefHandle instead.
  147.     Reads the preference specified by key from the IC database into
  148.     a newly created handle, prefh.
  149.     key must not be the empty string.
  150.     attr is set to the attributes associated with the preference.
  151.     The incoming value of prefh is ignored.
  152.     A new handle is created in the current heap and returned in prefh.
  153.     If the routine returns an error, prefh is set to nil.
  154.     If the preference does not exist, no error is returned and prefh is set
  155.     to an empty handle.
  156. */
  157.  
  158. pascal ICError ICCSetPrefHandle(internetConfigurationComponent inst, ConstStr255Param key, ICAttr attr, Handle prefh)
  159. /*
  160.     Requires IC 1.1.
  161.     
  162.     You must specify a configuration before calling this routine.
  163.     If you are getting or setting multiple preferences, you should place
  164.     these calls within an ICBegin/ICEnd pair.
  165.     If you call this routine outside of such a pair, it implicitly
  166.     calls ICBegin(inst, icReadWritePerm).
  167.     Sets the preference specified by key from the IC database to the
  168.     value contained in prefh.
  169.     key must not be the empty string.
  170.     If prefh is nil then the preference value is not set.
  171.     If buf is not nil then the preference value is set to the data
  172.     contained in it.
  173.     If attr is ICattr_no_change then the preference attributes are not set.
  174.     Otherwise the preference attributes are set to attr.
  175.     Returns icPermErr if the previous ICBegin was passed icReadOnlyPerm.
  176.     Returns icPermErr if current attr is locked, new attr is locked and prefh <> nil.
  177. */
  178.  
  179. pascal ICError ICCCountPref(internetConfigurationComponent inst, long *count)
  180. /*
  181.     You must specify a configuration before calling this routine.
  182.     You must be inside an ICBegin/End pair to call this routine.
  183.     Counts the total number of preferences.
  184.     If the routine returns an error, count is set to 0.
  185. */
  186.  
  187. pascal ICError ICCGetIndPref(internetConfigurationComponent inst, long n, Str255 key)
  188. /*
  189.     You must specify a configuration before calling this routine.
  190.     You must be inside an ICBegin/End pair to call this routine.
  191.     Returns the key of the Nth preference.
  192.     n must be positive.
  193.     Returns icPrefNotFoundErr if n is greater than the total number of preferences.
  194.     If the routine returns an error, key is undefined.
  195. */
  196.  
  197. pascal ICError ICCDeletePref(internetConfigurationComponent inst, ConstStr255Param key)
  198. /*
  199.     You must specify a configuration before calling this routine.
  200.     You must be inside an ICBegin/End pair to call this routine.
  201.     Deletes the preference specified by key.
  202.     key must not be the empty string.
  203.     Returns icPrefNotFound if the preference specified by key is not present.
  204. */
  205.  
  206. pascal ICError ICCEnd(internetConfigurationComponent inst)
  207. /*
  208.     You must specify a configuration before calling this routine.
  209.     You must be inside an ICBegin/End pair to call this routine.
  210.     Terminates a preference session, as started by ICBegin.
  211.     You must have called ICBegin before calling this routine.
  212. */
  213.  
  214. /* ***** User Interface Stuff ***** */
  215.  
  216. pascal ICError ICCEditPreferences(internetConfigurationComponent inst, ConstStr255Param key)
  217. /*
  218.     Requires IC 1.1.
  219.     
  220.     You must specify a configuration before calling this routine.
  221.     You do not have to be inside an ICBegin/End pair to call this routine.
  222.     Instructs IC to display the user interface associated with editing
  223.     preferences and focusing on the preference specified by key.
  224.     If key is the empty string then no preference should be focused upon.
  225.     You must have specified a configuration before calling this routine.
  226.     You do not need to call ICBegin before calling this routine.
  227.     In the current implementation this launches the IC application
  228.     (or brings it to the front) and displays the window containing
  229.     the preference specified by key.
  230.     It may have a radically different implementation in future
  231.     IC systems.
  232. */
  233.  
  234. /* ***** URL Handling ***** */
  235.  
  236. pascal ICError ICCParseURL(internetConfigurationComponent inst, ConstStr255Param hint, Ptr data, long len,
  237.         long *selStart, long *selEnd, Handle url)
  238. /*
  239.     Requires IC 1.1.
  240.     
  241.     You must specify a configuration before calling this routine.
  242.     You do not have to be inside an ICBegin/End pair to call this routine.
  243.     Parses a URL out of the specified text and returns it in a canonical form
  244.     in a handle.
  245.     hint indicates the default scheme for URLs of the form "name@address".
  246.     If hint is the empty string then URLs of that form are not allowed.
  247.     data points to the start of the text. It must not be nil.
  248.     len indicates the length of the text. It must be non-negative.
  249.     selStart and selEnd should be passed in as the current selection of
  250.     the text. This selection is given in the same manner as TextEdit,
  251.     ie if selStart = selEnd then there is no selection only an insertion
  252.     point. Also selStart ≤ selEnd and 0 ≤ selStart ≤ len and 0 ≤ selEnd ≤ len.
  253.     selStart and selEnd are returned as the bounds of the URL. If the
  254.     routine returns an error then these new boundaries may be
  255.     invalid but they will be close.
  256.     The incoming url handle must not be nil.  The resulting URL is normalised
  257.     and copied into the url handle, which is resized to fit.
  258. */
  259.  
  260. pascal ICError ICCLaunchURL(internetConfigurationComponent inst, ConstStr255Param hint, Ptr data, long len,
  261.         long *selStart, long *selEnd)
  262. /*
  263.     Requires IC 1.1.
  264.     
  265.     You must specify a configuration before calling this routine.
  266.     You do not have to be inside an ICBegin/End pair to call this routine.
  267.     Parses a URL out of the specified text and feeds it off to the
  268.     appropriate helper.
  269.     hint indicates the default scheme for URLs of the form "name@address".
  270.     If hint is the empty string then URLs of that form are not allowed.
  271.     data points to the start of the text. It must not be nil.
  272.     len indicates the length of the text. It must be non-negative.
  273.     selStart and selEnd should be passed in as the current selection of
  274.     the text. This selection is given in the same manner as TextEdit,
  275.     ie if selStart = selEnd then there is no selection only an insertion
  276.     point. Also selStart ≤ selEnd and 0 ≤ selStart ≤ len and 0 ≤ selEnd ≤ len.
  277.     selStart and selEnd are returned as the bounds of the URL. If the
  278.     routine returns an error then these new boundaries may be
  279.     invalid but they will be close.
  280.     The URL is parsed out of the text and passed off to the appropriate
  281.     helper using the GURL AppleEvent.
  282. */
  283.  
  284. /* ***** Mappings Routines *****
  285.  * 
  286.  * Routines for interrogating mappings database.
  287.  * 
  288.  * ----- High Level Routines -----
  289.  */
  290.  
  291. pascal ICError ICCMapFilename(internetConfigurationComponent inst, ConstStr255Param filename, ICMapEntry *entry)
  292. /*
  293.     Requires IC 1.1.
  294.     
  295.     You must specify a configuration before calling this routine.
  296.     If you are getting or setting multiple preferences, you should place
  297.     these calls within an ICBegin/ICEnd pair.
  298.     If you call this routine outside of such a pair, it implicitly
  299.     calls ICBegin(inst, icReadWritePerm).
  300.     Takes the name of an incoming file and returns the most appropriate
  301.     mappings database entry, based on its extension.
  302.     filename must not be the empty string.
  303.     Returns icPrefNotFoundErr if no suitable entry is found.
  304. */
  305.  
  306. pascal ICError ICCMapTypeCreator(internetConfigurationComponent inst, OSType fType, OSType fCreator,
  307.         ConstStr255Param filename, ICMapEntry *entry)
  308. /*
  309.     Requires IC 1.1.
  310.     
  311.     You must specify a configuration before calling this routine.
  312.     You must be inside an ICBegin/End pair to call this routine.
  313.     Takes the type and creator (and optionally the name) of an outgoing
  314.     file and returns the most appropriate mappings database entry.
  315.     The filename may be either the name of the outgoing file or
  316.     the empty string.
  317.     Returns icPrefNotFoundErr if no suitable entry found.
  318. */
  319.  
  320. /* ----- Mid Level Routines ----- */
  321.  
  322. pascal ICError ICCMapEntriesFilename(internetConfigurationComponent inst, Handle entries, ConstStr255Param filename,
  323.         ICMapEntry *entry)
  324. /*
  325.     Requires IC 1.1.
  326.     
  327.     You must specify a configuration before calling this routine.
  328.     You do not have to be inside an ICBegin/End pair to call this routine.
  329.     Takes the name of an incoming file and returns the most appropriate
  330.     mappings database entry, based on its extension.
  331.     entries must be a handle to a valid IC mappings database preference.
  332.     filename must not be the empty string.
  333.     Returns icPrefNotFoundErr if no suitable entry is found.
  334. */
  335.  
  336. pascal ICError ICCMapEntriesTypeCreator(internetConfigurationComponent inst, Handle entries, OSType fType, OSType fCreator,
  337.         ConstStr255Param filename, ICMapEntry *entry)
  338. /*
  339.     Requires IC 1.1.
  340.     
  341.     You must specify a configuration before calling this routine.
  342.     You do not have to be inside an ICBegin/End pair to call this routine.
  343.     Takes the type and creator (and optionally the name) of an outgoing
  344.     file and returns the most appropriate mappings database entry.
  345.     entries must be a handle to a valid IC mappings database preference.
  346.     The filename may be either the name of the outgoing file or
  347.     the empty string.
  348.     Returns icPrefNotFoundErr if no suitable entry found.
  349. */
  350.  
  351. /* ----- Low Level Routines ----- */
  352.  
  353. pascal ICError ICCCountMapEntries(internetConfigurationComponent inst, Handle entries, long *count)
  354. /*
  355.     Requires IC 1.1.
  356.     
  357.     You must specify a configuration before calling this routine.
  358.     You do not have to be inside an ICBegin/End pair to call this routine.
  359.     Counts the number of entries in the mappings database.
  360.     entries must be a handle to a valid IC mappings database preference.
  361.     count is set to the number of entries.
  362. */
  363.  
  364. pascal ICError ICCGetIndMapEntry(internetConfigurationComponent inst, Handle entries, long ndx, long *pos, ICMapEntry *entry)
  365. /*
  366.     Requires IC 1.1.
  367.     
  368.     You must specify a configuration before calling this routine.
  369.     You do not have to be inside an ICBegin/End pair to call this routine.
  370.     Gets the ndx'th entry in the mappings database.
  371.     entries must be a handle to a valid IC mappings database preference.
  372.     ndx must be in the range from 1 to the number of entries in the database.
  373.     The value of pos is ignored on input. pos is set to the position of
  374.     the ndx'th entry in the database and is suitable for passing back
  375.     into ICSetMapEntry.
  376.     Does not return any user data associated with the entry.
  377. */
  378.  
  379. pascal ICError ICCGetMapEntry(internetConfigurationComponent inst, Handle entries, long pos, ICMapEntry *entry)
  380. /*
  381.     Requires IC 1.1.
  382.     
  383.     You must specify a configuration before calling this routine.
  384.     You do not have to be inside an ICBegin/End pair to call this routine.
  385.     Returns the entry located at position pos in the mappings database.
  386.     entries must be a handle to a valid IC mappings database preference.
  387.     pos should be 0 to get the first entry. To get the subsequent entries, add
  388.     entry.total_size to pos and iterate.
  389.     Does not return any user data associated with the entry.
  390. */
  391.  
  392. pascal ICError ICCSetMapEntry(internetConfigurationComponent inst, Handle entries, long pos, ICMapEntry *entry)
  393. /*
  394.     Requires IC 1.1.
  395.     
  396.     You must specify a configuration before calling this routine.
  397.     You do not have to be inside an ICBegin/End pair to call this routine.
  398.     Sets the entry located at position pos in the mappings database.
  399.     entries must be a handle to a valid IC mappings database preference.
  400.     pos should be either a value returned from ICGetIndMapEntry or a value
  401.     calculated using ICGetMapEntry.
  402.     entry is a var parameter purely for stack space reasons. It is not
  403.     modified in any way.
  404.     Any user data associated with the entry is unmodified.
  405. */
  406.  
  407. pascal ICError ICCDeleteMapEntry(internetConfigurationComponent inst, Handle entries, long pos)
  408. /*
  409.     Requires IC 1.1.
  410.     
  411.     You must specify a configuration before calling this routine.
  412.     You do not have to be inside an ICBegin/End pair to call this routine.
  413.     Deletes the mappings database entry at pos.
  414.     entries must be a handle to a valid IC mappings database preference.
  415.     pos should be either a value returned from ICGetIndMapEntry or a value
  416.     calculated using ICGetMapEntry.
  417.     Also deletes any user data associated with the entry.
  418. */
  419.  
  420. pascal ICError ICCAddMapEntry(internetConfigurationComponent inst, Handle entries, ICMapEntry *entry)
  421. /*
  422.     Requires IC 1.1.
  423.     
  424.     You must specify a configuration before calling this routine.
  425.     You do not have to be inside an ICBegin/End pair to call this routine.
  426.     Adds an entry to the mappings database.
  427.     entries must be a handle to a valid IC mappings database preference.
  428.     The entry is added to the end of the entries database.
  429.     No user data is added.
  430. */
  431.  
  432. #endif
  433.