korganizer Library API Documentation

actionmanager.h

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
00005     Copyright (c) 2002 Don Sanders <sanders@kde.org>
00006     Copyright (c) 2003,2004 Cornelius Schumacher <schumacher@kde.org>
00007 
00008     This program is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program; if not, write to the Free Software
00020     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00021 
00022     As a special exception, permission is given to link this program
00023     with any edition of Qt, and distribute the resulting executable,
00024     without including the source code for Qt in the source distribution.
00025 */
00026 #ifndef KORG_ACTIONMANAGER_H
00027 #define KORG_ACTIONMANAGER_H
00028 
00029 #include <qobject.h>
00030 #include <kurl.h>
00031 #include <korganizer/part.h>
00032 
00033 #include "kcalendariface.h"
00034 
00035 namespace KCal
00036 {
00037   class Calendar;
00038   class CalendarResources;
00039   class Incidence;
00040   class ResourceCalendar;
00041 }
00042 namespace KOrg
00043 {
00044   class MainWindow;
00045 }
00046 
00047 class KAction;
00048 class KActionCollection;
00049 class KRecentFilesAction;
00050 class KToggleAction;
00051 class KConfig;
00052 class KProcess;
00053 class KTempFile;
00054 class KXMLGUIClient;
00055 class CalendarView;
00056 class KOrganizer;
00057 class KONewStuff;
00058 class KOWindowList;
00059 class ImportDialog;
00060 class ResourceView;
00061 
00062 using namespace KCal;
00063 
00070 class ActionManager : public QObject, public KCalendarIface
00071 {
00072     Q_OBJECT
00073   public:
00074     ActionManager( KXMLGUIClient *client, CalendarView *widget,
00075                    QObject *parent, KOrg::MainWindow *mainWindow,
00076                    bool isPart );
00077     virtual ~ActionManager();
00078 
00080     void init();
00081 
00082     CalendarView *view() const { return mCalendarView; }
00083 
00087     void createCalendarLocal();
00092     void createCalendarResources();
00093 
00097     void saveCalendar();
00098 
00103     bool saveResourceCalendar();
00104 
00105   public slots:
00110     bool openURL( const KURL &url, bool merge = false );
00112     bool saveURL();
00114     bool saveAsURL( const KURL &kurl );
00116     bool saveModifiedURL();
00117   public:
00119     KURL url() const { return mURL; }
00120 
00122     static KOrg::MainWindow* findInstance( const KURL &url );
00124     bool openURL( QString url );
00126     bool mergeURL( QString url );
00128     bool saveAsURL( QString url );
00130     void closeURL();
00132     QString getCurrentURLasString() const;
00134     virtual bool deleteEvent( const QString& uid );
00135 
00136     bool editIncidence( const QString& uid );
00137 
00139     virtual ResourceRequestReply resourceRequest( const QValueList<QPair<QDateTime, QDateTime> >& busy,
00140                                                   const QCString& resource,
00141                                                   const QString& vCalIn );
00142 
00143     void openEventEditor( QString );
00144     void openEventEditor( QString summary, QString description,
00145                           QString attachment );
00146     void openEventEditor( QString summary, QString description,
00147                           QString attachment, QStringList attendees );
00148 
00149     void openTodoEditor( QString );
00150     void openTodoEditor( QString summary, QString description,
00151                          QString attachment );
00152     void openTodoEditor( QString summary, QString description,
00153                          QString attachment, QStringList attendees );
00154 
00155     void showTodoView();
00156     void showEventView();
00157 
00158     void goDate( QDate );
00159     void goDate( QString );
00160 
00161     QString localFileName();
00162 
00163     bool queryClose();
00164 
00165   signals:
00169     void actionNew( const KURL &url = KURL() );
00170 
00174     void actionKeyBindings();
00175 
00181     void configChanged();
00182 
00187     void closingDown();
00188 
00192     void filterActivated( int );
00193 
00194   public slots:
00199     void updateConfig();
00200 
00201     void setDestinationPolicy();
00202 
00203     void processIncidenceSelection( Incidence * );
00204     void keyBindings();
00205 
00210     void readSettings();
00211 
00215     void writeSettings();
00216 
00217     /* Session management */
00218     void saveProperties( KConfig * );
00219     void readProperties( KConfig * );
00220 
00221     void loadParts();
00222 
00223     void importCalendar( const KURL &url );
00224 
00225   protected slots:
00226 
00228     void file_new();
00229 
00231     void file_open();
00232 
00234     void file_openRecent( const KURL &url );
00235 
00237     void file_import();
00238 
00240     void file_merge();
00241 
00243     void file_revert();
00244 
00246     void file_archive();
00247 
00249     void file_save();
00250 
00252     void file_saveas();
00253 
00255     void file_close();
00256 
00258     void configureDateTime();
00259 
00261     void showTip();
00262 
00264     void showTipOnStart();
00265 
00266     void downloadNewStuff();
00267     void uploadNewStuff();
00268 
00269     void toggleFilterView();
00270     void toggleResourceButtons();
00271 
00273     void checkAutoSave();
00274 
00276     void slotAutoArchivingSettingsModified();
00277 
00279     void slotAutoArchive();
00280 
00281     void configureDateTimeFinished(KProcess *);
00282 
00283     void setTitle();
00284 
00285     void updateUndoAction( const QString & );
00286 
00287     void updateRedoAction( const QString & );
00288 
00289     void slotImportDialogFinished( ImportDialog * );
00290 
00291   protected:
00293     KURL getSaveURL();
00294 
00295     void showStatusMessageOpen( const KURL &url, bool merge );
00296 
00297     void initCalendar( Calendar *cal );
00298 
00299     void exportToHTML();
00300 
00304     QWidget *dialogParent();
00305 
00306   private slots:
00307     void dumpText( const QString & );  // only for debugging purposes
00308 
00309   private:
00311     void initActions();
00312     void enableIncidenceActions( bool enable );
00313 
00314     KOrg::Part::List mParts; // List of parts loaded
00315     KURL mURL;      // URL of calendar file
00316     QString mFile;  // Local name of calendar file
00317     QString mLastUrl;  // URL of last loaded calendar.
00318 
00319     KTempFile *mTempFile;
00320     QTimer *mAutoSaveTimer;   // used if calendar is to be autosaved
00321     QTimer *mAutoArchiveTimer; // used for the auto-archiving feature
00322 
00323     // list of all existing KOrganizer instances
00324     static KOWindowList *mWindowList;
00325 
00326     // Actions
00327     KRecentFilesAction *mRecent;
00328     KToggleAction *mFilterViewAction;
00329     KToggleAction *mResourceButtonsAction;
00330     KAction *mShowIncidenceAction;
00331     KAction *mEditIncidenceAction;
00332     KAction *mDeleteIncidenceAction;
00333 
00334     KAction *mCutAction;
00335     KAction *mCopyAction;
00336     KAction *mDeleteAction;
00337     KAction *mNextXDays;
00338     KAction *mPublishEvent;
00339 
00340     KAction *mUndoAction;
00341     KAction *mRedoAction;
00342 
00343     KXMLGUIClient *mGUIClient;
00344     KActionCollection *mACollection;
00345     CalendarView *mCalendarView;
00346     KOrg::MainWindow *mMainWindow;
00347     bool mIsPart;
00348 
00349     KONewStuff *mNewStuff;
00350     bool mHtmlExportSync;
00351 
00352     // Either mCalendar *or* mCalendarResources is set.
00353     Calendar *mCalendar;
00354     CalendarResources *mCalendarResources;
00355 
00356     ResourceView *mResourceView;
00357 
00358     bool mIsClosing;
00359 };
00360 
00361 #endif
KDE Logo
This file is part of the documentation for korganizer Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Aug 23 18:22:11 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003