summaryrefslogtreecommitdiffabout
path: root/korganizer/koprefs.h
blob: 35c6110dde159be2b58def281d2728c17b168f94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
/*
    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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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.
*/
#ifndef KOPREFS_H
#define KOPREFS_H


#include <libkdepim/kpimprefs.h>
#include <q3dict.h>
#include <qdir.h>
#include <qobject.h>
#include <QDateTime>
//Added by qt3to4:
#include <Q3PtrList>

class KConfig;
class QFont;
class QColor;
class QStringList;

#define VIEW_WN_VIEW 1
#define VIEW_NX_VIEW 2
#define VIEW_J_VIEW 3
#define VIEW_A_VIEW 4
#define VIEW_ML_VIEW 5
#define VIEW_M_VIEW 6
#define VIEW_L_VIEW 7
#define VIEW_T_VIEW 8

class KopiCalendarFile : public QObject
{
 public:
    KopiCalendarFile(  ) : QObject( )
        {
            isStandard = false;
            isEnabled = true;
            isAlarmEnabled = true;
            isReadOnly = false;
            mErrorOnLoad = false;
            isRelative = false;
            mCalNumber = 0;
            mDefaultColor = Qt::red;
            mName = "Calendar";
            mFileName = QDir::homeDirPath() + "/icalfile.ics";
            mSavedFileName = "icalfile.ics";
        }
    bool isStandard;
    bool isEnabled;
    bool isAlarmEnabled;
    bool isReadOnly;
    bool mErrorOnLoad;
    bool isRelative;
    int mCalNumber;
    QString mName;
    QString mFileName;
    QString mSavedFileName;
    QColor mDefaultColor;
    QDateTime mLoadDt;
};
class KOPrefs : public KPimPrefs
{
  public:
    enum { FormatVCalendar, FormatICalendar };
    enum { MailClientKMail, MailClientSendmail };
    enum { IMIPDummy, IMIPKMail };
    enum { IMIPOutbox, IMIPdirectsend };
    enum { neverAuto, addressbookAuto, selectedAuto };
    enum { standardDestination, askDestination };

    virtual ~KOPrefs();

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

    /** Set preferences to default values */
    void usrSetDefaults();

    /** Read preferences from config file */
    void usrReadConfig();

    /** Write preferences to config file */
    void usrWriteConfig();
    void setCategoryDefaults();
    void setAllDefaults();
    KopiCalendarFile * getNewCalendar();
    KopiCalendarFile * getCalendar( int );
    void  deleteCalendar( int );
    QColor defaultColor( int ) const;
    QString calName( int ) const;
    int getCalendarID( const QString & name );
    int getFuzzyCalendarID( const QString & name );
  protected:
    void setTimeZoneIdDefault();

    /** Fill empty mail fields with default values. */
    void fillMailDefaults();

  private:
    /** Constructor disabled for public. Use instance() to create a KOPrefs
    object. */
    KOPrefs();

    static KOPrefs *mInstance;
    QStringList getDefaultList();
    QStringList getLocationDefaultList();
  public:
    // preferences data
    KConfig* getConfig();
    void setFullName(const QString &);
    QString fullName();
    void setEmail(const QString &);
    QString email();

    QString mAdditional;

    bool    mEmailControlCenter;

    bool    mBcc;
    bool    mAutoSave;
    int     mAutoSaveInterval;
    bool    mConfirm;

    bool    mEnableGroupScheduling;
    bool    mEnableProjectView;

    int     mDefaultFormat;
    int     mMailClient;

    int     mStartTime;
    int     mDefaultDuration;
    int     mAlarmTime;

    int     mWorkingHoursStart;
    int     mWorkingHoursEnd;
    bool    mExcludeHolidays;
    bool    mExcludeSaturdays;
    bool    mMarcusBainsShowSeconds;

    QFont   mTimeBarFont;
    QFont   mMonthViewFont;
    QFont   mAgendaViewFont;
    QFont   mMarcusBainsFont;
    QFont   mTimeLabelsFont;
    QFont   mTodoViewFont;
    QFont   mListViewFont;
    QFont   mDateNavigatorFont;
    QFont   mEditBoxFont;
    QFont   mJornalViewFont;
    QFont   mWhatsNextFont;
    QFont   mEventViewFont;




    QColor  mHolidayColor;
    QColor  mHighlightColor;
    QColor  mEventColor;
    QColor  mTodoDoneColor;
    QColor  mAgendaBgColor;
    QColor  mWorkingHoursColor;
    QColor  mTodoDueTodayColor;
    QColor  mTodoOverdueColor;
    QColor  mTodoRunColor;
    QColor  mMonthViewEvenColor;
    QColor  mMonthViewOddColor;
    QColor  mMonthViewHolidayColor;
    bool mMonthViewUsesDayColors;
    bool mMonthViewSatSunTog;
    bool mMonthViewWeek;
    bool mMonthViewWeekRowlayout;
    QColor  mAppColor1;
    QColor  mAppColor2;
    bool mUseAppColors;

