亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? windowssyncsource.cpp

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? CPP
字號(hào):
/*
 * 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 General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 * 02111-1307  USA
 */
#include "pim/WindowsSyncSource.h"
#include "spds/SyncItemStatus.h"
#include "base/util/utils.h"
#include "base/Log.h"
#include "pim/POOMClient2Server.h"
#include "pim/POOMServer2Client.h"
#include "spdm/errors.h"
#include "notify/timed_msgbox.h"
#include "events/SyncSourceListenerClient.h"
#include "OutOfMemoryException.h"


#define ASK_REFRESH_PIM_MESSAGE TEXT("All the local %s will be deleted before adding the server items. Are you sure you want to continue?")
#define ASK_REFRESH_PIM_TIMEOUT 10

WindowsSyncSource::WindowsSyncSource(const wchar_t* name, SyncSourceConfig* sc) : 
                                     SyncSource(name, sc) {
    c = NULL;
    setPath(TEXT("\\"));
    syncItem = NULL;
    itemError = FALSE;
    friendlyName[0] = 0;  // char 64
    newFromServer = 0;
    updatedFromServer = 0;
    deletedFromServer = 0;
    mimeType = "";
    isSif = false;
    oid_hash.clear();
}

WindowsSyncSource::~WindowsSyncSource() {
    if (c) {
        delete c;
        c = NULL;
    }
    if (syncItem) {
        syncItem = NULL;
    }
    oid_hash.clear();
}

void WindowsSyncSource::setType(SourceType t) {
    type = t;
}

SourceType WindowsSyncSource::getType() {
    return type;
}

void WindowsSyncSource::setMimeType(string t) {
    mimeType = t;
}

string WindowsSyncSource::getMimeType() {
    return mimeType;
}

void WindowsSyncSource::setPath(const wchar_t* p) {
    if (p == NULL) {
        path = wstrdup(TEXT(""));
    }
    else {
        path = wstrdup(p);
    }

}

wchar_t* WindowsSyncSource::getPath() {
    return path;
}

/*
* Return the first SyncItem of all. It is used in case of slow or refresh sync
* and retrieve the entire data source content.
*/

SyncItem* WindowsSyncSource::getFirstItem() {

    if (syncItem) {
        syncItem = NULL;
    }

    if (c == NULL) {
        c = new Container();
    }    

    
    setAllItemsPOOM(c, getType(), getPath()); // olFolderContact = 10

    LOG.info("The client number of %s to sync are %i", friendlyName, c->getAllItemsSize());

    // send nr of items message to UI
    HWND wnd = HwndFunctions::getWindowHandle();
    if(wnd)
        SendMessage(wnd, ID_MYMSG_TOTAL_ITEMS,(WPARAM) -1, c->getAllItemsSize());


    if (c->getAllItemsSize() == 0) {
        return NULL;
    }
    
    isSif = isSIF(getMimeType());

    ArrayList* list = c->getAllItems();
    syncItem = (SyncItem*)((SyncItem*)list->front())->clone();
    fillSyncItem(syncItem, getType(), isSif, oid_hash);
    return syncItem;
}

/*
* Return the next SyncItem of all. It is used in case of slow or refresh sync
* and retrieve the entire data source content.
*/

SyncItem* WindowsSyncSource::getNextItem() {

    if (syncItem) {
        syncItem = NULL;
    }

    if (c == NULL){
        LOG.error("getNextItem: container is null.");
        return NULL;
    }

    if (c->getAllItemsSize() == 0){
        LOG.error("getNextItem: container is null.");
        return NULL;
    }

    SyncItem *next = (SyncItem*)(c->getAllItems()->next());
    if (next) {
        syncItem = (SyncItem*)next->clone();
        fillSyncItem(syncItem, getType(), isSif, oid_hash);
    }
    return syncItem;
}

/*
* This method is always called by the sync manager. So the setModifiedItemsPOOM is always called
*/

