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 TQt, and distribute the resulting executable,
00021     without including the source code for TQt in the source distribution.
00022 */
00023 #ifndef KORG_GLOBALS_H
00024 #define KORG_GLOBALS_H
00025 
00026 #include <kdepimmacros.h>
00027 #include <tqwidget.h>
00028 
00029 class TQDate;
00030 class TQPixmap;
00031 class TQIconSet;
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     enum WhichOccurrences {
00067       NONE,
00068       ONLY_THIS_ONE,
00069       ONLY_FUTURE,
00070       ALL
00071     };
00072 
00073     enum OccurrenceAction {
00074       CUT,
00075       COPY,
00076       EDIT
00077     };
00078 
00079     static void fitDialogToScreen( TQWidget *widget, bool force=false );
00080     KConfig *config() const;
00081 
00082     static bool reverseLayout();
00083 
00084     const KCalendarSystem *calendarSystem() const;
00085 
00086     AlarmClient *alarmClient() const;
00087 
00088     ~KOGlobals();
00089 
00090     TQPixmap smallIcon( const TQString& name );
00091     TQIconSet smallIconSet( const TQString& name, int size = 0 );
00092 
00093     TQStringList holiday( const TQDate & );
00094     bool isWorkDay( const TQDate & );
00095     int getWorkWeekMask();
00101     void setHolidays( KHolidays *h );
00102 
00105     KHolidays *holidays() const;
00106 
00107   protected:
00108     KOGlobals();
00109 
00110   private:
00111     static KOGlobals *mSelf;
00112 
00113     KInstance *mOwnInstance;
00114 
00115     AlarmClient *mAlarmClient;
00116 
00117     KHolidays *mHolidays;
00118 };
00119 
00120 #endif