001: // The contents of this file are subject to the Mozilla Public License Version
002: // 1.1
003: //(the "License"); you may not use this file except in compliance with the
004: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
005: //
006: //Software distributed under the License is distributed on an "AS IS" basis,
007: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
008: //for the specific language governing rights and
009: //limitations under the License.
010: //
011: //The Original Code is "The Columba Project"
012: //
013: //The Initial Developers of the Original Code are Frederik Dietz and Timo
014: // Stich.
015: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
016: //
017: //All Rights Reserved.
018: package org.columba.mail.config;
019:
020: import org.columba.core.config.DefaultItem;
021: import org.columba.core.xml.XmlElement;
022:
023: /**
024: * Configuration data for spam.
025: * <p>
026: *
027: * @author fdietz
028: *
029: */
030: public class SpamItem extends DefaultItem {
031:
032: public SpamItem(XmlElement e) {
033: super (e);
034: }
035:
036: /**
037: * Check if spam filtering is enabled.
038: *
039: * @return true, if enabled. False, otherwise.
040: */
041: public boolean isEnabled() {
042: return getBooleanWithDefault("enabled", false);
043: }
044:
045: /**
046: * Enable/Disable spam filter.
047: *
048: * @param enabled true or false
049: */
050: public void setEnabled(boolean enabled) {
051: setBoolean("enabled", enabled);
052:
053: }
054:
055: public boolean isMoveIncomingJunkMessagesEnabled() {
056: return getBooleanWithDefault("move_incoming_junk_messages",
057: false);
058: }
059:
060: public void enableMoveIncomingJunkMessage(boolean enabled) {
061: setBoolean("move_incoming_junk_messages", enabled);
062: }
063:
064: public boolean isIncomingTrashSelected() {
065: return getBooleanWithDefault("incoming_trash", true);
066: }
067:
068: public void selectedIncomingTrash(boolean select) {
069: setBoolean("incoming_trash", select);
070: }
071:
072: public String getIncomingCustomFolder() {
073: return getStringWithDefault("incoming_folder", "101");
074: }
075:
076: public void setIncomingCustomFolder(String folderId) {
077: setString("incoming_folder", folderId);
078: }
079:
080: public boolean isMoveMessageWhenMarkingEnabled() {
081: return getBooleanWithDefault("move_message_when_marking", false);
082: }
083:
084: public void enableMoveMessageWhenMarking(boolean enabled) {
085: setBoolean("move_message_when_marking", enabled);
086: }
087:
088: public boolean isMoveTrashSelected() {
089: return getBooleanWithDefault("move_trash", true);
090: }
091:
092: public void selectMoveTrash(boolean select) {
093: setBoolean("move_trash", select);
094: }
095:
096: public String getMoveCustomFolder() {
097: return getStringWithDefault("move_folder", "101");
098: }
099:
100: public void setMoveCustomFolder(String folderId) {
101: setString("move_folder", folderId);
102: }
103:
104: public boolean checkAddressbook() {
105: return getBooleanWithDefault("check_addressbook", false);
106: }
107:
108: public void enableCheckAddressbook(boolean enable) {
109: setBoolean("check_addressbook", enable);
110: }
111: }
|