korganizer

koglobals.h
1 /*
2  This file is part of KOrganizer.
3  Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 
19  As a special exception, permission is given to link this program
20  with any edition of TQt, and distribute the resulting executable,
21  without including the source code for TQt in the source distribution.
22 */
23 #ifndef KORG_GLOBALS_H
24 #define KORG_GLOBALS_H
25 
26 #include <kdemacros.h>
27 #include <tqwidget.h>
28 
29 class TQDate;
30 class TQPixmap;
31 class TQIconSet;
32 class KCalendarSystem;
33 class AlarmClient;
34 
35 class TDEConfig;
36 class TDEInstance;
37 class KHolidays;
38 
39 class TDE_EXPORT KOGlobals
40 {
41  public:
42  static KOGlobals *self();
43 
44  enum HowChanged {
45  INCIDENCEADDED,
46  INCIDENCEEDITED,
47  INCIDENCEDELETED,
48  NOCHANGE
49  };
50  enum WhatChanged {
51  PRIORITY_MODIFIED,
52  COMPLETION_MODIFIED,
53  CATEGORY_MODIFIED,
54  DATE_MODIFIED,
55  RELATION_MODIFIED,
56  ALARM_MODIFIED,
57  DESCRIPTION_MODIFIED,
58  SUMMARY_MODIFIED,
59  COMPLETION_MODIFIED_WITH_RECURRENCE,
60  RECURRENCE_MODIFIED_ONE_ONLY,
61  RECURRENCE_MODIFIED_ALL_FUTURE,
62  UNKNOWN_MODIFIED,
63  NOTHING_MODIFIED
64  };
65 
66  enum WhichOccurrences {
67  NONE,
68  ONLY_THIS_ONE,
69  ONLY_FUTURE,
70  ALL
71  };
72 
73  enum OccurrenceAction {
74  CUT,
75  COPY,
76  EDIT
77  };
78 
79  static void fitDialogToScreen( TQWidget *widget, bool force=false );
80  TDEConfig *config() const;
81 
82  static bool reverseLayout();
83 
84  const KCalendarSystem *calendarSystem() const;
85 
86  AlarmClient *alarmClient() const;
87 
88  ~KOGlobals();
89 
90  TQPixmap smallIcon( const TQString& name );
91  TQIconSet smallIconSet( const TQString& name, int size = 0 );
92 
93  TQStringList holiday( const TQDate & );
94  bool isWorkDay( const TQDate & );
95  int getWorkWeekMask();
101  void setHolidays( KHolidays *h );
102 
105  KHolidays *holidays() const;
106 
107  protected:
108  KOGlobals();
109 
110  private:
111  static KOGlobals *mSelf;
112 
113  TDEInstance *mOwnInstance;
114 
115  AlarmClient *mAlarmClient;
116 
117  KHolidays *mHolidays;
118 };
119 
120 #endif