korganizer Library API Documentation

korganizer.h

00001 /*
00002     This file is part of KOrganizer.
00003     Copyright (c) 1997, 1998, 1999
00004     Preston Brown (preston.brown@yale.edu)
00005     Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl)
00006     Ian Dawes (iadawes@globalserve.net)
00007     Laszlo Boloni (boloni@cs.purdue.edu)
00008     Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org>
00009 
00010     This program is free software; you can redistribute it and/or modify
00011     it under the terms of the GNU General Public License as published by
00012     the Free Software Foundation; either version 2 of the License, or
00013     (at your option) any later version.
00014 
00015     This program is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00018     GNU General Public License for more details.
00019 
00020     You should have received a copy of the GNU General Public License
00021     along with this program; if not, write to the Free Software
00022     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00023 
00024     As a special exception, permission is given to link this program
00025     with any edition of Qt, and distribute the resulting executable,
00026     without including the source code for Qt in the source distribution.
00027 */
00028 #ifndef KORGANIZER_H
00029 #define KORGANIZER_H
00030 
00031 #include <qframe.h>
00032 #include <qlayout.h>
00033 #include <qwidget.h>
00034 #include <qptrlist.h>
00035 #include <qtabdialog.h>
00036 #include <qframe.h>
00037 #include <qsplitter.h>
00038 
00039 #include <ktoolbar.h>
00040 #include <kapplication.h>
00041 #include <klocale.h>
00042 #include <kstatusbar.h>
00043 #include <kmenubar.h>
00044 #include <kurl.h>
00045 
00046 #include <libkcal/calendar.h>
00047 
00048 #include <korganizer/mainwindow.h>
00049 #include <korganizer/part.h>
00050 
00051 #include "kalarmd/alarmdaemoniface_stub.h"
00052 
00053 #include "calendarview.h"
00054 #include "korganizeriface.h"
00055 
00056 class KTempFile;
00057 class KRecentFilesAction;
00058 class KOWindowList;
00059 class KToggleAction;
00060 class KProcess;
00061 
00062 class KONewStuff;
00063 
00064 using namespace KCal;
00065 
00074 class KOrganizer : public KOrg::MainWindow, virtual public KOrganizerIface
00075 {
00076     Q_OBJECT
00077   public:
00083     KOrganizer( const char *name=0 );
00084     virtual ~KOrganizer();
00085 
00086     KOrg::CalendarViewBase *view() const { return mCalendarView; }
00087 
00092     bool openURL(const KURL &url,bool merge=false);
00094     bool mergeURL(const KURL &url);
00096     bool saveURL();
00098     bool saveAsURL(const KURL & kurl);
00100     bool saveModifiedURL();
00102     KURL getCurrentURL() const { return mURL; }
00103 
00105     static KOrganizer* findInstance(const KURL &url);
00106     static void setStartedKAddressBook(bool tmpBool) { startedKAddressBook = tmpBool; }
00108     bool openURL(QString url);
00110     bool mergeURL(QString url);
00112     bool saveAsURL(QString url);
00114     void closeURL();
00116     QString getCurrentURLasString() const;
00118     virtual bool deleteEvent(QString uid);
00119 
00120     bool isActive() { return mActive; }
00121 
00122     QString localFileName();
00123 
00124   signals:
00125 
00129     void configChanged();
00130 
00133     void closingDown();
00134     
00136     void calendarActivated(KOrganizer *);
00137     
00138   public slots:
00139 
00142     void updateConfig();
00143 
00149     void setActive(bool active=true);
00150 
00152     void makeActive();
00153 
00155     void showStatusMessage(const QString &);
00156 
00157   protected slots:
00158  
00162     void readSettings();
00163   
00165     void writeSettings();
00166 
00168     void file_new();
00169 
00171     void file_open();
00172 
00174     void file_openRecent(const KURL& url);
00175 
00177     void file_import();
00178 
00180     void file_merge();
00181 
00183     void file_revert();
00184 
00186     void file_archive();
00187 
00189     void file_save();
00190 
00192     void file_saveas();
00193 
00195     void file_close();
00196 
00198     void file_quit();
00199 
00201     void configureDateTime();
00202 
00204     void configureToolbars();
00205 
00207     void editKeys();
00208     
00210     void showTip();
00211     
00213     void showTipOnStart();
00214     
00215     void processIncidenceSelection( Incidence * );
00216     
00217     void downloadNewStuff();
00218     void uploadNewStuff();
00219     
00220   protected slots:
00221 
00223     void toggleToolBars(bool);
00224 
00225     void toggleToolBar();
00226 
00227     void toggleStatusBar();
00228 
00229     void toggleFilterView();
00230 
00231     void statusBarPressed(int);
00232     
00234     void checkAutoSave();
00235 
00237     void setTitle();
00238 
00239     void setNumIncoming(int);
00240     void setNumOutgoing(int);
00241 
00242     void configureDateTimeFinished(KProcess *);
00243     
00244     void slotNewToolbarConfig();
00245         
00246   protected:
00247     void initActions();
00248 //    void initViews();
00249 
00251     bool queryClose();
00252     bool queryExit();
00253 
00254     /* Session management */
00255     void saveProperties(KConfig *);
00256     void readProperties(KConfig *);
00257 
00259     KURL getSaveURL();
00260 
00261     void enableIncidenceActions( bool enable );
00262 
00263   private slots:
00264     void dumpText(const QString &);  // only for debugging purposes
00265 
00266   private:
00267     void writeActiveState();
00268   
00269     // variables
00270     CalendarView *mCalendarView;  // Main view widget
00271     KOrg::Part::List mParts; // List of parts loaded
00272     KURL mURL;      // URL of calendar file
00273     QString mFile;  // Local name of calendar file
00274     QString mLastUrl;  // URL of last loaded calendar.
00275 
00276     KTempFile *mTempFile;
00277 
00278     QTimer         *mAutoSaveTimer;   // used if calendar is to be autosaved
00279 
00280     bool mActive;  // Indicates if this calendar is active (for alarm daemon)
00281 
00282     // list of all existing KOrganizer instances
00283     static KOWindowList *windowList;
00284 
00285     // Actions
00286     KRecentFilesAction *mRecent;
00287 
00288     QPtrList<KAction> mToolBarToggles; // List of toolbar hiding toggle actions
00289     KToggleAction *mToolBarToggleAction;
00290 
00291     KToggleAction *mStatusBarAction;
00292     KToggleAction *mFilterViewAction;
00293 
00294     KAction *mShowIncidenceAction;
00295     KAction *mEditIncidenceAction;
00296     KAction *mDeleteIncidenceAction;
00297 
00298     KAction *mCutAction;
00299     KAction *mCopyAction;
00300     KAction *mDeleteAction;
00301     
00302     KAction *mNextXDays;
00303 
00304     KAction *mPublishEvent;
00305 
00306     // status bar ids
00307     enum { ID_HISTORY, ID_GENERAL, ID_ACTIVE, ID_MESSAGES_IN, ID_MESSAGES_OUT };
00308 
00309     AlarmDaemonIface_stub mAlarmDaemonIface;
00310 
00311     static bool startedKAddressBook; //whether we started KAddressBook ourselves
00312 
00313     KONewStuff *mNewStuff;
00314 
00315     // if true then the html-export at savetime is synchonous (blocking)
00316     // this is needed when saving while quiting
00317     bool mHtmlExportSync;
00318 };
00319 
00320 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:41:10 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001