summaryrefslogtreecommitdiffstats
path: root/src/libs/dialogs/deletedialog.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/dialogs/deletedialog.h')
-rw-r--r--src/libs/dialogs/deletedialog.h140
1 files changed, 140 insertions, 0 deletions
diff --git a/src/libs/dialogs/deletedialog.h b/src/libs/dialogs/deletedialog.h
new file mode 100644
index 00000000..16ab9f89
--- /dev/null
+++ b/src/libs/dialogs/deletedialog.h
@@ -0,0 +1,140 @@
+/* ============================================================
+ *
+ * This file is a part of digiKam project
+ * http://www.digikam.org
+ *
+ * Date : 2005-05-07
+ * Description : a dialog to delete item.
+ *
+ * Copyright (C) 2004 by Michael Pyne <[email protected]>
+ * Copyright (C) 2006 by Ian Monroe <[email protected]>
+ * Copyright (C) 2006-2007 by Marcel Wiesweg <[email protected]>
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation;
+ * either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * ============================================================ */
+
+#ifndef _DELETEDIALOG_H
+#define _DELETEDIALOG_H
+
+// TQt includes.
+
+#include <tqcheckbox.h>
+
+// KDE includes.
+
+#include <kdialogbase.h>
+#include <kurl.h>
+
+// Local includes.
+
+#include "digikam_export.h"
+#include "deletedialogbase.h"
+
+class TQStringList;
+class TDEListBox;
+class KGuiItem;
+class TQLabel;
+class TQWidgetStack;
+
+namespace Digikam
+{
+
+namespace DeleteDialogMode
+{
+ enum ListMode
+ {
+ Files,
+ Albums,
+ Subalbums
+ };
+
+ enum DeleteMode
+ {
+ NoChoiceTrash, // "Do not show again" checkbox, does not show if config entry is set
+ NoChoiceDeletePermanently, // No checkbox
+ UserPreference, // Checkbox to toggle trash/permanent, preset to user's last preference
+ UseTrash, // same beckbox as above, preset to trash
+ DeletePermanently // same checkbox as above, preset to permanent
+ };
+}
+
+class DeleteWidget : public DeleteDialogBase
+{
+ TQ_OBJECT
+
+
+public:
+
+ DeleteWidget(TQWidget *parent = 0, const char *name = 0);
+
+ void setFiles(const KURL::List &files);
+ void setListMode(DeleteDialogMode::ListMode mode);
+ void setDeleteMode(DeleteDialogMode::DeleteMode deleteMode);
+
+protected slots:
+
+ void slotShouldDelete(bool shouldDelete);
+
+protected:
+
+ void updateText();
+ DeleteDialogMode::ListMode m_listMode;
+ DeleteDialogMode::DeleteMode m_deleteMode;
+};
+
+class DIGIKAM_EXPORT DeleteDialog : public KDialogBase
+{
+ TQ_OBJECT
+
+
+public:
+
+ enum Mode
+ {
+ ModeFiles,
+ ModeAlbums,
+ ModeSubalbums
+ };
+
+public:
+
+ DeleteDialog(TQWidget *parent, const char *name = "delete_dialog");
+
+ bool confirmDeleteList(const KURL::List &condemnedURLs,
+ DeleteDialogMode::ListMode listMode,
+ DeleteDialogMode::DeleteMode deleteMode);
+ bool shouldDelete() const { return m_widget->ddShouldDelete->isChecked(); }
+
+ void setURLs(const KURL::List &files);
+ void presetDeleteMode(DeleteDialogMode::DeleteMode mode);
+ void setListMode(DeleteDialogMode::ListMode mode);
+
+protected slots:
+
+ virtual void accept();
+ void slotShouldDelete(bool shouldDelete);
+
+private:
+
+ bool m_saveShouldDeleteUserPreference;
+ bool m_saveDoNotShowAgain;
+
+ KGuiItem m_trashGuiItem;
+
+ DeleteWidget *m_widget;
+};
+
+} // namespace Digikam
+
+#endif // _DELETEDIALOG_H
+