otaconfigmessage.cpp
来自「funambol window mobile客户端源代码」· C++ 代码 · 共 204 行
CPP
204 行
/*
* 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".
*/
#include "OTAConfigMessage.h"
#include "logutils.h"
OTAConfigMessage::OTAConfigMessage() {
userName = NULL;
password = NULL;
syncURL = NULL;
visibleName = NULL;
mailAddress = NULL;
// set the uri of the source. If NULL never set
mailURI = NULL;
contactURI= NULL;
calendarURI= NULL;
taskURI= NULL;
noteURI= NULL;
briefcaseURI = NULL;
// set the format of the source. If NULL never set
contactFormat = NULL;
calendarFormat = NULL;
taskFormat = NULL;
}
OTAConfigMessage::~OTAConfigMessage() {
if (userName)
delete [] userName;
if (password)
delete [] password;
if (syncURL)
delete [] syncURL;
if (visibleName)
delete [] visibleName;
if (mailAddress)
delete [] mailAddress;
if (mailURI)
delete [] mailURI;
if (contactURI)
delete [] contactURI;
if (calendarURI)
delete [] calendarURI;
if (taskURI)
delete [] taskURI;
if (noteURI)
delete [] noteURI;
if (briefcaseURI)
delete [] briefcaseURI;
if (contactFormat)
delete [] contactFormat;
if (calendarFormat)
delete [] calendarFormat;
if (taskFormat)
delete [] taskFormat;
}
void OTAConfigMessage::setUsername(const char* user) {
if (userName)
delete [] userName;
userName = NULL;
userName = stringdup(user);
}
void OTAConfigMessage::setPassword(const char* pass) {
if (password)
delete [] password;
password = NULL;
password = stringdup(pass);
}
void OTAConfigMessage::setSyncURL(const char* url) {
if (syncURL)
delete [] syncURL;
syncURL = NULL;
syncURL = stringdup(url);
}
void OTAConfigMessage::setVisibleName(const char* name) {
if (visibleName)
delete [] visibleName;
visibleName = NULL;
visibleName = stringdup(name);
}
void OTAConfigMessage::setMailAddress(const char* address) {
if (mailAddress)
delete [] mailAddress;
mailAddress = NULL;
mailAddress = stringdup(address);
}
void OTAConfigMessage::setMailURI(const char* uri) {
if (mailURI)
delete [] mailURI;
mailURI = NULL;
mailURI = stringdup(uri);
}
void OTAConfigMessage::setContactURI(const char* uri) {
if (contactURI)
delete [] contactURI;
contactURI = NULL;
contactURI = stringdup(uri);
}
void OTAConfigMessage::setCalendarURI(const char* uri) {
if (calendarURI)
delete [] calendarURI;
calendarURI = NULL;
calendarURI = stringdup(uri);
}
void OTAConfigMessage::setTaskURI(const char* uri) {
if (taskURI)
delete [] taskURI;
taskURI = NULL;
taskURI = stringdup(uri);
}
void OTAConfigMessage::setNoteURI(const char* uri) {
if (noteURI)
delete [] noteURI;
noteURI = NULL;
noteURI = stringdup(uri);
}
void OTAConfigMessage::setBriefcaseURI(const char* uri) {
if (briefcaseURI)
delete [] briefcaseURI;
briefcaseURI = NULL;
briefcaseURI = stringdup(uri);
}
void OTAConfigMessage::setContactFormat(const char* uri) {
if (contactFormat)
delete [] contactFormat;
contactFormat = NULL;
contactFormat = stringdup(uri);
}
void OTAConfigMessage::setCalendarFormat(const char* uri) {
if (calendarFormat)
delete [] calendarFormat;
calendarFormat = NULL;
calendarFormat = stringdup(uri);
}
void OTAConfigMessage::setTaskFormat(const char* uri) {
if (taskFormat)
delete [] taskFormat;
taskFormat = NULL;
taskFormat = stringdup(uri);
}
void OTAConfigMessage::setNoteLocalURI(const char* uri) {
if (noteLocalURI)
delete [] noteLocalURI;
noteLocalURI = NULL;
noteLocalURI = stringdup(uri);
}
void OTAConfigMessage::setBriefcaseLocalURI(const char* uri) {
if (briefcaseLocalURI)
delete [] briefcaseLocalURI;
briefcaseLocalURI = NULL;
briefcaseLocalURI = stringdup(uri);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?