⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 todo.cpp

📁 funambol windows mobile plugin source code, the source code is taken from the funambol site
💻 CPP
📖 第 1 页 / 共 3 页
字号:
}
ArrayList* ToDo::getCategories() {
    if(!categories)
        for(int i = 0; i < propertiesCount(); i++)
            if(!wcscmp(getProperty(i)->getName(),TEXT("CATEGORIES")) && getProperty(i)->getValue()) {
                if(!categories)
                    categories = new ArrayList();
                categories->add((ArrayElement&) *getiCalPropertyFromVProperty(getProperty(i)));
            }
    return categories;
}
ArrayList* ToDo::getComment() {
    if(!comment)
        for(int i = 0; i < propertiesCount(); i++)
            if(!wcscmp(getProperty(i)->getName(),TEXT("COMMENT")) && getProperty(i)->getValue()) {
                if(!comment)
                    comment = new ArrayList();
                comment->add((ArrayElement&) *getiCalPropertyFromVProperty(getProperty(i)));
            }
    return comment;
}
ArrayList* ToDo::getContact() {
    if(!contact)
        for(int i = 0; i < propertiesCount(); i++)
            if(!wcscmp(getProperty(i)->getName(),TEXT("CONTACT")) && getProperty(i)->getValue()) {
                if(!contact)
                    contact = new ArrayList();
                contact->add((ArrayElement&) *getiCalPropertyFromVProperty(getProperty(i)));
            }
    return contact;
}
ArrayList* ToDo::getExDate() {
    if(!exDate)
        for(int i = 0; i < propertiesCount(); i++)
            if(!wcscmp(getProperty(i)->getName(),TEXT("EXDATE")) && getProperty(i)->getValue()) {
                if(!exDate)
                    exDate = new ArrayList();
                exDate->add((ArrayElement&) *getiCalPropertyFromVProperty(getProperty(i)));
            }
    return exDate;
}
ArrayList* ToDo::getExRule() {
    if(!exRule)
        for(int i = 0; i < propertiesCount(); i++)
            if(!wcscmp(getProperty(i)->getName(),TEXT("EXRULE")) && getProperty(i)->getValue()) {
                if(!exRule)
                    exRule = new ArrayList();
                exRule->add((ArrayElement&) *getiCalPropertyFromVProperty(getProperty(i)));
            }
    return exRule;
}
ArrayList*ToDo::getRStatus() {
    if(!rStatus)
        for(int i = 0; i < propertiesCount(); i++)
            if(!wcscmp(getProperty(i)->getName(),TEXT("REQUEST-STATUS")) && getProperty(i)->getValue()) {
                if(!rStatus)
                    rStatus = new ArrayList();
                rStatus->add((ArrayElement&) *getiCalPropertyFromVProperty(getProperty(i)));
            }
    return rStatus;
}
ArrayList* ToDo::getRelated() {
    if(!related)
        for(int i = 0; i < propertiesCount(); i++)
            if(!wcscmp(getProperty(i)->getName(),TEXT("RELATED")) && getProperty(i)->getValue()) {
                if(!related)
                    related = new ArrayList();
                related->add((ArrayElement&) *getiCalPropertyFromVProperty(getProperty(i)));
            }
    return related;
}
ArrayList* ToDo::getResources() {
    if(!resources)
        for(int i = 0; i < propertiesCount(); i++)
            if(!wcscmp(getProperty(i)->getName(),TEXT("RESOURCES")) && getProperty(i)->getValue()) {
                if(!resources)
                    resources = new ArrayList();
                resources->add((ArrayElement&) *getiCalPropertyFromVProperty(getProperty(i)));
            }
    return resources;
}
ArrayList* ToDo::getRDate() {
    if(!rDate)
        for(int i = 0; i < propertiesCount(); i++)
            if(!wcscmp(getProperty(i)->getName(),TEXT("RDATE")) && getProperty(i)->getValue()) {
                if(!rDate)
                    rDate = new ArrayList();
                rDate->add((ArrayElement&) *getiCalPropertyFromVProperty(getProperty(i)));
            }
    return rDate;
}
ArrayList* ToDo::getRRule() {
    if(!rRule)
        for(int i = 0; i < propertiesCount(); i++)
            if(!wcscmp(getProperty(i)->getName(),TEXT("RRULE")) && getProperty(i)->getValue()) {
                if(!rRule)
                    rRule = new ArrayList();
                rRule->add((ArrayElement&) *getiCalPropertyFromVProperty(getProperty(i)));
            }
    return rRule;
}
ArrayList* ToDo::getXProp() {
    if(!xProp)
        for(int i = 0; i < propertiesCount(); i++)
            if((wcsstr(getProperty(i)->getName(),TEXT("X-")) == getProperty(i)->getName()) && getProperty(i)->getValue()) {
                if(!xProp)
                    xProp = new ArrayList();
                WKeyValuePair *kvp = new WKeyValuePair(getProperty(i)->getName(), getProperty(i)->getValue());
                xProp->add((ArrayElement&) *kvp);
                delete kvp; kvp = NULL;
            }
    return xProp;
}
void ToDo::set(iCalProperty** oldProperty, iCalProperty& newProperty) {
    if (*oldProperty) delete *oldProperty;
    *oldProperty = (iCalProperty*)newProperty.clone();
}
void ToDo::setClass(iCalProperty& p) {
    set(&classEvent, p);
    removeProperty(TEXT("CLASS"));
    if(classEvent) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("CLASS"), classEvent));
    }
}
void ToDo::setCreated(iCalProperty& p) {
    set(&created, p);
    removeProperty(TEXT("CREATED"));
    if(created) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("CREATED"), created));
    }
}
void ToDo::setDescription(iCalProperty& p) {
    set(&description, p);
    removeProperty(TEXT("DESCRIPTION"));
    if(description) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("DESCRIPTION"), description));
    }
}
void ToDo::setDtStart(iCalProperty& p) {
    set(&dtStart, p);
    removeProperty(TEXT("DTSTART"));
    if(dtStart) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("DTSTART"), dtStart));
    }
}
void ToDo::setGeo(iCalProperty& p) {
    set(&geo, p);
    removeProperty(TEXT("GEO"));
    if(geo) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("GEO"), geo));
    }
}
void ToDo::setLastMod(iCalProperty& p) {
    set(&lastMod, p);
    removeProperty(TEXT("LAST-MODIFIED"));
    if(lastMod) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("LAST-MODIFIED"), lastMod));
    }
}
void ToDo::setLocation(iCalProperty& p) {
    set(&location, p);
    removeProperty(TEXT("LOCATION"));
    if(location) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("LOCATION"), location));
    }
}
void ToDo::setOrganizer(iCalProperty& p) {
    set(&organizer, p);
    removeProperty(TEXT("ORGANIZER"));
    if(organizer) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("ORGANIZER"), organizer));
    }
}
void ToDo::setPriority(iCalProperty& p) {
    set(&priority, p);
    removeProperty(TEXT("PRIORITY"));
    if(priority) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("PRIORITY"), priority));
    }
}
void ToDo::setDtStamp(iCalProperty& p) {
    set(&dtStamp, p);
    removeProperty(TEXT("DTSTAMP"));
    if(dtStamp) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("DTSTAMP"), dtStamp));
    }
}
void ToDo::setSequence(iCalProperty& p) {
    set(&seq, p);
    removeProperty(TEXT("SEQUENCE"));
    if(seq) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("SEQUENCE"), seq));
    }
}
void ToDo::setStatus(iCalProperty& p) {
    set(&status, p);
    removeProperty(TEXT("STATUS"));
    if(status) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("STATUS"), status));
    }
}
void ToDo::setSummary(iCalProperty& p) {
    set(&summary, p);
    removeProperty(TEXT("SUMMARY"));
    if(summary) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("SUMMARY"), summary));
    }
}
void ToDo::setCompleted(iCalProperty& p) {
    set(&completed, p);
    removeProperty(TEXT("COMPLETED"));
    if(completed) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("COMPLETED"), completed));
    }
}
void ToDo::setUid(iCalProperty& p) {
    set(&uid, p);
    removeProperty(TEXT("UID"));
    if(uid) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("UID"), uid));
    }
}
void ToDo::setUrl(iCalProperty& p) {
    set(&url, p);
    removeProperty(TEXT("URL"));
    if(url) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("URL"), url));
    }
}
void ToDo::setRecurID(iCalProperty& p) {
    set(&recurID, p);
    removeProperty(TEXT("RECURRENCE-ID"));
    if(recurID) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("RECURRENCE-ID"), recurID));
    }
}
void ToDo::setDue(iCalProperty& p) {
    set(&due, p);
    removeProperty(TEXT("DUE"));
    if(due) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("DUE"), due));
        if(duration) {
            delete duration;
            duration = NULL;
        }
        if(containsProperty(TEXT("DURATION")))
            removeProperty(TEXT("DURATON"));
    }
}
void ToDo::setDuration(iCalProperty& p) {
    set(&duration, p);
    removeProperty(TEXT("DURATION"));
    if(duration) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("DURATON"), duration));
        if(due) {
            delete due;
            due = NULL;
        }
        if(containsProperty(TEXT("DUE")))
            removeProperty(TEXT("DUE"));
    }
}
void ToDo::setPercent(iCalProperty& p) {
    set(&percent, p);
    removeProperty(TEXT("PERCENT-COMPLETE"));
    if(percent) {
        insertProperty(getVPropertyFromiCalProperty(TEXT("PERCENT-COMPLETE"), percent));
    }
}
void ToDo::setAttach(ArrayList& list) {
    if (attach) {
        attach->clear();
    } else {
        attach = new ArrayList();
    }
    removeAllProperies(TEXT("ATTACH"));
    int s = list.size();
    for (int i=0; i<s; ++i) {
        attach->add(*list[i]);
        insertProperty(getVPropertyFromiCalProperty(TEXT("ATTACH"), (iCalProperty*)list[i]));
    }
}
void ToDo::setAttendee(ArrayList& list) {
    if (attendee) {
        attendee->clear();
    } else {
        attendee = new ArrayList();
    }
    removeAllProperies(TEXT("ATTENDEE"));
    int s = list.size();
    for (int i=0; i<s; ++i) {
        attendee->add(*list[i]);
        insertProperty(getVPropertyFromiCalProperty(TEXT("ATTENDEE"), (iCalProperty*)list[i]));
    }
}
void ToDo::setCategories(ArrayList& list) {
    if (categories) {
        categories->clear();
    } else {
        categories = new ArrayList();
    }
    removeAllProperies(TEXT("CATEGORIES"));
    int s = list.size();
    for (int i=0; i<s; ++i) {
        categories->add(*list[i]);
        insertProperty(getVPropertyFromiCalProperty(TEXT("CATEGORIES"), (iCalProperty*)list[i]));
    }
}
void ToDo::setComment(ArrayList& list) {
    if (comment) {
        comment->clear();
    } else {
        comment = new ArrayList();
    }
    removeAllProperies(TEXT("COMMENT"));
    int s = list.size();
    for (int i=0; i<s; ++i) {
        comment->add(*list[i]);

⌨️ 快捷键说明

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