inetcomm_private.h 3.25 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
/*
 * Internet Messaging APIs
 *
 * Copyright 2006 Robert Shearman for CodeWeavers
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#include "winsock2.h"
#include "winuser.h"
#include "objbase.h"
#include "imnxport.h"

typedef struct InternetTransport InternetTransport;

typedef void (*INETXPORT_COMPLETION_FUNCTION)(IInternetTransport *, char *, int);

struct InternetTransport
{
    union
    {
        const IInternetTransportVtbl *vtbl;
35
        const ISMTPTransport2Vtbl *vtblSMTP2;
36
        const IIMAPTransportVtbl *vtblIMAP;
37
        const IPOP3TransportVtbl *vtblPOP3;
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
    } u;

    ITransportCallback *pCallback;
    IXPSTATUS Status;
    INETSERVER ServerInfo;
    SOCKET Socket;
    boolean fCommandLogging;
    boolean fInitialised;
    INETXPORT_COMPLETION_FUNCTION fnCompletion;
    char *pBuffer;
    int cbBuffer;
    int iCurrentBufferOffset;
    HWND hwnd;
};

HRESULT InternetTransport_Init(InternetTransport *This);
HRESULT InternetTransport_GetServerInfo(InternetTransport *This, LPINETSERVER pInetServer);
HRESULT InternetTransport_InetServerFromAccount(InternetTransport *This,
    IImnAccount *pAccount, LPINETSERVER pInetServer);
HRESULT InternetTransport_Connect(InternetTransport *This,
    LPINETSERVER pInetServer, boolean fAuthenticate, boolean fCommandLogging);
HRESULT InternetTransport_HandsOffCallback(InternetTransport *This);
HRESULT InternetTransport_DropConnection(InternetTransport *This);
HRESULT InternetTransport_GetStatus(InternetTransport *This,
    IXPSTATUS *pCurrentStatus);
HRESULT InternetTransport_ChangeStatus(InternetTransport *This, IXPSTATUS Status);
HRESULT InternetTransport_ReadLine(InternetTransport *This,
    INETXPORT_COMPLETION_FUNCTION fnCompletion);
HRESULT InternetTransport_Write(InternetTransport *This, const char *pvData,
    int cbSize, INETXPORT_COMPLETION_FUNCTION fnCompletion);
68
HRESULT InternetTransport_DoCommand(InternetTransport *This,
69
    LPCSTR pszCommand, INETXPORT_COMPLETION_FUNCTION fnCompletion);
70 71 72

BOOL InternetTransport_RegisterClass(HINSTANCE hInstance);
void InternetTransport_UnregisterClass(HINSTANCE hInstance);
73 74

HRESULT MimeBody_create(IUnknown *outer, void **obj);
75
HRESULT MimeAllocator_create(IUnknown *outer, void **obj);
76 77
HRESULT MimeMessage_create(IUnknown *outer, void **obj);
HRESULT MimeSecurity_create(IUnknown *outer, void **obj);
78
HRESULT VirtualStream_create(IUnknown *outer, void **obj);
79 80

HRESULT MimeInternational_Construct(IMimeInternational **internat);
81

82
HRESULT SMTPTransportCF_Create(REFIID riid, LPVOID *ppv);
83
HRESULT IMAPTransportCF_Create(REFIID riid, LPVOID *ppv);
84
HRESULT POP3TransportCF_Create(REFIID riid, LPVOID *ppv);