SyncItem* WindowsSyncSource::getFirstNewItem() {

    if (syncItem) {
        syncItem = NULL;
    }

    if (c == NULL) {
        c = new Container();
    }
    
    isSif = isSIF(getMimeType());

    setModifiedItemsPOOM(c, getType(), getPath(), isSif, oid_hash); // olFolderContact = 10

    //Log the number of item to sync from client
    LOG.info("The client number of new %s to sync are %i", friendlyName, c->getNewItemsSize());
    LOG.info("The client number of updated %s to sync are %i", friendlyName, c->getUpdatedItemsSize());
    LOG.info("The client number of deleted %s to sync are %i", friendlyName, c->getDeletedItemsSize());

    if (c->getNewItemsSize() == 0) {
        return NULL;
    }

    // send nr of items message to UI
    HWND wnd = HwndFunctions::getWindowHandle();
    if(wnd) {
         SendMessage(wnd, ID_MYMSG_TOTAL_ITEMS,(WPARAM) -1,
                     c->getNewItemsSize()+
                     c->getUpdatedItemsSize()+
                     c->getDeletedItemsSize());
     }

    ArrayList* list = c->getNewItems();
    return (SyncItem*)list->front()->clone();

}

SyncItem* WindowsSyncSource::getFirstItemKey() {

    int deleted = deleteAllItems(getType());

    // reset the deleted item number.
    deletedFromServer = 0;

    if (c) { delete c; c = NULL; }
    return NULL;
}

SyncItem* WindowsSyncSource::getNextItemKey() {
    return NULL;
}

SyncItem* WindowsSyncSource::getNextNewItem() {

    if (syncItem) {
        //delete syncItem; syncItem = NULL;
        syncItem = NULL;
    }

    if (c == NULL) {
        LOG.error("getNextNewItem: container is null.");
        return NULL;
    }

    SyncItem *next = (SyncItem*)c->getNewItems()->next();
    if (next) {
        syncItem = (SyncItem*)next->clone();
    }

    return syncItem;
}

SyncItem* WindowsSyncSource::getFirstUpdatedItem() {

    if (syncItem) {
        syncItem = NULL;
    }

    if (c == NULL) {
        c = new Container();
    }

    if (c->getUpdatedItemsSize() == 0) {
        return NULL;
    }

    ArrayList* list = c->getUpdatedItems();
    return (SyncItem*)list->front()->clone();

}

SyncItem* WindowsSyncSource::getNextUpdatedItem() {

    if (syncItem) {
        syncItem = NULL;
    }

    if (c == NULL) {
        LOG.error("getNextUpdatedItem: container is null.");
        return NULL;
    }

    SyncItem *next = (SyncItem*)c->getUpdatedItems()->next();
    if (next) {
        syncItem = (SyncItem*)next->clone();
    }
    return syncItem;
}

SyncItem* WindowsSyncSource::getFirstDeletedItem() {

    if (c == NULL) {
        c = new Container();
    }

    if (c->getDeletedItemsSize() == 0) {
        return NULL;
    }
    ArrayList* list = c->getDeletedItems();

    return (SyncItem*)list->front()->clone();
}

SyncItem* WindowsSyncSource::getNextDeletedItem() {

    if (syncItem) {
        syncItem = NULL;
    }

    if (c == NULL) {
        LOG.error("getNextDeletedItem: container is null.");
        return NULL;
    }

    SyncItem *next = (SyncItem*)c->getDeletedItems()->next();
    if (next) {
        syncItem = (SyncItem*)next->clone();
    }
    return syncItem;
}

void WindowsSyncSource::setItemStatus(const wchar_t* key, int status) {
    LOG.debug("key: %ls, status: %i", key, status);
    if (status > 299 && status != 418 && status != 419)
        itemError = TRUE;
    else
        itemError = FALSE;
}

int WindowsSyncSource::addItem(SyncItem& item) {

    int ret = STC_COMMAND_FAILED; // command Failed;
    long oid = 0;
    if (!isMemoryAvailable()) {
        LOG.error(LOW_DEVICE_MEMORY);
        throw OutOfMemoryException(0, -50);  //defined in startsync //return ret;
    }
    
    isSif = isSIF(item.getDataType());
    long h = manageNewItems(&item, getType(), &oid, getPath(), isSif, oid_hash);

    wchar_t tmp[256];
    if (h == 0) {
        ret = STC_ITEM_ADDED;
        LOG.debug("Added item: %ls LUID: %i", item.getKey(), oid);
        wsprintf(tmp, TEXT("%i"), oid);
        item.setKey(tmp);

        newFromServer++;
    }
    return ret;
}

int WindowsSyncSource::updateItem(SyncItem& item) {

    int ret = STC_COMMAND_FAILED; // command Failed;

    if (!isMemoryAvailable()) {
        LOG.error(LOW_DEVICE_MEMORY);
        throw OutOfMemoryException(0, -50);    //defined in startsync //return ret;
    }
    isSif = isSIF(item.getDataType());
    long h = manageUpdatedItems(&item, getType(), getPath(), isSif, oid_hash);

    if (h == 0) {
        ret = STC_OK;
        LOG.debug("updated item: %ls", item.getKey());

        updatedFromServer++;
    }
    return ret;
}

