korganizer

korganizer_part.h

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 2000,2003 Cornelius Schumacher <schumacher@kde.org>
00005     Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020 
00021     As a special exception, permission is given to link this program
00022     with any edition of Qt, and distribute the resulting executable,
00023     without including the source code for Qt in the source distribution.
00024 */
00025 #ifndef KORGANIZER_PART_H
00026 #define KORGANIZER_PART_H
00027 
00028 #include <kurl.h>
00029 #include <kparts/part.h>
00030 
00031 #include <korganizer/mainwindow.h>
00032 
00033 
00034 class KInstance;
00035 class KAboutData;
00036 class KProcess;
00037 
00038 class CalendarView;
00039 class ActionManager;
00040 
00041 namespace KCal {
00042   class CalendarResources;
00043   class Calendar;
00044   class Incidence;
00045 }
00046 using namespace KCal;
00047 namespace KParts {
00048 class StatusBarExtension;
00049 }
00050 namespace KOrg {
00051 class CalendarViewBase;
00052 }
00053 
00054 class QDate;
00055 
00056 class KOrganizerPart: public KParts::ReadOnlyPart,
00057                       public KOrg::MainWindow
00058 {
00059     Q_OBJECT
00060   public:
00061     KOrganizerPart( QWidget *parentWidget, const char *widgetName,
00062                     QObject *parent, const char *name, const QStringList & );
00063     virtual ~KOrganizerPart();
00064 
00065     static KAboutData *createAboutData();
00066 
00067     virtual KOrg::CalendarViewBase *view() const;
00068 
00070     virtual bool openURL( const KURL &url, bool merge = false );
00072     virtual bool saveURL();
00074     virtual bool saveAsURL( const KURL &kurl );
00075 
00077     virtual KURL getCurrentURL() const;
00078 
00079     virtual KXMLGUIFactory *mainGuiFactory() { return factory(); }
00080     virtual KXMLGUIClient *mainGuiClient() { return this; }
00081     virtual QWidget *topLevelWidget();
00082     virtual ActionManager *actionManager();
00083     virtual KActionCollection *getActionCollection() const { return actionCollection(); }
00084     virtual void showStatusMessage( const QString &message );
00085 
00086     void setTitle();
00087 
00088   public slots:
00089     void slotChangeInfo( Incidence *incidence, const QDate & );
00090 
00091   protected:
00092     virtual bool openFile();
00093 
00094   protected slots:
00095     void startCompleted( KProcess * );
00096 
00097   private:
00098     CalendarView *mView;
00099     ActionManager *mActionManager;
00100     KParts::StatusBarExtension *mStatusBarExtension;
00101     QWidget *mTopLevelWidget;
00102 
00103   signals:
00104     void textChanged( const QString & );
00105 };
00106 
00107 #endif