Back to index

lightning-sunbird  0.9+nobinonly
Defines | Typedefs | Functions
MozABConduitGenCond.h File Reference
#include <condapi.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define GENERIC_CONDUIT_VERSION   0x00000102
#define ExportFunc   __declspec( dllexport )

Typedefs

typedef long(* PROGRESSFN )(char *)

Functions

ExportFunc long OpenConduit (PROGRESSFN, CSyncProperties &)
ExportFunc long GetConduitName (char *, WORD)
ExportFunc DWORD GetConduitVersion ()
ExportFunc long ConfigureConduit (CSyncPreference &pref)
ExportFunc long GetConduitInfo (ConduitInfoEnum infoType, void *pInArgs, void *pOut, DWORD *dwOutSize)

Define Documentation

#define ExportFunc   __declspec( dllexport )

Definition at line 19 of file MozABConduitGenCond.h.

#define GENERIC_CONDUIT_VERSION   0x00000102

Definition at line 13 of file MozABConduitGenCond.h.


Typedef Documentation

typedef long(* PROGRESSFN)(char *)

Definition at line 25 of file MozABConduitGenCond.h.


Function Documentation

ExportFunc long ConfigureConduit ( CSyncPreference &  pref)

Definition at line 204 of file MozABConduitGenCond.cpp.

{

    long nRtn = -1;
    CfgConduitInfoType cfgcond;
    cfgcond.dwVersion = CFGCONDUITINFO_VERSION_1;
    cfgcond.dwSize  = sizeof(CfgConduitInfoType);
    cfgcond.dwCreatorId = 0;
    cfgcond.dwUserId = 0;
    memset(cfgcond.szUser , 0, sizeof(cfgcond.szUser));
    memset(cfgcond.m_PathName, 0, sizeof(cfgcond.m_PathName)); 
    cfgcond.syncPermanent = pref.m_SyncType;
    cfgcond.syncTemporary = pref.m_SyncType;
    cfgcond.syncNew = pref.m_SyncType;
    cfgcond.syncPref = eTemporaryPreference; 

    int irv;
    irv = DialogBoxParam((HINSTANCE)hLangInstance, 
              MAKEINTRESOURCE(IDD_CONDUIT_ACTION), 
              GetForegroundWindow(), 
              (DLGPROC)CondCfgDlgProc,
              (LPARAM)&cfgcond);
    if (irv == 0) 
       {
        pref.m_SyncType = cfgcond.syncNew;
        pref.m_SyncPref = cfgcond.syncPref;
        nRtn = 0;
    }

    return nRtn;
}

Here is the call graph for this function:

ExportFunc long GetConduitInfo ( ConduitInfoEnum  infoType,
void pInArgs,
void pOut,
DWORD dwOutSize 
)

Definition at line 277 of file MozABConduitGenCond.cpp.

{
    if (!pOut)
        return CONDERR_INVALID_PTR;
    if (!pdwOutSize)
        return CONDERR_INVALID_OUTSIZE_PTR;

    switch (infoType) 
       {
        case eConduitName:

            // This code is for example. This conduit does not use this code
            
            if (!pInArgs)
                return CONDERR_INVALID_INARGS_PTR;
            ConduitRequestInfoType *pInfo;
            pInfo = (ConduitRequestInfoType *)pInArgs;
            if ((pInfo->dwVersion != CONDUITREQUESTINFO_VERSION_1) ||
                (pInfo->dwSize != SZ_CONDUITREQUESTINFO))
                return CONDERR_INVALID_INARGS_STRUCT;
           
                pOut = CONDUIT_NAME;
                return CONDERR_CONDUIT_RESOURCE_FAILURE;
            break;
        case eDefaultAction:
            if (*pdwOutSize != sizeof(eSyncTypes))
                return CONDERR_INVALID_BUFFER_SIZE;
            (*(eSyncTypes*)pOut) = eFast;
            break;
        case eMfcVersion:
            if (*pdwOutSize != sizeof(DWORD))
                return CONDERR_INVALID_BUFFER_SIZE;
            (*(DWORD*)pOut) = MFC_NOT_USED;
            break;
        default:
            return CONDERR_UNSUPPORTED_CONDUITINFO_ENUM;
    }
    return 0;
}
ExportFunc long GetConduitName ( char *  ,
WORD   
)

Definition at line 159 of file MozABConduitGenCond.cpp.

{
    strncpy(pszName,CONDUIT_NAME, nLen-1);   
    *(pszName+nLen-1) = '\0';

    return 0;
}

Here is the caller graph for this function:

Definition at line 184 of file MozABConduitGenCond.cpp.

ExportFunc long OpenConduit ( PROGRESSFN  ,
CSyncProperties &   
)

Definition at line 126 of file MozABConduitGenCond.cpp.

{
    long retval = -1;
    if (pFn)
    {
       CMozABConduitSync * pABSync = new CMozABConduitSync(rProps);
        if (pABSync)
              {
            retval = pABSync->Perform();
            delete pABSync;
        }
    }
    return(retval);
}

Here is the call graph for this function: