korganizer
koeditorattachments.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef KOEDITORATTACHMENTS_H
00026 #define KOEDITORATTACHMENTS_H
00027
00028 #include <qwidget.h>
00029 #include <kurl.h>
00030
00031 namespace KCal {
00032 class Incidence;
00033 class Attachment;
00034 }
00035
00036 class QIconViewItem;
00037 class AttachmentIconView;
00038 class QMimeSource;
00039 class QPushButton;
00040 class QPopupMenu;
00041 class KAction;
00042
00043 class KOEditorAttachments : public QWidget
00044 {
00045 Q_OBJECT
00046 public:
00047 KOEditorAttachments( int spacing = 8, QWidget *parent = 0,
00048 const char *name = 0 );
00049 ~KOEditorAttachments();
00050
00051 void addAttachment( const KURL &uri,
00052 const QString &mimeType = QString::null, bool asUri = true );
00053 void addAttachment( KCal::Attachment *attachment );
00054
00056 void setDefaults();
00058 void readIncidence( KCal::Incidence * );
00060 void writeIncidence( KCal::Incidence * );
00061
00062 bool hasAttachments();
00063
00064 protected slots:
00065 void showAttachment( QIconViewItem *item );
00066 void slotAdd();
00067 void slotAddData();
00068 void slotEdit();
00069 void slotRemove();
00070 void slotShow();
00071 void dragEnterEvent( QDragEnterEvent *event );
00072 void dropEvent( QDropEvent *event );
00073 void slotCopy();
00074 void slotCut();
00075 void slotPaste();
00076 void selectionChanged();
00077 void contextMenu( QIconViewItem* item, const QPoint &pos );
00078 signals:
00079 void openURL( const KURL &url );
00080
00081 private:
00082 friend class AttachmentIconView;
00083 void handlePasteOrDrop( QMimeSource* source );
00084
00085 AttachmentIconView *mAttachments;
00086 QPushButton *mRemoveBtn;
00087 QPopupMenu *mContextMenu, *mAddMenu;
00088 KAction *mOpenAction, *mCopyAction, *mCutAction;
00089 };
00090
00091 #endif
|