korganizer

korganizer.h
00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 1997, 1998, 1999
00005     Preston Brown (preston.brown@yale.edu)
00006     Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl)
00007     Ian Dawes (iadawes@globalserve.net)
00008     Laszlo Boloni (boloni@cs.purdue.edu)
00009 
00010     Copyright (c) 2000-2003 Cornelius Schumacher <schumacher@kde.org>
00011     Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00012 
00013     This program is free software; you can redistribute it and/or modify
00014     it under the terms of the GNU General Public License as published by
00015     the Free Software Foundation; either version 2 of the License, or
00016     (at your option) any later version.
00017 
00018     This program is distributed in the hope that it will be useful,
00019     but WITHOUT ANY WARRANTY; without even the implied warranty of
00020     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00021     GNU General Public License for more details.
00022 
00023     You should have received a copy of the GNU General Public License
00024     along with this program; if not, write to the Free Software
00025     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00026 
00027     As a special exception, permission is given to link this program
00028     with any edition of TQt, and distribute the resulting executable,
00029     without including the source code for TQt in the source distribution.
00030 */
00031 #ifndef KORGANIZER_H
00032 #define KORGANIZER_H
00033 
00034 #include <kurl.h>
00035 
00036 #include <korganizer/mainwindow.h>
00037 #include <korganizer/part.h>
00038 #include <kparts/mainwindow.h>
00039 
00040 class KTempFile;
00041 class KRecentFilesAction;
00042 class KOWindowList;
00043 class KToggleAction;
00044 class KProcess;
00045 class KONewStuff;
00046 class ActionManager;
00047 class CalendarView;
00048 
00049 namespace KCal { class CalendarResources; }
00050 
00051 using namespace KCal;
00052 
00053 // Workaround for moc workaround for visual c++ 6.0 sucking
00054 typedef KOrg::MainWindow KOrgMainWindow;
00055 typedef KParts::MainWindow KPartsMainWindow;
00056 
00065 class KOrganizer : public KPartsMainWindow, public KOrgMainWindow
00066 {
00067     Q_OBJECT
00068   TQ_OBJECT
00069   public:
00074     KOrganizer( const char *name = 0 );
00075     virtual ~KOrganizer();
00076 
00077     void init( bool hasDocument );
00078 
00079     KOrg::CalendarViewBase *view() const;
00080     ActionManager *actionManager() { return mActionManager; }
00081     KActionCollection *getActionCollection() const { return actionCollection(); }
00082 
00087     bool openURL( const KURL &url, bool merge = false );
00089     bool saveURL();
00091     bool saveAsURL( const KURL & kurl );
00093     KURL getCurrentURL() const;
00094 
00095     virtual KXMLGUIFactory *mainGuiFactory() { return factory(); }
00096     virtual KXMLGUIClient *mainGuiClient() { return this; }
00097     virtual TQWidget *topLevelWidget() { return this; }
00098 
00099     virtual bool isCurrentlyActivePart();
00100 
00101   public slots:
00103     void showStatusMessage( const TQString & );
00104 
00105   protected slots:
00106 
00110     void readSettings();
00111 
00113     void writeSettings();
00114 
00115     void statusBarPressed( int );
00116 
00118     void setTitle();
00119 
00120     void newMainWindow( const KURL & );
00121 
00122   protected:
00123     void initActions();
00124 //    void initViews();
00125 
00127     bool queryClose();
00128     bool queryExit();
00129 
00130     /* Session management */
00131     void saveProperties( KConfig * );
00132     void readProperties( KConfig * );
00133 
00134   private:
00135     CalendarView *mCalendarView;  // Main view widget
00136     KOrg::Part::List mParts; // List of parts loaded
00137 
00138     // status bar ids
00139     enum { ID_HISTORY, ID_GENERAL, ID_ACTIVE, ID_MESSAGES_IN, ID_MESSAGES_OUT };
00140     ActionManager *mActionManager;
00141 };
00142 
00143 #endif