int WindowsSyncSource::deleteItem(SyncItem& item) {
    int ret = STC_COMMAND_FAILED; // command Failed;
    long h = manageDeletedItems(&item, getType(), oid_hash);

    if (h == 0) {
        ret = STC_OK;
        LOG.debug("deleted item: %ls", item.getKey());

        deletedFromServer++;
    }
    return ret;
}

int WindowsSyncSource::beginSync() {
    /*
    OL_CONTACTS     = 10,
    OL_CALENDAR     = 9,
    OL_TASK         = 13,
    OL_BRIEFCASE    = 600,
    OL_NOTES        = 601,
    OL_FAVORITES    = 602
    */

    if (getType() == OL_CONTACTS)
    {
        strcpy(friendlyName, "contacts");
    }
    else if (getType() == OL_CALENDAR)
    {
        strcpy(friendlyName, "calendars");
        normalizeAllExceptions();
    }
    else if (getType() == OL_TASK)
    {
        strcpy(friendlyName, "tasks");
    }

    // counter to get the number of items from server
    newFromServer = 0;
    updatedFromServer = 0;
    deletedFromServer = 0;

    return 0;
}

int WindowsSyncSource::endSync() {

    writeCurrentItems(getType(), getPath(), oid_hash);

    //
    //
    // from 6.0: dispose the outlook application
    disposeOutlookApp();

    if (TRUE == itemError) {
        return ERR_ITEM_ERROR;
    }
    else {
        //Log the number of item synced from server
        LOG.info("The server number of new %s synced are %i", friendlyName, newFromServer);
        LOG.info("The server number of updated %s synced are %i", friendlyName, updatedFromServer);
        LOG.info("The server number of deleted %s synced are %i", friendlyName, deletedFromServer);

        return 0;
    }
}

