home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / intshcut.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.8 KB  |  201 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. /*
  20.  * intshcut.h - Internet Shortcut interface definitions.
  21.  */
  22.  
  23.  
  24. #ifndef __INTSHCUT_H__
  25. #define __INTSHCUT_H__
  26.  
  27.  
  28. /* Headers
  29.  **********/
  30.  
  31. #include "isguids.h"
  32.  
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {                        /* Assume C declarations for C++. */
  36. #endif   /* __cplusplus */
  37.  
  38.  
  39. /* Constants
  40.  ************/
  41.  
  42. /* Define API decoration for direct import of DLL functions. */
  43.  
  44. #ifdef _INTSHCUT_
  45. #define INTSHCUTAPI
  46. #else
  47. #define INTSHCUTAPI                 DECLSPEC_IMPORT
  48. #endif
  49.  
  50. /* HRESULTs */
  51.  
  52. #define URL_E_INVALID_FLAGS         MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x1000)
  53. #define URL_E_INVALID_SYNTAX        MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x1001)
  54. #define URL_E_UNREGISTERED_PROTOCOL MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x1002)
  55.  
  56. #define IS_E_INVALID_FILE           MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x2000)
  57. #define IS_E_INVALID_DIRECTORY      MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x2001)
  58. #define IS_E_EXEC_FAILED            MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x2002)
  59.  
  60.  
  61. /* Interfaces
  62.  *************/
  63.  
  64. /* IUniformResourceLocator::SetURL() input flags */
  65.  
  66. typedef enum iurl_seturl_flags
  67. {
  68.    /* Guess protocol if missing.*/
  69.  
  70.    IURL_SETURL_FL_GUESS_PROTOCOL         = 0x0001,
  71.  
  72.    /* Use default protocol if missing.*/
  73.  
  74.    IURL_SETURL_FL_USE_DEFAULT_PROTOCOL = 0x0002,
  75.  
  76.    /* flag combinations */
  77.  
  78.    ALL_IURL_SETURL_FLAGS               = (IURL_SETURL_FL_GUESS_PROTOCOL |
  79.                                           IURL_SETURL_FL_USE_DEFAULT_PROTOCOL)
  80. }
  81. IURL_SETURL_FLAGS;
  82.  
  83. /* IUniformResourceLocator::Open() input flags */
  84.  
  85. typedef enum iurl_open_flags
  86. {
  87.    /*
  88.     * Allow interaction with user.  If set, hwndOwner is valid.  If clear,
  89.     * hwndOwner is NULL.
  90.     */
  91.  
  92.    IURL_OPEN_FL_ALLOW_UI               = 0x0001,
  93.  
  94.    /* flag combinations */
  95.  
  96.    ALL_IURL_OPEN_FLAGS                 = IURL_OPEN_FL_ALLOW_UI
  97. }
  98. IURL_OPEN_FLAGS;
  99.  
  100. #undef  INTERFACE
  101. #define INTERFACE IUniformResourceLocator
  102.  
  103. DECLARE_INTERFACE_(IUniformResourceLocator, IUnknown)
  104. {
  105.    /* IUnknown methods */
  106.  
  107.    STDMETHOD(QueryInterface)(THIS_
  108.                              REFIID riid,
  109.                              PVOID *ppvObject) PURE;
  110.  
  111.    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  112.  
  113.    STDMETHOD_(ULONG, Release)(THIS) PURE;
  114.  
  115.    /* IUniformResourceLocator methods */
  116.  
  117.    /*
  118.     * Success:
  119.     *    S_OK
  120.     *
  121.     * Failure:
  122.     *    E_OUTOFMEMORY
  123.     *    URL_E_INVALID_SYNTAX
  124.     */
  125.    STDMETHOD(SetURL)(THIS_
  126.                      PCSTR pcszURL,
  127.                      DWORD dwFlags) PURE;
  128.  
  129.    /*
  130.     * Success:
  131.     *    S_OK
  132.     *    S_FALSE
  133.     *
  134.     * Failure:
  135.     *    E_OUTOFMEMORY
  136.     */
  137.    STDMETHOD(GetURL)(THIS_
  138.                      PSTR *ppszURL) PURE;
  139.  
  140.    /*
  141.     * Success:
  142.     *    S_OK
  143.     *
  144.     * Failure:
  145.     *    E_OUTOFMEMORY
  146.     *    URL_E_INVALID_SYNTAX
  147.     *    URL_E_UNREGISTERED_PROTOCOL
  148.     *    IS_E_EXEC_FAILED
  149.     */
  150.    STDMETHOD(Open)(THIS_
  151.                    HWND hwndOwner,
  152.                    DWORD dwFlags) PURE;
  153. };
  154. typedef IUniformResourceLocator *PIUniformResourceLocator;
  155. typedef const IUniformResourceLocator CIUniformResourceLocator;
  156. typedef const IUniformResourceLocator *PCIUniformResourceLocator;
  157.  
  158.  
  159. /* Prototypes
  160.  *************/
  161.  
  162. /* TranslateURL() input flags */
  163.  
  164. typedef enum translateurl_flags
  165. {
  166.    /* Guess protocol if missing.*/
  167.  
  168.    TRANSLATEURL_FL_GUESS_PROTOCOL         = 0x0001,
  169.  
  170.    /* Use default protocol if missing.*/
  171.  
  172.    TRANSLATEURL_FL_USE_DEFAULT_PROTOCOL   = 0x0002,
  173.  
  174.    /* flag combinations */
  175.  
  176.    ALL_TRANSLATEURL_FLAGS                 = (TRANSLATEURL_FL_GUESS_PROTOCOL |
  177.                                              TRANSLATEURL_FL_USE_DEFAULT_PROTOCOL)
  178. }
  179. TRANSLATEURL_FLAGS;
  180.  
  181. /*
  182.  * Success:
  183.  *    S_OK
  184.  *    S_FALSE
  185.  *
  186.  * Failure:
  187.  *    E_OUTOFMEMORY
  188.  *    E_POINTER
  189.  *    URL_E_INVALID_FLAGS
  190.  */
  191. INTSHCUTAPI HRESULT WINAPI TranslateURL(PCSTR pcszURL, DWORD dwFlags, PSTR *ppszTranslatedURL);
  192.  
  193.  
  194. #ifdef __cplusplus
  195. }                                   /* End of extern "C" {. */
  196. #endif   /* __cplusplus */
  197.  
  198.  
  199. #endif   /* ! __INTSHCUT_H__ */
  200.  
  201.