koprefs.h 2.41 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
  This file is part of KOrganizer.

  Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  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 General Public License along
  with this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

  As a special exception, permission is given to link this program
  with any edition of Qt, and distribute the resulting executable,
  without including the source code for Qt in the source distribution.
*/
24
25
26

#ifndef KORG_KOPREFS_H
#define KORG_KOPREFS_H
27

Laurent Montel's avatar
Laurent Montel committed
28
#include "korganizer_core_export.h"
29
30
#include "koprefs_base.h"

Laurent Montel's avatar
Laurent Montel committed
31
#include <EventViews/Prefs>
32
33
34

class KORGANIZER_CORE_EXPORT KOPrefs : public KOPrefsBase
{
Laurent Montel's avatar
Laurent Montel committed
35
    Q_OBJECT
Laurent Montel's avatar
Laurent Montel committed
36
public:
37
38
39
40
41
42
43
44
45
    virtual ~KOPrefs();

    /** Get instance of KOPrefs. It is made sure that there is only one
    instance. */
    static KOPrefs *instance();

    EventViews::PrefsPtr eventViewsPreferences() const;

    /** Set preferences to default values */
Laurent Montel's avatar
Laurent Montel committed
46
    void usrSetDefaults() Q_DECL_OVERRIDE;
47
48

    /** Read preferences from config file */
Laurent Montel's avatar
Laurent Montel committed
49
    void usrRead() Q_DECL_OVERRIDE;
50
51

    /** Write preferences to config file */
Laurent Montel's avatar
Laurent Montel committed
52
    bool usrSave() Q_DECL_OVERRIDE;
53

Laurent Montel's avatar
Laurent Montel committed
54
private:
55
56
57
58
59
    /** Constructor disabled for public. Use instance() to create a KOPrefs
    object. */
    KOPrefs();
    friend class KOPrefsPrivate;

Laurent Montel's avatar
Laurent Montel committed
60
61
62
public:
    void setResourceColor(const QString &, const QColor &);
    QColor resourceColor(const QString &);
Laurent Montel's avatar
Laurent Montel committed
63
    QColor resourceColorKnown(const QString &cal) const;
64

Laurent Montel's avatar
Laurent Montel committed
65
    void setHtmlExportFile(const QString &fileName);
66
67
68
    QString htmlExportFile() const;

    QStringList timeScaleTimezones() const;
Laurent Montel's avatar
Laurent Montel committed
69
    void setTimeScaleTimezones(const QStringList &list);
70

Laurent Montel's avatar
Laurent Montel committed
71
private:
72
73
74
75
76
77
78
79
80

    QFont mDefaultMonthViewFont;

    QStringList mTimeScaleTimeZones;

    QString mHtmlExportFile;

    EventViews::PrefsPtr mEventViewsPrefs;

Laurent Montel's avatar
Laurent Montel committed
81
public: // Do not use - except in KOPrefsDialogMain
82
83
84
85
86
    QString mName;
    QString mEmail;
};

#endif