SVN_SILENT made messages (.desktop file) - always resolve ours
[kdepim.git] / korganizer / korganizer_part.h
blob1f294f09ca0f27fc5efaf096aff10337375b5621
1 /*
2 This file is part of KOrganizer.
4 Copyright (c) 2000,2003 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution.
26 #ifndef KORG_KORGANIZER_PART_H
27 #define KORG_KORGANIZER_PART_H
29 #include "mainwindow.h"
31 #include <KParts/Part>
32 #include <kparts/readonlypart.h>
34 class CalendarView;
36 namespace Akonadi
38 class Item;
41 namespace KParts
43 class StatusBarExtension;
46 class KOrganizerPart: public KParts::ReadOnlyPart,
47 public KOrg::MainWindow
49 Q_OBJECT
50 public:
51 KOrganizerPart(QWidget *parentWidget, QObject *parent, const QVariantList &);
52 virtual ~KOrganizerPart();
54 KOrg::CalendarViewBase *view() const Q_DECL_OVERRIDE;
56 /**
57 Load calendar file from URL and merge it into the current calendar.
59 @param url The URL to open.
60 @param merge Whether the URL should be imported into the current calendar
61 or added as a new calendar resource.
63 @return true on success, false if an error occurred
65 bool openURL(const QUrl &url, bool merge = false) Q_DECL_OVERRIDE;
67 /** Save calendar file to URL of current calendar */
68 bool saveURL() Q_DECL_OVERRIDE;
70 /** Save calendar file to URL */
71 bool saveAsURL(const QUrl &url) Q_DECL_OVERRIDE;
73 /** Get current URL */
74 QUrl getCurrentURL() const Q_DECL_OVERRIDE;
76 KXMLGUIFactory *mainGuiFactory() Q_DECL_OVERRIDE {
77 return factory();
79 KXMLGUIClient *mainGuiClient() Q_DECL_OVERRIDE {
80 return this;
82 QWidget *topLevelWidget() Q_DECL_OVERRIDE;
83 ActionManager *actionManager() Q_DECL_OVERRIDE;
84 KActionCollection *getActionCollection() const Q_DECL_OVERRIDE
86 return actionCollection();
88 void showStatusMessage(const QString &message) Q_DECL_OVERRIDE;
90 void setTitle() Q_DECL_OVERRIDE;
92 public Q_SLOTS:
93 void slotChangeInfo(const Akonadi::Item &, const QDate &date);
95 protected:
96 bool openFile() Q_DECL_OVERRIDE;
98 private:
99 CalendarView *mView;
100 ActionManager *mActionManager;
101 KParts::StatusBarExtension *mStatusBarExtension;
102 QWidget *mTopLevelWidget;
104 Q_SIGNALS:
105 void textChanged(const QString &);
108 #endif