OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 41 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
17 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
14
 package org.openconcerto.ui.preferences;
15
 
16
public class EmailProps extends AbstractProps {
17
    public static final int DEFAULT = 0;
18
    public static final int THUNDERBIRD = 1;
19
    public static final int OUTLOOK = 2;
20
    protected static EmailProps instance;
21
 
22
    public synchronized static EmailProps getInstance() {
23
        if (instance == null) {
24
            instance = new EmailProps();
25
        }
26
        return instance;
27
    }
28
 
29
    @Override
30
    protected String getPropsFileName() {
31
        return "./Configuration/Email.properties";
32
    }
33
 
34
    public String getThunderbirdPath() {
35
        final String stringProperty = this.getStringProperty("thunderbird.path");
36
        if (stringProperty.trim().length() == 0) {
37
            return "C:\\Program Files\\Mozilla Thunderbird\\thunderbird.exe";
38
        }
39
        return stringProperty;
40
    }
41
 
42
    public void setThunderbirdPath(String text) {
43
        this.setProperty("thunderbird.path", text);
44
    }
45
 
46
    public int getMode() {
47
        return this.getIntProperty("mode");
48
    }
49
 
50
    public void setMode(int mode) {
51
        this.setProperty("mode", String.valueOf(mode));
52
    }
53
 
54
    public void setTitle(String text) {
55
        this.setProperty("title", String.valueOf(text));
56
    }
57
 
58
    public String getTitle() {
59
        return this.getStringProperty("title");
60
    }
61
 
62
    public void setHeader(String text) {
63
        this.setProperty("header", String.valueOf(text));
64
    }
65
 
66
    public String getHeader() {
67
        return this.getStringProperty("header");
68
    }
69
 
70
    public void setFooter(String text) {
71
        this.setProperty("footer", String.valueOf(text));
72
    }
73
 
74
    public void setEncodingCharsetName(String charset) {
75
        this.setProperty("encoding", charset);
76
    }
77
 
78
    public String getFooter() {
79
        return this.getStringProperty("footer");
80
    }
81
 
82
    public String getEncodingCharsetName() {
83
        String charset = "UTF-8";
84
        String tmp = this.getStringProperty("encoding");
85
        if (tmp.trim().length() > 0) {
86
            charset = tmp;
87
        }
88
        return charset;
89
    }
90
 
91
    @Override
92
    protected int getDefautIntValue() {
93
        return DEFAULT;
94
    }
95
 
96
}