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
40class KTempFile;
41class TDERecentFilesAction;
42class KOWindowList;
43class TDEToggleAction;
44class TDEProcess;
45class KONewStuff;
46class ActionManager;
47class CalendarView;
48
49namespace KCal { class CalendarResources; }
50
51using namespace KCal;
52
53// Workaround for moc workaround for visual c++ 6.0 sucking
55typedef KParts::MainWindow KPartsMainWindow;
56
65class 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
79 KOrg::CalendarViewBase *view() const;
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
bool queryClose()
supplied so that close events close calendar properly.
Definition: korganizer.cpp:219
TDEActionCollection * getActionCollection() const
Return actionCollection of this main window.
Definition: korganizer.h:81
virtual KXMLGUIFactory * mainGuiFactory()
Return XML GUI factory of this main window.
Definition: korganizer.h:95
bool openURL(const KURL &url, bool merge=false)
Open calendar file from URL.
Definition: korganizer.cpp:249
void writeSettings()
write current state to config file.
Definition: korganizer.cpp:191
KOrganizer(const char *name=0)
Constructs a new main window.
Definition: korganizer.cpp:89
bool saveURL()
Save calendar file to URL of current calendar.
Definition: korganizer.cpp:254
KURL getCurrentURL() const
Get current URL.
Definition: korganizer.cpp:264
virtual KXMLGUIClient * mainGuiClient()
Return XML GUI client of this main window.
Definition: korganizer.h:96
void readSettings()
using the TDEConfig associated with the tdeApp variable, read in the settings from the config file.
Definition: korganizer.cpp:178
void showStatusMessage(const TQString &)
show status message
Definition: korganizer.cpp:244
bool saveAsURL(const KURL &kurl)
Save calendar file to URL.
Definition: korganizer.cpp:259
virtual TQWidget * topLevelWidget()
Return widget whcih represents this main window.
Definition: korganizer.h:97
void setTitle()
Sets title of window according to filename and modification state.
Definition: korganizer.cpp:284