void WindowsSyncSource::assign(WindowsSyncSource& s) {
    setSyncMode(s.getSyncMode());
    setLastSync(s.getLastSync());
    setNextSync(s.getNextSync());
    setLastAnchor(s.getLastAnchor());
    setNextAnchor(s.getNextAnchor());
    setFilter(s.getFilter());
    setPath(getPath());
    setType(getType());
    setReport(s.getReport());   
    setMimeType(s.getMimeType());
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品18久久久久久久久| 综合av第一页| 51精品视频一区二区三区| 在线视频综合导航| 色综合天天做天天爱| 99久久精品免费观看| 99精品欧美一区| 91成人网在线| 91精品国产乱| 精品国产伦一区二区三区观看体验| 久久久综合视频| 欧美经典三级视频一区二区三区| 国产亚洲欧美激情| 亚洲视频你懂的| 舔着乳尖日韩一区| 国内精品视频666| 波多野结衣的一区二区三区| av高清久久久| 在线日韩av片| 日韩精品一区二区三区视频| 欧美极品少妇xxxxⅹ高跟鞋| 亚洲老妇xxxxxx| 日韩精品三区四区| 国产精品77777| 日本乱人伦一区| 欧美成人aa大片| 亚洲欧洲精品成人久久奇米网| 亚洲午夜av在线| 国产成人综合在线观看| 欧美在线一二三四区| 国产亚洲美州欧州综合国| 亚洲精品国产a| 韩日av一区二区| 91福利社在线观看| 久久午夜色播影院免费高清 | 亚洲综合在线免费观看| 婷婷开心久久网| 欧美日本视频在线| 久久精品免视看| 亚洲va国产va欧美va观看| 国产精品一区二区三区乱码| 在线观看日韩毛片| 国产亚洲视频系列| 天天色 色综合| 99热99精品| 国产亚洲一二三区| 日韩av中文字幕一区二区三区| 成人黄色电影在线| 欧美mv日韩mv亚洲| 亚洲成av人片一区二区梦乃| 成人永久免费视频| 精品久久久久久久久久久久包黑料| 18欧美亚洲精品| 国产99久久久精品| 久久伊99综合婷婷久久伊| 亚洲va欧美va人人爽午夜| 99re视频这里只有精品| 欧美国产精品一区| 国产一区不卡在线| 精品久久久久久久人人人人传媒 | 成人精品视频一区二区三区| 91精品国产麻豆| 天天综合天天做天天综合| 91麻豆自制传媒国产之光| 中文字幕欧美激情| 高清在线不卡av| 国产免费观看久久| 岛国av在线一区| 久久久久久免费| 国产成人综合视频| 中文字幕精品一区| 成人av电影免费观看| 国产校园另类小说区| 高清国产午夜精品久久久久久| 久久免费午夜影院| 风间由美性色一区二区三区| 国产亚洲欧美日韩日本| 国产成人aaaa| 国产精品国产馆在线真实露脸| 成人av电影免费观看| 亚洲色图欧洲色图| 欧美日韩一二三区| 蜜臀av一区二区三区| 久久亚洲影视婷婷| 福利一区在线观看| 亚洲视频精选在线| 欧美日韩一本到| 麻豆成人免费电影| 国产婷婷一区二区| 色老汉av一区二区三区| 亚洲成人av资源| 亚洲精品一区二区在线观看| 国产一区二区三区四| 国产精品午夜电影| 91蝌蚪porny九色| 日韩综合在线视频| 久久蜜桃香蕉精品一区二区三区| 成人免费看片app下载| 亚洲一区免费在线观看| 欧美一区二区三区四区高清| 激情欧美一区二区三区在线观看| 中文字幕av一区二区三区高| 在线视频你懂得一区| 精品一区二区在线视频| 中文字幕欧美一区| 宅男在线国产精品| www.亚洲精品| 首页国产丝袜综合| 国产精品理论片| 欧美色国产精品| 国产福利视频一区二区三区| 亚洲综合丁香婷婷六月香| 日韩精品在线一区二区| 色综合一区二区| 国产乱一区二区| 香蕉av福利精品导航| 欧美国产精品专区| 欧美成人精品高清在线播放| 91亚洲精品久久久蜜桃网站| 免费看欧美女人艹b| 国产69精品久久777的优势| 亚洲成人一二三| 中文字幕中文字幕在线一区 | 中文字幕一区二区三区在线观看 | 亚洲乱码国产乱码精品精小说| 制服丝袜中文字幕一区| 99久免费精品视频在线观看| 奇米精品一区二区三区在线观看一 | 国产精品乱人伦一区二区| 337p亚洲精品色噜噜狠狠| 99久久777色| 国产精品一级黄| 日本三级韩国三级欧美三级| 亚洲乱码中文字幕| 一区二区中文视频| 国产女主播一区| 久久精品视频一区二区三区| 欧美天堂一区二区三区| 99久久精品国产麻豆演员表| 国产原创一区二区三区| 久久99精品一区二区三区| 日韩精品电影在线| 亚洲成人av资源| 亚洲午夜电影网| 亚洲一区二区在线免费看| 亚洲欧美日韩国产综合| 国产精品久久一卡二卡| 中国色在线观看另类| 久久久久国产精品人| 亚洲精品一区二区精华| 欧美成人乱码一区二区三区| 日韩精品一区二区三区中文精品 | 韩国精品久久久| 日本免费新一区视频| 日本亚洲免费观看| 欧美在线视频你懂得| 欧美视频中文字幕| 欧美美女一区二区三区| 3atv在线一区二区三区| 日韩三级视频在线观看| 精品国产乱码久久久久久久久| 日韩你懂的电影在线观看| 精品国产区一区| 中文字幕不卡的av| 一区二区三区中文在线| 亚洲永久免费av| 美腿丝袜在线亚洲一区| 国内一区二区视频| 不卡av免费在线观看| 欧美亚洲禁片免费| 日韩欧美国产小视频| 欧美韩日一区二区三区四区| 国产精品动漫网站| 午夜精品久久久久久久99水蜜桃 | 国产一区二区精品久久| 国产成人av电影在线播放| 国产69精品久久久久777| 99精品欧美一区二区三区小说 | 精品久久久久久久久久久院品网 | 麻豆国产精品视频| 成人精品国产免费网站| 欧美综合一区二区三区| 91精品国产一区二区三区蜜臀| 久久婷婷色综合| 一区二区三区国产精华| 美女脱光内衣内裤视频久久网站| 成人在线综合网| 欧美精品1区2区3区| 国产午夜精品理论片a级大结局| 亚洲视频香蕉人妖| 激情亚洲综合在线| 91精品91久久久中77777| 欧美白人最猛性xxxxx69交| 中文字幕亚洲不卡| 美女一区二区久久| 欧洲另类一二三四区| 中文字幕乱码一区二区免费| 琪琪久久久久日韩精品| 91丨九色丨蝌蚪丨老版| 精品不卡在线视频|