    int     mDayBegins;
    int     mHourSize;
    int     mAllDaySize;
    bool    mShowFullMenu;
    bool    mDailyRecur;
    bool    mWeeklyRecur;
    bool    mLongAllday;
    bool    mMonthDailyRecur;
    bool    mMonthWeeklyRecur;
    bool    mMonthShowIcons;
    bool    mMonthShowTimes;
    bool    mMonthShowShort;
    bool    mEnableToolTips;
    bool    mEnableMonthScroll;
    bool    mFullViewMonth;
    bool    mMonthViewUsesCategoryColor;
    bool    mFullViewTodo;
    bool    mShowCompletedTodo;
    bool    mMarcusBainsEnabled;
    int     mNextXDays;
    int     mWhatsNextDays;
    bool    mWhatsNextTime2Lines;
    int     mWhatsNextPrios;
    bool    mEnableQuickTodo;

    bool    mCompactDialogs;
    bool    mVerticalScreen;

    bool mShowIconNewTodo;
    bool mShowIconNewEvent;
    bool mShowIconSearch;
    bool mShowIconList;
    bool mShowIconDay1;
    bool mShowIconDay5;
    bool mShowIconDay6;
    bool mShowIconDay7;
    bool mShowIconMonth;
    bool mShowIconTodoview;
    bool mShowIconBackFast;
    bool mShowIconBack;
    bool mShowIconToday;
    bool mShowIconForward;
    bool mShowIconForwardFast;
    bool mShowIconWhatsThis;
    bool mShowIconWeekNum;
    bool mShowIconNextDays;
    bool mShowIconNext;
    bool mShowIconJournal;
    bool mShowIconFilter;
    bool mShowIconOnetoolbar;
    bool mShowIconNavigator;
    bool mShowIconAllday;
    bool mShowIconFilterview;
    bool mShowIconToggleFull;
    
    bool mShowIconStretch;

    bool mToolBarHor;
    bool mToolBarUp;
    bool mToolBarHorV;
    bool mToolBarUpV;
    bool mToolBarHorN;
    bool mToolBarUpN;
    bool mToolBarHorF;
    bool mToolBarUpF;
    bool mToolBarMiniIcons;

    bool mAskForQuit;
    bool mUsePassWd;
    bool mShowSyncEvents;
    bool mShowTodoInAgenda;
    bool mShowCompletedTodoInAgenda;
    bool mShowTimeInAgenda;
    bool mHideNonStartedTodos;

    bool mBlockPopupMenu;

    int mLastSyncTime;
    void setCategoryColor(QString cat,const QColor & color);
    QColor *categoryColor(QString cat);

    QString mArchiveFile;
    QString mHtmlExportFile;
    bool    mHtmlWithSave;

    QStringList mSelectedPlugins;
  
    QString mLastImportFile;
    QString mLastVcalFile;
    QString mLastSaveFile;
    QString mLastLoadFile;


    QString mDefaultAlarmFile;
    int mIMIPScheduler;
    int mIMIPSend;
    QStringList mAdditionalMails;
    int mIMIPAutoRefresh;
    int mIMIPAutoInsertReply;
    int mIMIPAutoInsertRequest;
    int mIMIPAutoFreeBusy;
    int mIMIPAutoFreeBusyReply;

    QStringList mTodoTemplates;
    QStringList mEventTemplates;

    int mDestination;


    bool mEditOnDoubleClick;
    bool mViewChangeHoldFullscreen;
    bool mViewChangeHoldNonFullscreen;
    bool mCenterOnCurrentTime;
    bool mSetTimeToDayStartAt;
    bool mHighlightCurrentDay;
    bool mUseHighlightLightColor;
    bool mListViewMonthTimespan;
    bool mWNViewShowsParents;
    bool mWNViewShowsPast;
    bool mWNViewShowLocation;
    bool mTodoViewShowsPercentage;
    bool mTodoViewUsesCatColors;
    bool mMonthViewUsesBigFont;
    bool mTodoViewUsesSmallFont;
    bool mTodoViewUsesForegroundColor;
    bool mMonthViewUsesForegroundColor;

    bool mHightlightDateTimeEdit;
    bool mShortDateInViewer;

    bool mShowDateNavigator;

    QStringList mLocationDefaults;
    QStringList mEventSummaryUser;
    QStringList mTodoSummaryUser;
    QStringList mJournalSummaryUser;

    bool mUseInternalAlarmNotification;
    int mAlarmPlayBeeps;
    int mAlarmSuspendTime;
    int mAlarmSuspendCount;
    int mAlarmBeepInterval;
    int mOldLanguage;
    int mOldLoadedLanguage;

  
    QString mActiveSyncPort;
    QString mActiveSyncIP;

    // settings for eventviewer
    bool mEVshowDetails;
    bool mEVshowCreated;
    bool mEVshowChanged;
    bool mWTshowDetails;
    bool mWTshowCreated;
    bool mWTshowChanged;

    int mCurrentDisplayedView;
    Q3PtrList<KopiCalendarFile> mCalendars;
    int mNextAvailableCalendar;
    bool mGlobalUpdateDisabled;


    bool mDetectConflicts;
    bool mIncludeFree;
    bool mCheckConflictsAllDayAllDay;
    bool mCheckConflictsAllDayNonAD;
    bool mCheckConflictsNonADAllDay;
    bool mCheckConflictsNonADNonAD;
    QString mFilterConflictEditItem;
    QString mFilterConflictAllItem;

  private:
    Q3Dict<QColor> mCategoryColors;
    QVector<KopiCalendarFile*> mDefCalColors;
    QColor mDefaultCategoryColor;

    QFont mDefaultTimeBarFont;
    QFont mDefaultViewFont;
    QFont mDefaultMonthViewFont;

    QString mName;
    QString mEmail;
};

#endif