actionmanager.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef KORG_ACTIONMANAGER_H
00027 #define KORG_ACTIONMANAGER_H
00028
00029 #include <qobject.h>
00030
00031 #include <kaction.h>
00032 #include <klocale.h>
00033 #include <kurl.h>
00034
00035 #include <korganizer/part.h>
00036 #include <korganizer/mainwindow.h>
00037
00038 #include "calendarview.h"
00039 #include "kcalendariface.h"
00040
00041 namespace KCal
00042 {
00043 class Calendar;
00044 class CalendarResources;
00045 }
00046
00047 class KAction;
00048 class KActionCollection;
00049 class KProcess;
00050 class KTempFile;
00051 class KXMLGUIClient;
00052 class CalendarView;
00053 class KOrganizer;
00054 class KONewStuff;
00055 class KOWindowList;
00056
00057 using namespace KCal;
00058
00065 class ActionManager : public QObject, public KCalendarIface
00066 {
00067 Q_OBJECT
00068 public:
00069 ActionManager( KXMLGUIClient *client, CalendarView *widget,
00070 QObject *parent, KOrg::MainWindow *mainWindow,
00071 bool isPart );
00072 virtual ~ActionManager();
00073
00075 void init();
00076
00077 CalendarView *view() const { return mCalendarView; }
00078
00082 void createCalendarLocal();
00087 void createCalendarResources();
00088
00092 void saveCalendar();
00093
00098 bool saveResourceCalendar();
00099
00104 bool openURL( const KURL &url, bool merge = false );
00106 bool mergeURL( const KURL &url );
00108 bool saveURL();
00110 bool saveAsURL( const KURL &kurl );
00112 bool saveModifiedURL();
00114 KURL url() const { return mURL; }
00115
00117 static KOrg::MainWindow* findInstance( const KURL &url );
00119 bool openURL( QString url );
00121 bool mergeURL( QString url );
00123 bool saveAsURL( QString url );
00125 void closeURL();
00127 QString getCurrentURLasString() const;
00129 virtual bool deleteEvent( QString uid );
00130
00132 bool eventRequest( QString request, QCString receiver, QString ical );
00134 bool eventReply( QString ical );
00135
00137 virtual ResourceRequestReply resourceRequest( const QValueList<QPair<QDateTime, QDateTime> >& busy,
00138 const QCString& resource,
00139 const QString& vCalIn );
00140
00141 void openEventEditor( QString );
00142 void openEventEditor( QString summary, QString description,
00143 QString attachment );
00144
00145 void openTodoEditor( QString );
00146 void openTodoEditor( QString summary, QString description,
00147 QString attachment );
00148
00149 void showTodoView();
00150 void showEventView();
00151
00152 QString localFileName();
00153
00154 bool queryClose();
00155
00156 signals:
00160 void actionNew( const KURL &url = KURL() );
00161
00165 void actionKeyBindings();
00166
00172 void configChanged();
00173
00178 void closingDown();
00179
00183 void filterActivated( int );
00184
00185 public slots:
00190 void updateConfig();
00191
00192 void setDestinationPolicy();
00193
00194 void processIncidenceSelection( Incidence * );
00195 void keyBindings();
00196
00201 void readSettings();
00202
00206 void writeSettings();
00207
00208
00209 void saveProperties( KConfig * );
00210 void readProperties( KConfig * );
00211
00212 void loadParts();
00213
00214 void importResource( const QString &url );
00215
00216 protected slots:
00217
00219 void file_new();
00220
00222 void file_open();
00223
00225 void file_openRecent( const KURL &url );
00226
00228 void file_import();
00229
00231 void file_merge();
00232
00234 void file_revert();
00235
00237 void file_archive();
00238
00240 void file_save();
00241
00243 void file_saveas();
00244
00246 void file_close();
00247
00249 void configureDateTime();
00250
00252 void showTip();
00253
00255 void showTipOnStart();
00256
00257 void downloadNewStuff();
00258 void uploadNewStuff();
00259
00260 void toggleFilterView();
00261
00263 void checkAutoSave();
00264
00265 void configureDateTimeFinished(KProcess *);
00266
00267 void setTitle();
00268
00269 void updateUndoAction( const QString & );
00270
00271 void updateRedoAction( const QString & );
00272
00273 protected:
00275 KURL getSaveURL();
00276
00277 void initCalendar( Calendar *cal );
00278
00279 private slots:
00280 void dumpText( const QString & );
00281
00282 private:
00284 void initActions();
00285 void enableIncidenceActions( bool enable );
00286
00287 KOrg::Part::List mParts;
00288 KURL mURL;
00289 QString mFile;
00290 QString mLastUrl;
00291
00292 KTempFile *mTempFile;
00293 QTimer *mAutoSaveTimer;
00294
00295
00296 static KOWindowList *mWindowList;
00297
00298
00299 KRecentFilesAction *mRecent;
00300 KToggleAction *mFilterViewAction;
00301 KAction *mShowIncidenceAction;
00302 KAction *mEditIncidenceAction;
00303 KAction *mDeleteIncidenceAction;
00304
00305 KAction *mCutAction;
00306 KAction *mCopyAction;
00307 KAction *mDeleteAction;
00308 KAction *mNextXDays;
00309 KAction *mPublishEvent;
00310
00311 KAction *mUndoAction;
00312 KAction *mRedoAction;
00313
00314 KXMLGUIClient *mGUIClient;
00315 KActionCollection *mACollection;
00316 CalendarView *mCalendarView;
00317 KOrg::MainWindow *mMainWindow;
00318 bool mIsPart;
00319
00320 KONewStuff *mNewStuff;
00321 bool mHtmlExportSync;
00322
00323 Calendar *mCalendar;
00324 CalendarResources *mCalendarResources;
00325
00326 bool mIsClosing;
00327 };
00328
00329 #endif
This file is part of the documentation for korganizer Library Version 3.2.2.