korganizer

korganizer.h
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 1997, 1998, 1999
5  Preston Brown (preston.brown@yale.edu)
6  Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl)
7  Ian Dawes (iadawes@globalserve.net)
8  Laszlo Boloni (boloni@cs.purdue.edu)
9 
10  Copyright (c) 2000-2003 Cornelius Schumacher <schumacher@kde.org>
11  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
12 
13  This program is free software; you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation; either version 2 of the License, or
16  (at your option) any later version.
17 
18  This program is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with this program; if not, write to the Free Software
25  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 
27  As a special exception, permission is given to link this program
28  with any edition of TQt, and distribute the resulting executable,
29  without including the source code for TQt in the source distribution.
30 */
31 #ifndef KORGANIZER_H
32 #define KORGANIZER_H
33 
34 #include <kurl.h>
35 
36 #include <korganizer/mainwindow.h>
37 #include <korganizer/part.h>
38 #include <tdeparts/mainwindow.h>
39 
40 class KTempFile;
41 class TDERecentFilesAction;
42 class KOWindowList;
43 class TDEToggleAction;
44 class TDEProcess;
45 class KONewStuff;
46 class ActionManager;
47 class CalendarView;
48 
49 namespace KCal { class CalendarResources; }
50 
51 using namespace KCal;
52 
53 // Workaround for moc workaround for visual c++ 6.0 sucking
55 typedef KParts::MainWindow KPartsMainWindow;
56 
65 class KOrganizer : public KPartsMainWindow, public KOrgMainWindow
66 {
67  TQ_OBJECT
68 
69  public:
74  KOrganizer( const char *name = 0 );
75  virtual ~KOrganizer();
76 
77  void init( bool hasDocument );
78 
80  ActionManager *actionManager() { return mActionManager; }
81  TDEActionCollection *getActionCollection() const { return actionCollection(); }
82 
87  bool openURL( const KURL &url, bool merge = false );
89  bool saveURL();
91  bool saveAsURL( const KURL & kurl );
93  KURL getCurrentURL() const;
94 
95  virtual KXMLGUIFactory *mainGuiFactory() { return factory(); }
96  virtual KXMLGUIClient *mainGuiClient() { return this; }
97  virtual TQWidget *topLevelWidget() { return this; }
98 
99  virtual bool isCurrentlyActivePart();
100 
101  public slots:
103  void showStatusMessage( const TQString & );
104 
105  protected slots:
106 
110  void readSettings();
111 
113  void writeSettings();
114 
115  void statusBarPressed( int );
116 
118  void setTitle();
119 
120  void newMainWindow( const KURL & );
121 
122  protected:
123  void initActions();
124 // void initViews();
125 
127  bool queryClose();
128  bool queryExit();
129 
130  /* Session management */
131  void saveProperties( TDEConfig * );
132  void readProperties( TDEConfig * );
133 
134  private:
135  CalendarView *mCalendarView; // Main view widget
136  KOrg::Part::List mParts; // List of parts loaded
137 
138  // status bar ids
139  enum { ID_HISTORY, ID_GENERAL, ID_ACTIVE, ID_MESSAGES_IN, ID_MESSAGES_OUT };
140  ActionManager *mActionManager;
141 };
142 
143 #endif
The ActionManager creates all the actions in KOrganizer.
Definition: actionmanager.h:74
This is the main calendar widget.
Definition: calendarview.h:82
This class manages a list of KOrganizer instances, each associated with a window displaying a calenda...
Definition: kowindowlist.h:44
interface for main calendar view widget
interface for korganizer main window
Definition: mainwindow.h:41
This is the main class for KOrganizer.
Definition: korganizer.h:66
ActionManager * actionManager()
Return ActionManager of this main window.
Definition: korganizer.h:80
TDEActionCollection * getActionCollection() const
Return actionCollection of this main window.
Definition: korganizer.h:81
virtual KXMLGUIClient * mainGuiClient()
Return XML GUI client of this main window.
Definition: korganizer.h:96
virtual KXMLGUIFactory * mainGuiFactory()
Return XML GUI factory of this main window.
Definition: korganizer.h:95
virtual TQWidget * topLevelWidget()
Return widget whcih represents this main window.
Definition: korganizer.h:97
bool view(TQWidget *parent, Attachment *attachment)