maincpp.h
来自「funambol window mobile客户端源代码」· C头文件 代码 · 共 163 行
H
163 行
/*
* 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_MAINCPP
#define INCL_MAINCPP
#define OUT_MESSAGE_NOT_SENT TEXT("It is impossible to send the email. ")
#define ONE_OUT_MESSAGE_NOT_SENT TEXT("It is impossible to send the email. Please check it and try again.")
#define MORE_OUT_MESSAGE_NOT_SENT TEXT("It is impossible to send the emails. Please check them and try again.")
#define OUT_MESSAGE_TIMEOUT 5
#define CTP_QUEUE_PUSH "queuePush"
#define CTP_QUEUE_LIST "queueList"
#define CP_PUSH_LIST "clientPushList"
#define CP_PID "clientPushPID"
#define ERR_CONFIG_SOURCE_NOT_FOUND 2100 // 404 on configSyncSource: captured and converted in 2100
#include <windows.h>
#include "base/Log.h"
#include "spds/constants.h"
#include <vector>
using namespace std;
/*
* Entry point to kickoff the synchronization process, both specifying the
* sources or not. The default is to make all the configured sources.
*
* @param path : the install path of the SyncClient PIM application on
* the device
* @param sources : NULL terminated array of strings containing the source
* name of the sources to synchronize
* @param ids : NULL terminated array of strings containing the id of the mail
* that must be synched with a INCLUSIVE filter. Note that this parameter
* could be valorized only when there is only a source and this source is mail
* @param mode: the sync mode used for the sync if imposed by the client
*/
DWORD WINAPI synchronize (const wchar_t* path,
const wchar_t** sources,
const wchar_t** ids,
const char* mode);
/*
* get the log level set into client properties
*/
LogLevel getLOGLevel();
//BOOL startPolling();
//int startSync(time_t timeout);
//unsigned long startSyncPid(time_t timeout);
//int checkPid(long pid);
DWORD checkStartSync();
//void setNameOfSourceForSlow(const char* ss);
int operatorNewHandler(size_t size);
/**
* It needs to clean up all the items for the sources in the vector.
* Used instead of the recover-from-server sync mode.
*/
DWORD WINAPI cleanupAllItems (vector<const wchar_t*> sources);
wchar_t** readQueueList();
void updateQueueList(const wchar_t** sources);
/**
* Reads the property 'clientPushList' from Win registry and returns a
* NULL terminated array of source names to sync (new buffer).
* The 'clientPushList' is NOT cleared at the end.
* The 'clientPushList' value is a bitmask value used to identify which sources
* have to be synced due to local modifications (ClientPush).
* The 'clientPushList' bitmask is formatted as:
* bit 1 -> contact
* bit 2 -> calendar
* bit 3 -> task
*
* @return the NULL terminated array of source names to sync (new buffer)
*/
wchar_t** readPIMModifications();
/**
* reset the value 'clientPushList' flag for the 'sources'. If NULL
* it resets the flag registry
*/
void resetPIMModifications(const wchar_t** sources);
int OpenMessageBox(HWND hwnd, UINT buttons, UINT msg);
/**
* Return the complete list merged between queuelist and clientPush.
* If not NULL, the wchar_t** returned is a new buffer (NULL terminated array).
*/
wchar_t** getCompleteList(wchar_t** sLists, wchar_t** cpLists);
/**
* Returns true if the passed 'source' name is found inside
* the vector of strings 'sourceVector'. Otherwise returns false.
*/
bool findSourceInVector(vector<const wchar_t*> sourceVector, const wchar_t* source);
/**
* start the whole update procedure.
* @param hwnd the handle of the main window from the UI. It is set by the
* when the method is called by the UI form
* @param manual parameter indicates that the user is starting from UI
* It returns a value indicating the UI have to show the "Update Software"
* menu item to start the update procedure manually.
* ret 1,2 the UI must show the item
* ret -1,0 the UI hides the item
*/
int updateProcedure(HWND hwnd, bool manual = false);
/**
* start the procedure to check if there is a new version on the server
*/
int checkAvailableUpdate();
int checkUpdate();
void updateLastCheckUpdate();
/**
* Return the complete list merged between queuelist and clientPush.
* If not NULL, the wchar_t** returned is a new buffer (NULL terminated array).
*/
#endif // #define INCL_MAINCPP
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?