Remove grantlee_strings_extractor.pyc
[kdepim.git] / korganizer / korganizer.h
blob18317ec146678fbd3fe9f0e6bfac7bfe8f77ee99
1 /*
2 This file is part of KOrganizer.
4 Copyright (c) 1997, 1998, 1999 Preston Brown <preston.brown@yale.edu>
5 Fester Zigterman <F.J.F.ZigtermanRustenburg@student.utwente.nl>
6 Ian Dawes <iadawes@globalserve.net>
7 Laszlo Boloni <boloni@cs.purdue.edu>
9 Copyright (c) 2000-2003 Cornelius Schumacher <schumacher@kde.org>
10 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License along
23 with this program; if not, write to the Free Software Foundation, Inc.,
24 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 As a special exception, permission is given to link this program
27 with any edition of Qt, and distribute the resulting executable,
28 without including the source code for Qt in the source distribution.
30 #ifndef KORG_KORGANIZER_H
31 #define KORG_KORGANIZER_H
33 #include "mainwindow.h"
34 #include "part.h"
36 #include <KParts/MainWindow>
38 class CalendarView;
40 // Workaround for moc workaround for visual c++ 6.0 sucking
41 typedef KOrg::MainWindow KOrgMainWindow;
42 typedef KParts::MainWindow KPartsMainWindow;
44 /**
45 This is the main class for KOrganizer. It extends the KDE KMainWindow.
46 it provides the main view that the user sees upon startup, as well as
47 menus, buttons, etc. etc.
49 @short constructs a new main window for korganizer
50 @author Preston Brown
52 class KOrganizer : public KPartsMainWindow, public KOrgMainWindow
54 Q_OBJECT
55 public:
56 KOrganizer();
57 virtual ~KOrganizer();
59 void init(bool hasDocument) Q_DECL_OVERRIDE;
61 KOrg::CalendarViewBase *view() const Q_DECL_OVERRIDE;
62 ActionManager *actionManager() Q_DECL_OVERRIDE {
63 return mActionManager;
65 KActionCollection *getActionCollection() const Q_DECL_OVERRIDE
67 return actionCollection();
70 /**
71 Open calendar file from URL. Merge into current calendar, if \a merge is
72 true.
73 @param url The URL to open
74 @param merge true if the incidences in URL should be imported into the
75 current calendar (default resource or calendar file),
76 false if the URL should be added as a new resource.
77 @return true on success, false if an error occurred
79 bool openURL(const QUrl &url, bool merge = false) Q_DECL_OVERRIDE;
81 /** Save calendar file to URL of current calendar */
82 bool saveURL() Q_DECL_OVERRIDE;
84 /** Save calendar file to URL */
85 bool saveAsURL(const QUrl &url) Q_DECL_OVERRIDE;
87 /** Get current URL */
88 QUrl getCurrentURL() const Q_DECL_OVERRIDE;
90 KXMLGUIFactory *mainGuiFactory() Q_DECL_OVERRIDE {
91 return factory();
93 KXMLGUIClient *mainGuiClient() Q_DECL_OVERRIDE {
94 return this;
96 QWidget *topLevelWidget() Q_DECL_OVERRIDE {
97 return this;
100 public Q_SLOTS:
101 /** show status message */
102 void showStatusMessage(const QString &) Q_DECL_OVERRIDE;
104 protected Q_SLOTS:
106 /** using the KConfig associated with the kapp variable, read in the
107 * settings from the config file.
109 void readSettings();
111 /** write current state to config file. */
112 void writeSettings();
114 /** Sets title of window according to filename and modification state */
115 void setTitle() Q_DECL_OVERRIDE;
117 void newMainWindow(const QUrl &);
119 void slotEditKeys();
121 protected:
122 void initActions();
123 // void initViews();
125 /** supplied so that close events close calendar properly.*/
126 bool queryClose() Q_DECL_OVERRIDE;
128 /* Session management */
129 void saveProperties(KConfigGroup &) Q_DECL_OVERRIDE;
130 void readProperties(const KConfigGroup &) Q_DECL_OVERRIDE;
132 private:
133 CalendarView *mCalendarView; // Main view widget
134 KOrg::Part::List mParts; // List of parts loaded
136 ActionManager *mActionManager;
139 #endif