📄 dmapidefinitions.cs
字号:
// Device Management Service
public const int CONAPI_DM_SERVICE = 8192;
// NEF Service
public const int CONAPI_NEF_SERVICE = 12288;
// Data Synchronication SMS Service
public const int CONAPI_DS_SMS_SERVICE = 16384;
// Data Synchronication MMS Service
public const int CONAPI_DS_MMS_SERVICE = 20480;
// Data Synchronication Bookmarks Service
public const int CONAPI_DS_BOOKMARKS_SERVICE = 24576;
// Folder-Browsing Service
public const int CONAPI_FOLDER_BROWSING_SERVICE = 28672;
// User defined Service. The service name must be set to pstrPropertyName.
public const int CONAPI_USER_DEFINED_SERVICE = 32768;
// Definitions used with General device info structure
// Device types:
// Unknown device.
public const int CONAPI_UNKNOWN_DEVICE = 0;
// Series 40 device
public const int CONAPI_SERIES40_DEVICE = 16777217;
// Series 60 the 2nd edition device.
public const int CONAPI_SERIES60_2ED_DEVICE = 33554448;
// Series 60 the 3nd edition device.
public const int CONAPI_SERIES60_3ED_DEVICE = 33554464;
// Series 80 device.
public const int CONAPI_SERIES80_DEVICE = 33554688;
// Nokia 7710 device.
public const int CONAPI_NOKIA7710_DEVICE = 33558528;
// Synchronication support:
// Device is not supporting synchronication.
public const int CONAPI_SYNC_NOT_SUPPORTED = 0;
// Device is supporting Server Alerted (SA) Data Synchronication.
public const int CONAPI_SYNC_SA_DS = 1;
// Device is supporting Server Alerted (SA) Device Management.
public const int CONAPI_SYNC_SA_DM = 2;
// Device is supporting Client Initated (CI) Data Synchronication.
public const int CONAPI_SYNC_CI_DS = 16;
// File System support:
// Device is not support file system.
public const int CONAPI_FS_NOT_SUPPORTED = 0;
// Device is support file system.
public const int CONAPI_FS_SUPPORTED = 1;
// Device is supporting Java MIDlet installation.
public const int CONAPI_FS_INSTALL_JAVA_APPLICATIONS = 16;
// Device is supporting SIS applications installation.
public const int CONAPI_FS_INSTALL_SIS_APPLICATIONS = 32;
// Device supports SISX applications' installation.
public const int CONAPI_FS_INSTALL_SISX_APPLICATIONS = 64;
// Device is supporting file conversion.
public const int CONAPI_FS_FILE_CONVERSION = 256;
// Device supports installed applications' listing.
public const int CONAPI_FS_LIST_APPLICATIONS = 512;
// Device supports installed applications' uninstallation.
public const int CONAPI_FS_UNINSTALL_APPLICATIONS = 1024;
// Device supports extended File System operations (e.g. Copy folder).
public const int CONAPI_FS_EXTENDED_OPERATIONS = 2048;
// Definitions used in CONASetDeviceListOption function
// Option types:
// pstrValue contains the manufacturer name
public const int DMAPI_OPTION_SET_MANUFACTURER = 1;
// ----------------------------------------------------
// DeviceNotifyCallbackFunction
//
// This is the function prototype of the callback method
//
// DWORD DeviceNotifyCallbackFunction( DWORD dwStatus, WCHAR* pstrSerialNumber);
//
// Status value uses the following format:
//
// ----------------DWORD------------------
// WORD for info WORD for status
// 0000 0000 0000 0000 0000 0000 0000 0000
//
// Status value is the one of the values defined below describing main reason for the notification.
// Info part consist of two parts:
// LOBYTE: Info part contains change info value. See info values below.
// HIBYTE: Info data value. Depends of info value.
// See info value definitions for more information.
// Use predefined macros to extract needed part from the status value.
//
public delegate int DeviceNotifyCallbackDelegate(
int iStatus,
[MarshalAs(UnmanagedType.LPWStr)] string pstrSerialNumber
);
//Device callback status values
// List is updated. No any specific information.
public const int CONAPI_DEVICE_LIST_UPDATED = 0;
// A new device is added to the list.
public const int CONAPI_DEVICE_ADDED = 1;
// Device is removed from the list.
public const int CONAPI_DEVICE_REMOVED = 2;
// Device is updated. A connection is added or removed
public const int CONAPI_DEVICE_UPDATED = 4;
// Device callback info values
// Note! HIBYTE == media, LOBYTE == CONAPI_CONNECTION_ADDED
public const int CONAPI_CONNECTION_ADDED = 1;
// Note! HIBYTE == media, LOBYTE == CONAPI_CONNECTION_REMOVED
public const int CONAPI_CONNECTION_REMOVED = 2;
// Friendly name of the device is changed
public const int CONAPI_DEVICE_RENAMED = 4;
// Device callback macros
public static int GET_CONAPI_CB_STATUS(int iStatus)
{
return (65535 & iStatus);
}
public static int GET_CONAPI_CB_INFO(int iStatus)
{
return ((16711680 & iStatus) >> 16);
}
public static int GET_CONAPI_CB_INFO_DATA(int iStatus)
{
return ((-16777216 + iStatus) >> 24);
}
// ----------------------------------------------------------------------
// DeviceSearchOperationCallbackFunction
//
// Description
// Device Search operation callback functions are defined as:
// DWORD (DeviceSearchOperationCallbackFunction)(DWORD dwState,
// CONAPI_CONNECTION_INFO* pConnInfoStructure)
//
// The Connectivity API calls this function at least every time period
// (or if the System has found the device during this time) and adds one
// to the function state value. The used time period counted by using
// dwSearchTime parameter. E.g. If dwSearchTime paramater value is 240,
// time period (240/100) is 2.4 seconds.
// If the function state is 100 and any device does not have found during
// this (dwSearchTime) time the CONASearchDevices function fails with the
// error code ECONA_FAILED_TIMEOUT.
//
// Parameters
// dwState [in] Function state (0-100%).
// pConnInfoStructure [in] Reserved for future use, the value is NULL.
//
// Return values
// The Connectivity API-user must return the CONA_OK value. If the callback
// function returns the error code ECONA_CANCELLED to the Connectivity API,
// the CONASearchDevices function will be cancelled with the error code ECONA_CANCELLED.
//
// Type definition:
public delegate int SearchCallbackDelegate(
int iState,
System.IntPtr pConnInfoStructure
);
//================================
// File system API definitions
//===============================
//Used for changing current folder:
public const string GO_TO_ROOT_FOLDER = "\\\\";
public const string GO_TO_PARENT_FOLDER = "..\\";
public const string FOLDER_SEPARATOR = "\\";
//Options for CONADeleteFolder:
public const int CONA_DELETE_FOLDER_EMPTY = 0;
public const int CONA_DELETE_FOLDER_WITH_FILES = 1;
//Direction options for CONACopyFile and CONAMoveFile:
public const int CONA_DIRECT_PHONE_TO_PC = 2;
public const int CONA_DIRECT_PC_TO_PHONE = 4;
// Not used at the moment.
public const int CONA_DIRECT_PHONE_TO_PHONE = 8;
//Other options for CONACopyFile and CONAMoveFile:
public const int CONA_OVERWRITE = 16;
// Used only with CONACopyFile
public const int CONA_RENAME = 32;
// Not used at the moment.
public const int CONA_TRANSFER_ALL = 64;
//Options for CONAFindBegin:
public const int CONA_FIND_USE_CACHE = 128;
//Attribute defines for CONAPI_FOLDER_INFO and CONAPI_FILE_INFO structures:
//Both structure
public const int CONA_FPERM_READ = 256;
//Both structure
public const int CONA_FPERM_WRITE = 512;
//Both structure
public const int CONA_FPERM_DELETE = 1024;
//Only for CONAPI_FOLDER_INFO
public const int CONA_FPERM_FOLDER = 2048;
//Only for CONAPI_FOLDER_INFO
public const int CONA_FPERM_DRIVE = 4096;
// Only for CONAPI_FOLDER_INFO2
public const int CONA_FPERM_HIDDEN = 8192;
// Only for CONAPI_FOLDER_INFO2
public const int CONA_FPERM_ROOT = 16384;
//Options for CONAGetFolderInfo
// Gets target folder info
public const int CONA_GET_FOLDER_INFO = 1;
// Gets target folder info and contents
public const int CONA_GET_FOLDER_CONTENT = 2;
// Gets target folder info, content and sub folder(s) contents also
public const int CONA_GET_FOLDER_AND_SUB_FOLDERS_CONTENT = 4;
// Compare exist folder content. If change has happened, updates content
public const int CONA_COMPARE_AND_UPDATE_IF_NEEDED = 256;
//Used only with CONAInstallApplication
// and returns CONA_OK_UPDATED. If no change, returns CONA_OK.
public const int CONA_DEFAULT_FOLDER = 65536;
//Used only with CONAInstallApplication
public const int CONA_INFORM_IF_USER_ACTION_NEEDED = 131072;
//Used only with CONAInstallApplication
public const int CONA_WAIT_THAT_USER_ACTION_IS_DONE = 262144;
// Used only with CONAReadFileInBlocks and CONAWriteFileInBlocks
public const int CONA_USE_IF_NOTICATION = 16777216;
// Used only with CONAReadFileInBlocks and CONAWriteFileInBlocks
public const int CONA_USE_CB_NOTICATION = 33554432;
// Used only with CONAReadFileInBlocks
public const int CONA_NOT_SET_FILE_DETAILS = 67108864;
// Used only with IFSAPIBlockNotify and CONABlockDataCallbackFunction
public const int CONA_ALL_DATA_SENT = 134217728;
//Used only with IFSAPIBlockNotify and CONABlockDataCallbackFunction
public int CONA_IS_ALL_DATA_RECEIVED(int iState)
{
return ((iState >> 27) & 1);
}
// ----------------------------------------------------
// Folder info structure
public struct CONAPI_FOLDER_INFO
{
[MarshalAs(UnmanagedType.LPWStr)]
// Folder or Drive name
public string pstrName;
// Folder or Drive type and permission
public int iAttributes;
// Folder time
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -