korganizer

koglobals.h

00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018 
00019     As a special exception, permission is given to link this program
00020     with any edition of Qt, and distribute the resulting executable,
00021     without including the source code for Qt in the source distribution.
00022 */
00023 #ifndef KORG_GLOBALS_H
00024 #define KORG_GLOBALS_H
00025 
00026 #include <kdepimmacros.h>
00027 #include <qwidget.h>
00028 
00029 class QDate;
00030 class QPixmap;
00031 class QIconSet;
00032 class KCalendarSystem;
00033 class AlarmClient;
00034 
00035 class KConfig;
00036 class KInstance;
00037 class KHolidays;
00038 
00039 class KDE_EXPORT KOGlobals
00040 {
00041   public:
00042     static KOGlobals *self();
00043 
00044     enum HowChanged {
00045       INCIDENCEADDED,
00046       INCIDENCEEDITED,
00047       INCIDENCEDELETED,
00048       NOCHANGE
00049     };
00050     enum WhatChanged {
00051       PRIORITY_MODIFIED,
00052       COMPLETION_MODIFIED,
00053       CATEGORY_MODIFIED,
00054       DATE_MODIFIED,
00055       RELATION_MODIFIED,
00056       ALARM_MODIFIED,
00057       DESCRIPTION_MODIFIED,
00058       SUMMARY_MODIFIED,
00059       COMPLETION_MODIFIED_WITH_RECURRENCE,
00060       RECURRENCE_MODIFIED_ONE_ONLY,
00061       RECURRENCE_MODIFIED_ALL_FUTURE,
00062       UNKNOWN_MODIFIED,
00063       NOTHING_MODIFIED
00064     };
00065 
00066     static void fitDialogToScreen( QWidget *widget, bool force=false );
00067     KConfig *config() const;
00068 
00069     static bool reverseLayout();
00070 
00071     const KCalendarSystem *calendarSystem() const;
00072 
00073     AlarmClient *alarmClient() const;
00074 
00075     ~KOGlobals();
00076 
00077     QPixmap smallIcon( const QString& name );
00078     QIconSet smallIconSet( const QString& name, int size = 0 );
00079 
00080     QStringList holiday( const QDate & );
00081     bool isWorkDay( const QDate & );
00082     int getWorkWeekMask();
00088     void setHolidays( KHolidays *h );
00089 
00092     KHolidays *holidays() const;
00093 
00094   protected:
00095     KOGlobals();
00096 
00097   private:
00098     static KOGlobals *mSelf;
00099 
00100     KInstance *mOwnInstance;
00101 
00102     AlarmClient *mAlarmClient;
00103 
00104     KHolidays *mHolidays;
00105 };
00106 
00107 #endif