📄 pfgsyncmgr.pas
字号:
unit pfgSyncMgr;
{**************************************************************************}
{* pfgSyncMgr Unit *}
{* *}
{* Header file conversion of pfgSyncMgr.h *}
{* *}
{* Header file converted by Paul Gilbert Nov 2000. *}
{**************************************************************************}
interface
uses pfgWTypes, SysUtils, Windows;
{
/*****************************************************************************
*
* Copyright (c) 1998-1999 Palm Computing, Inc. or its subsidiaries.
* All rights reserved.
*
****************************************************************************/
/////////////////////////////////////////////////////////////////////////////
// File: syncmgr.h
//
// Module: SYNCMGR.DLL
//
//
// Description: Publicly consumable header file prototyping the 'C' API
// and the structures used for their parameters.
// When using the Microsoft compiler we asure packed
// structures on single byte boundaries, with the pragma(1).
//
//
/////////////////////////////////////////////////////////////////////////////
// REVISION HISTORY:
// mja 7/23/95 initial
// vmk 8/12/96 renamed the unused "readOnlyDB" field in CDBList to m_miscFlags
// jim 8/16/96 removed CSyncLog from CSyncProperties
// vmk 10/21/96 added SYNC API versioning scheme and SyncGetAPIVersion() function.
// vmk 1/29/97 accurately documented SYNCERR_... error codes
// jayita 10/10/97 moved conduit API to CondAPI.h to remove
// dependency on data subscription(aka FileLink) for Mac developers
// dlw 5/24/99 Added FSFileSpec to CSyncPreference for Mac version of generic conduit
//
/////////////////////////////////////////////////////////////////////////////
}
const
// Maximum length of Viewer's database name,
// *including* the null-terminator
SYNC_DB_NAMELEN = (32);
DB_NAMELEN = SYNC_DB_NAMELEN;
// Maximum size of Viewer's HotSync log
SYNC_MAX_HH_LOG_SIZE = (2*1024);
BIG_PATH = 256;
// Major API version numbers
SYNCAPI_VER_MAJOR_2 = 2;
// Minor API version numbers
SYNCAPI_VER_MINOR_0 = 0;
SYNCAPI_VER_MINOR_1 = 1;
SYNCAPI_VER_MINOR_2 = 2;
type
{ Enumerations }
//
// Common sync properties structure populated by HotSync.exe and passed
// into the conduit's OpenConduit() function as a parameter.
//
eSyncTypes = LongWord;
eFirstSync = LongWord;
eConnType = LongWord;
eSyncPref = LongWord;
// These attributes are used in CRawRecordInfo m_Attribs field:
// (*All unused bits are reserved by Sync Manager and PalmOS*)
eSyncRecAttrs = Integer;
eDbOpenModes = Integer;
//
// Flags which can be set in CreateDB structure or ReadDbList struct
//
eDbFlags = Integer;
//
// Miscellaneous flags which can be returned in CDbList's m_miscFlags member
//
eMiscDbListFlags = Integer;
const
{ eSyncTypes enumeration }
eFast=0; eSlow=1; eHHtoPC=2; ePCtoHH=3; eInstall=4; eBackup=5;
eDoNothing=6; eProfileInstall=7; eSyncTypeDoNotUse=$ffffffff;
{ eFirstSync enumeration }
eNeither=0; ePC=1; eHH=2; eFirstSyncDoNotUse=$ffffffff;
{ eConnType enumeration }
eCable=0; eModemConnType=1; eConnTypeDoNotUse=$ffffffff;
eModem=eModemConnType;
{ eSyncPref enumeration }
eNoPreference=0; ePermanentPreference=1; eTemporaryPreference=2;
eSyncPrefDoNotUse=$ffffffff;
{ eSyncRecAttrs enumeration }
eRecAttrDeleted = $80; // indicates that this record has been deleted on the handheld
eRecAttrDirty = $40; // indicates that this record was modified
eRecAttrBusy = $20; // SYSTEM USE ONLY: indicates that this record is currently in use
// by some application on the remote, hand-held device.
// CONDUITS: this attribute must be treated as read-only; do *not* pass
// eRecAttrBusy when writing records.
eRecAttrSecret = $10; // "secret" record - password protected (also known as "private")
eRecAttrArchived = $08; // indicates that this record has been marked for archival
eSyncRecAttrDoNotUse = $ffffffff;
//
// values for m_Attribs in CRawRecordInfo ( as used in our sample code )
// the #defines below will be obsoleted, please use the enums (above) in your conduit
DELETE_BIT = eRecAttrDeleted;
DIRTY_BIT = eRecAttrDirty;
PRIVATE_BIT = eRecAttrSecret;
ARCHIVE_BIT = eRecAttrArchived;
{ eDbOpenModes enumeration }
eDbShowSecret = $0010;
eDbExclusive = $0020;
eDbWrite = $0040;
eDbRead = $0080;
eDbOpenModesDoNotUse=$ffffffff;
{ eDbFlags enumeration }
eRecord = $0000; // *this is not really a flag* -- see eResource
eResource = $0001; // if set, indicates a resource database; if clear, indicates a record database
eReadOnly = $0002; // if set, indicates a ROM-based database
eAppInfoDirty = $0004; // set if Application Info Block is dirty
eBackupDB = $0008; // set if database should be backed up to PC if no app-specific conduit has been supplied
eOkToInstallNewer = $0010; // this tells the backup/restore conduit that it's OK for it to install a newer
// version of this database with a different name if the current database is open. This
// mechanism is used to update the Graffiti Shortcuts databsae, for example.
eResetAfterInstall = $0020; // if set, indicates that the device should be reset after this database is installed. The
// actual reset will take place at end of sync.
eCopyPrevention = $0040; // supported from v3.0 on
eOpenDB = $8000; // indicates that the databse is open
eDbFlagsDoNotUse = $ffffffff;
//
// Miscellaneous flags which can be returned in CDbList's m_miscFlags member
//
{ eMiscDbListFlags enumeration }
// eMiscDbFlagExcludeFromSync: if this miscellaneous flag is set, indicates that
// the db should be excluded fro HotSync; this is typically the result of the user
// disabling synchronization for the owning application on the handheld; this functionality
// was defined in DLP v1.1 (beginning with PalmOS v2.0).
eMiscDbFlagExcludeFromSync = $0080; // if set, indicates that this database should be excluded from HotSync. (DLP v1.1)
// eMiscDbFlagRamBased: if this miscellaneous flag is set, indicates that the db is
// in RAM; otherwise, it is in ROM; this flag is returned from devices with Desktop Link
// Protocol (DLP) v1.2 or later (beginning with PalmOS v3.0).
eMiscDbFlagRamBased = $0040; // if set, indicates that this database is RAM-based. (DLP v1.2)
eMiscDbFlagsDoNotUse = $ffffffff;
// eExcludeFromSync is defined for backward compatibility; the new name is eMiscDbFlagExcludeFromSync
eExcludeFromSync = eMiscDbFlagExcludeFromSync;
// Buffer size for handheld username
SYNC_REMOTE_USERNAME_BUF_SIZE = (64);
REMOTE_USERNAME = SYNC_REMOTE_USERNAME_BUF_SIZE; // for backward compatibility
// Maximum handheld username length presently allowed (not including the null-terminator)
SYNC_MAX_USERNAME_LENGTH = (20);
// Buffer size for handheld memory card name
SYNC_REMOTE_CARDNAME_BUF_SIZE = (32);
REMOTE_CARDNAMELEN = SYNC_REMOTE_CARDNAME_BUF_SIZE; // for backward compatibility
// Buffer size for handheld manufacturer name
SYNC_REMOTE_MANUFNAME_BUF_SIZE = (32);
REMOTE_MANUFNAMELEN = SYNC_REMOTE_MANUFNAME_BUF_SIZE; // for backward compatibility
// Buffer size for handheld password
SYNC_REMOTE_PASSWORD_BUF_SIZE = (64);
PASSWORD_LENGTH = SYNC_REMOTE_PASSWORD_BUF_SIZE; // for backward compatibility
// Product ID buffer size in number of byts
SYNC_MAX_PROD_ID_SIZE = (255);
// Database info retrieval options
SYNC_DB_INFO_OPT_GET_ATTRIBUTES = ($80);
// Set to get database attributes (name, creator, type,
// flags, etc.) -- this is an option to allow find operations
// to skip returning this data as a performance optimization
// time, which we would rather avoid if it is not needed
SYNC_DB_INFO_OPT_GET_SIZE = ($40);
// Set to get record count and data size also -- this is
// an option because the operation can take a long
// time, which we would rather avoid if it is not needed
SYNC_DB_INFO_OPT_GET_MAX_REC_SIZE = ($20);
// Set to get max rec/resource size also -- this is
// an option because the operation can take a long
// time, which we would rather avoid if it is not needed
// (SYNC_DB_INFO_OPT_GET_MAX_REC_SIZE is only supported for
// SyncReadOpenDbInfo)
// Search option flags for the SyncFindDbByTypeCreatorParams structure
SYNC_DB_SRCH_OPT_NEW_SEARCH = ($80); // set to beging a new search; subsequent
// iterations of the same search should
// have the flag cleared
SYNC_DB_SRCH_OPT_ONLY_LATEST = ($40); // set to search for the latest version
///////////////////////////////////////////////////////////////////////////////
//
// Option flags for SyncCloseDBEx
//
///////////////////////////////////////////////////////////////////////////////
SYNC_CLOSE_DB_OPT_UPDATE_BACKUP_DATE = $80; // Update the backup date after closing
SYNC_CLOSE_DB_OPT_UPDATE_MOD_DATE = $40; // Update the modification date after closing
///////////////////////////////////////////////////////////////////////////////
//
// Error Code Classes
//
///////////////////////////////////////////////////////////////////////////////
COND_ERR_CLASS = $00001000; // Conduit error class
TRANS_ERR_CLASS = $00002000; // Communications/Transport error class
SYNC_ERR_CLASS = $00004000; // Sync Manager DLL error class
HSAPP_ERR_CLASS = $00008000; // HotSync application error class
///////////////////////////////////////////////////////////////////////////////
//
// Error Codes returned by the SyncManager calls as a result
// of communication over the link to the HH device.
//
///////////////////////////////////////////////////////////////////////////////
SYNC_FATAL_ERR_MASK = $10000000;
SYNC_FATAL_ERR = (SYNC_FATAL_ERR_MASK + SYNC_ERR_CLASS);
SYNCERR_NONE = $0000; // SUCCESS!
SYNCERR_UNKNOWN = (SYNC_ERR_CLASS + $01); // An unknown error occurred (local/remote
SYNCERR_MORE = (SYNC_ERR_CLASS + $02); // NOT USED
SYNCERR_NOT_FOUND = (SYNC_ERR_CLASS + $03); // Requested database, record, resource, etc. not found
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -