📄 syncsourcelistenerclient.cpp
字号:
/*
* 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 "event/SyncSourceListener.h"
#include "event/SyncSourceEvent.h"
#include "event/constants.h"
#include "event/ManageListener.h"
#include "events/SyncSourceListenerClient.h"
#include "event/SyncEvent.h"
#include "HwndFunctions.h"
SyncSourceListenerClient::SyncSourceListenerClient() : SyncSourceListener()
{
sc = 0;
}
void SyncSourceListenerClient::syncSourceBegin(SyncSourceEvent &event) {
HWND wnd = HwndFunctions::getWindowHandle();
if(wnd)
SendMessage(HwndFunctions::wnd, ID_MYMSG_STARTING_SOURCE, NULL, sourceNameToId(event.getSourceName()));
}
void SyncSourceListenerClient::syncSourceEnd(SyncSourceEvent &event)
{
if (HwndFunctions::wnd)
SendMessage(HwndFunctions::wnd, ID_MYMSG_ENDING_SOURCE, NULL, NULL);
}
void SyncSourceListenerClient::syncSourceSyncModeRequested(SyncSourceEvent &event) {
wchar_t* t = toWideChar(event.getSourceName());
setSyncMode(t, event.getSyncMode());
delete [] t; t = NULL;
}
void SyncSourceListenerClient::setSyncMode(wstring sourcename, long mode) {
sc->sourcenames.push_back(sourcename);
sc->modes.push_back(mode);
}
void SyncSourceListenerClient::syncSourceTotalClientItems (SyncSourceEvent& event) {
}
void SyncSourceListenerClient::syncSourceTotalServerItems (SyncSourceEvent& event) {
int source = sourceNameToId(event.getSourceName());
if(source != -1)
{
// send the total number of server items to sync
if(HwndFunctions::wnd)
SendMessage(HwndFunctions::wnd, ID_MYMSG_TOTAL_ITEMS,(WPARAM) source,(LPARAM) event.getData());
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -