settingfunctions.h

来自「funambol window mobile客户端源代码」· C头文件 代码 · 共 259 行

H
259
字号
/*
 * Funambol is a mobile platform developed by Funambol, Inc. 
 * Copyright (C) 2003 - 2007 Funambol, Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by
 * the Free Software Foundation with the addition of the following permission
 * added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
 * WORK IN WHICH THE COPYRIGHT IS OWNED BY FUNAMBOL, FUNAMBOL DISCLAIMS THE
 * WARRANTY OF NON INFRINGEMENT  OF THIRD PARTY RIGHTS.
 * 
 * This program 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 General Public License for more 
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program; if not, see http://www.gnu.org/licenses or write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301 USA.
 * 
 * You can contact Funambol, Inc. headquarters at 643 Bair Island Road, Suite
 * 305, Redwood City, CA 94063, USA, or at email address info@funambol.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License
 * version 3, these Appropriate Legal Notices must retain the display of the
 * "Powered by Funambol" logo. If the display of the logo is not reasonably
 * feasible for technical reasons, the Appropriate Legal Notices must display
 * the words "Powered by Funambol".
 */

#ifndef INCL_SETTINGSFUNCTIONS
    #define INCL_SETTINGSFUNCTIONS

    #include "pim/Utils.h"
    #include "customization.h"

    #include <Tapi.h>
    #include <Extapi.h>     //for LINEGENERALINFO

    #define PROPERTY_SPDM_REMOTE_SETTINGS   TEXT("spdm.showRemoteSettings")
    #define PROPERTY_REMOTE_SETTINGS        "showRemoteSettings"

    #define PROPERTY_SPDM_LOG_LEVEL         TEXT("spdm.logLevel")

    #define PROPERTY_SPDM_ENCRYPT           TEXT("spdm.encryption")
    #define PROPERTY_SPDM_MAX_MSG_SIZE      TEXT("spdm.maxMsgSize")
    #define PROPERTY_SPDM_READ_BUFFER_SIZE  TEXT("spdm.readBufferSize")

    #define PROPERTY_SPDM_PATH_INFO         TEXT("spdm.path")
    #define PROPERTY_PATH_INFO              "path"

    #define PROPERTY_SPDM_PUSH_NOTIFICATION TEXT("spdm.push")

    #define PROPERTY_SPDM_NOTIFICATION_PORT TEXT("spdm.port")
    #define PROPERTY_NOTIFICATION_PORT      "pushPort"

    #define PROPERTY_SPDM_SMS_WAP_PUSH      TEXT("spdm.sms")
    #define PROPERTY_SMS_WAP_PUSH           "sms"

    #define PROPERTY_SPDM_PID               TEXT("spdm.pid")
    #define PROPERTY_PID                    "pid"

    #define PROPERTY_SPDM_POLLING_NOTIFICATION  TEXT("spdm.polling")

    #define PROPERTY_SPDM_SERVER_NOTIFIED   TEXT("spdm.svrNotified")
    #define PROPERTY_SERVER_NOTIFIED        "svrNotified"

    #define PROPERTY_SPDM_CONTACT_OLD_CRC   TEXT("spdm.calculateContactOldCrc")
    #define PROPERTY_CONTACT_OLD_CRC        "calculateContactOldCrc"

    #define PROPERTY_SPDM_EVENT_OLD_CRC     TEXT("spdm.calculateEventOldCrc")
    #define PROPERTY_EVENT_OLD_CRC          "calculateEventOldCrc"

    #define PROPERTY_SPDM_TASK_OLD_CRC     TEXT("spdm.calculateTaskOldCrc")
    #define PROPERTY_TASK_OLD_CRC          "calculateTaskOldCrc"  

    #define PROPERTY_SOURCE_SPDM_USE_SIF    TEXT("spdm.useSIF")
    #define PROPERTY_SOURCE_USE_SIF         "useSIF"

    #define PROPERTY_SOURCE_SPDM_SYNC       TEXT("spdm.sync"     )
    #define PROPERTY_SOURCE_SPDM_DIR        TEXT("spdm.dir"      )
    #define PROPERTY_SOURCE_SPDM_URI        TEXT("spdm.uri"      )
    #define PROPERTY_SOURCE_SPDM_SYNC_MODES TEXT("spdm.syncModes")
    #define PROPERTY_SOURCE_SPDM_LAST       TEXT("spdm.last"     )

    #define DIM_MANAGEMENT_PATH             512
    #define DIM_DEVICE_ID                   50

    #define APPOINTMENTS_CONTEXT            ROOT_CONTEXT "/spds/sources/appointments"
    #define CONTACTS_CONTEXT                ROOT_CONTEXT "/spds/sources/contacts"
    #define TASKS_CONTEXT                   ROOT_CONTEXT "/spds/sources/tasks"

    #define SOURCES_CONTEXT                 ROOT_CONTEXT "/spds/sources"

    #define PROPERTY_SOURCE_DIR             "dir"

    #define PROPERTY_SOURCE_SPDM_INBOX      TEXT("spdm.Inbox")
    #define PROPERTY_SOURCE_SPDM_OUTBOX     TEXT("spdm.Outbox")
    #define PROPERTY_SOURCE_SPDM_DRAFT      TEXT("spdm.Draft")
    #define PROPERTY_SOURCE_SPDM_SENT       TEXT("spdm.Sent")
    #define PROPERTY_SOURCE_SPDM_TRASH      TEXT("spdm.Trash")

    #define PROPERTY_SOURCE_SPDM_DOWNLOAD_AGE   TEXT("spdm.downloadAge")
    #define PROPERTY_SOURCE_SPDM_BODY_SIZE      TEXT("spdm.bodySize")
    #define PROPERTY_SOURCE_SPDM_ATTACH_SIZE    TEXT("spdm.attachSize")

    //
    // comes from vb parameter. left into wchar mode
    //
    #define SPDM_SYNCURL        TEXT("spdm.syncURL")
    #define SPDM_SERVERNAME     TEXT("spdm.serverName")
    #define SPDM_PASSWORD       TEXT("spdm.password")
    #define SPDM_USERNAME       TEXT("spdm.username")
    #define SPDM_DEVICEID       TEXT("spdm.deviceId")

    #define FAST                TEXT("fast")
    #define TWO_WAY             TEXT("two-way")
    #define SLOW                TEXT("slow")
    #define NONE                TEXT("none");

    #define SYNC_CONTACTS       TEXT("sync.contacts")
    #define SYNC_APPOINTMENTS   TEXT("sync.appointments")
    #define SYNC_TASKS          TEXT("sync.tasks")
    #define SYNC_FILES          TEXT("sync.files")
    #define SYNC_NOTES          TEXT("sync.notes")
    #define SYNC_FAVORITES      TEXT("sync.favorites")
    #define SYNC_MAILS          TEXT("sync.mails")

    #define HTTP_HEADER         TEXT("http://")
    #define HTTPS_HEADER        TEXT("https://")


    //--- tapi defines
    #define TAPI_API_LOW_VERSION   0x00020000
    #define TAPI_API_HIGH_VERSION  0x00020000
    #define CAPS_BUFFER_SIZE    512
    #define EXT_API_LOW_VERSION 0x00010000
    #define EXT_API_HIGH_VERSION 0x00010000

    #define ARRAY_LENGTH(x)         (sizeof(x)/sizeof((x)[0]))
    #define TAPI_API_LOW_VERSION    0x00020000
    #define TAPI_API_HIGH_VERSION   0x00020000
    #define EXT_API_LOW_VERSION     0x00010000
    #define EXT_API_HIGH_VERSION    0x00010000
    #define HUGE_BUFFER             4096
    #define CELLTSP_LINENAME_STRING (L"Cellular Line")

    /*------------------ methods -----------------*/

    /*
    * Get the unique Device Identifier from PPC 2002 - 2003
    * see more at http://www.pocketpcdn.com/articles/serial_number2002.html
    *
    * @param deviceId     : the retrieved device id
    */

    wstring GetSerialNumberFromKernelIoControl();

    /*
    * Method to get communication settings from device.
    * @param name  : name of the property to retrieve value of
    * @param value : value of the property
    */

    DWORD WINAPI getConfigParameter (wchar_t* name, wchar_t* value);

    /*
    * Method to set communication settings into device. The parameters are retrieved by Visual Basic interface
    *
    * @param username     : user name
    * @param password     : user password
    * @param syncURL      : synchronization url
    * @param serverName   : the server uri used to address the sync server
    * @param errorMsg     : the returned message to vb interface
    */

    DWORD WINAPI setConfigParameters(wchar_t *username, wchar_t* password,
                                 wchar_t* syncURL, wchar_t* serverName, wchar_t* errorMsg);



    /*
    * Method to get the synchronization setting parameters.
    *
    * @param sourceName     : source name of which get parameter's value
    * @param propertyName   : name of property
    * @param propertyValue  : value of property
    */

    DWORD WINAPI getSourceParameter (LPWSTR sourceName, LPWSTR propertyName,  LPWSTR propertyValue);



    /*
    * Method to set the synchronization setting parameters.
    *
    * @param sourceName     : source name of which get parameter's value
    * @param propertyName   : name of property
    * @param propertyValue  : value of property
    * @param errorMsg       : returned error message
    */

    DWORD WINAPI setSourceParameters (wchar_t* sourceName, wchar_t* propertyName,
                                      wchar_t* propertyValue, wchar_t* errorMsg);


    /*
    * Method to get the client configurations. These property are set by installing process.
    * These are extra parameters not used in synchronization process
    * but are needed for example to show or hide some fields in GUI interface.
    *
    * @param sourceName     : source name of which get parameter's value
    * @param propertyName   : name of property
    * @param propertyValue  : value of property
    */

    DWORD WINAPI getClientConfiguration  (wchar_t* sourceName, wchar_t* propertyName,
                                            wchar_t* propertyValue);

    DWORD getClientConfigurationInternal (wchar_t* sourceName, const wchar_t* propertyName,
                                            wchar_t* propertyValue, BOOL isFromVB);

    DWORD WINAPI setClientConfiguration(wchar_t* sourceName, wchar_t* propertyName,
                                     wchar_t* propertyValue, wchar_t* errorMsg);



    //----------- find smartphone IMEI -----------------------------

    // ***************************************************************************
    // Function Name: GetTSPLineDeviceID
    //
    // Purpose: To get a TSP Line Device ID
    //
    // Arguments:
    //  hLineApp = the HLINEAPP returned by lineInitializeEx
    //  dwNumberDevices = also returned by lineInitializeEx
    //  dwAPIVersionLow/High = min version of TAPI that we need
    //  psTSPLineName = "Cellular Line"
    //
    // Return Values: Current Device ID
    //
    // Description:
    //  This function returns the device ID of a named TAPI TSP.  The Device ID is
    //  used in the call to lineOpen

    DWORD GetTSPLineDeviceID(const HLINEAPP hLineApp,   const DWORD dwNumberDevices,
        const DWORD dwAPIVersionLow,      const DWORD dwAPIVersionHigh,
        const TCHAR* const psTSPLineName);

    wstring getIMEI();

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?