Back to index

lightning-sunbird  0.9+nobinonly
sdinst.h
Go to the documentation of this file.
00001 #ifndef _sdinst_h
00002 #define _sdinst_h
00003 
00004 #include <ConditionalMacros.h>
00005 #include <MacTypes.h>
00006 #include <QuickDraw.h>
00007 #include <MixedMode.h>
00008 #include <Events.h>
00009 
00010 #if PRAGMA_ONCE
00011 #pragma once
00012 #endif
00013 
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017 
00018 #if PRAGMA_IMPORT
00019 #pragma import on
00020 #endif
00021 
00022 #if PRAGMA_STRUCT_ALIGN
00023        #pragma options align=mac68k
00024 #elif PRAGMA_STRUCT_PACKPUSH
00025        #pragma pack(push, 2)
00026 #elif PRAGMA_STRUCT_PACK
00027        #pragma pack(2)
00028 #endif
00029 
00030 #define       DEFAULT_TIMEOUT             60
00031 #define DEFAULT_RETRIES            5
00032 
00033 typedef enum
00034 {
00035        idle = 0,
00036        inProgress,
00037        userCanceled,
00038        failure,
00039        success
00040 } DLStatus;
00041 
00042 #ifdef WANT_WINTYPES
00043        typedef unsigned long DWORD;
00044        typedef int HINSTANCE;
00045        #define CONST const
00046        typedef char CHAR;
00047        typedef CONST CHAR* LPCSTR;
00048        typedef LPCSTR LPCTSTR;
00049        typedef long LONG;
00050        typedef LONG LPARAM;
00051        typedef void* LPVOID;
00052        typedef long* LPLONG;
00053        #define _cdecl
00054        typedef long HRESULT;
00055        typedef int HWND;
00056 #endif
00057 
00058 typedef struct SDI_tag
00059 {
00060        DWORD         dwStructSize;
00061        HWND          hwndOwner;
00062        HINSTANCE     hInstance;
00063        DWORD         dwFlags;             // see flag definitions below
00064        DWORD         dwTimeOut;           // timeout for network operations
00065        DWORD         dwRetries;           // how many times to retry downloading from a URL
00066 #if macintosh
00067        FSSpec        fsIDIFile;           // The IDI file
00068        short         dlDirVRefNum; // where to download components
00069        long          dlDirID;             // ditto
00070 #else
00071        LPCTSTR              lpFileName;          // the name of the IDI file
00072        LPCTSTR              lpDownloadDir;       // where to download components
00073 #endif
00074        LPCTSTR              lpTemplate;          // not implemented
00075 #if 0 // later ###
00076        DLGPROC              lpDlgHookProc;       // not implemented
00077 #endif
00078        LPARAM        lUserData;           // not implemented
00079        DWORD         dwReserved;
00080        
00081 } SDISTRUCT, *LPSDISTRUCT;
00082 
00083 // Flags
00084 
00085 #define SDI_STARTOVER              0x00000001
00086        /* Force to start over, even if an interrupted session is detected.
00087         */
00088 
00089 #define SDI_USETEMPLATE            0x00000002
00090        /* If this flag is set, hInstance identifies a module that contains
00091         * a dialog box template named by the lpTemplateName member.
00092         * If silent mode is specified in the IDI file, the flag is ignored. 
00093         */
00094 
00095 #define SDI_USEHOOK                0x00000004
00096        /* The hook procedure receives notification messages sent from the dialog.
00097         * The hook procedure also receives messages for any additional controls
00098         * defined by specifying a child dialog template. The hook procedure does 
00099         * not receive messages intended for the standard controls of the default
00100         * dialog box. 
00101         */
00102 
00103 #define SDI_DEFAULT_RETRIES 0x00000008
00104 
00105 #define SDI_DEFAULT_TIMEOUT 0x00000010
00106 
00107 
00108 
00109 HRESULT _cdecl SDI_NetInstall (LPSDISTRUCT);
00110 HRESULT _cdecl SDI_QueryLog (      LPCTSTR,/* item name to query                                  */
00111                                                         LPVOID,       /* address of buffer for returned info    */
00112                                                         LPLONG);/* address of buffer size                       */
00113 
00114 #if MACINTOSH
00115 Boolean SDI_HandleEvent(const EventRecord* event);
00116 #endif
00117 
00118 #if PRAGMA_STRUCT_ALIGN
00119        #pragma options align=reset
00120 #elif PRAGMA_STRUCT_PACKPUSH
00121        #pragma pack(pop)
00122 #elif PRAGMA_STRUCT_PACK
00123        #pragma pack()
00124 #endif
00125 
00126 #ifdef PRAGMA_IMPORT_OFF
00127 #pragma import off
00128 #elif PRAGMA_IMPORT
00129 #pragma import reset
00130 #endif
00131 
00132 #ifdef __cplusplus
00133 }
00134 #endif
00135 
00136 #endif /* _sdinst_h */