PDF4QT/Pdf4QtPageMaster/selectoutlinetoregroupdialog.h

75 lines
2.1 KiB
C
Raw Normal View History

2021-09-27 11:14:20 +02:00
// Copyright (C) 2021 Jakub Melka
//
// This file is part of PDF4QT.
//
// PDF4QT is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// with the written consent of the copyright owner, any later version.
//
// PDF4QT 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with PDF4QT. If not, see <https://www.gnu.org/licenses/>.
2024-03-16 17:02:44 +01:00
#ifndef PDFPAGEMASTER_SELECTOUTLINETOREGROUPDIALOG_H
#define PDFPAGEMASTER_SELECTOUTLINETOREGROUPDIALOG_H
2021-09-27 11:14:20 +02:00
#include "pdfdocument.h"
#include <QDialog>
#include <QModelIndex>
2021-09-27 11:14:20 +02:00
namespace Ui
{
2023-12-13 20:14:33 +01:00
class SelectOutlineToRegroupDialog;
2021-09-27 11:14:20 +02:00
}
namespace pdf
{
class PDFSelectableOutlineTreeItemModel;
}
2024-03-16 17:02:44 +01:00
namespace pdfpagemaster
2021-09-27 11:14:20 +02:00
{
2023-12-13 20:14:33 +01:00
class SelectOutlineToRegroupDialog : public QDialog
2021-09-27 11:14:20 +02:00
{
Q_OBJECT
public:
2023-12-13 20:14:33 +01:00
explicit SelectOutlineToRegroupDialog(const pdf::PDFDocument* document, QWidget* parent);
virtual ~SelectOutlineToRegroupDialog() override;
2021-09-27 11:14:20 +02:00
std::vector<const pdf::PDFOutlineItem*> getSelectedOutlineItems() const;
private:
void selectAll();
void deselectAll();
void invertSelection();
void selectLevel1();
void selectLevel2();
void selectSubtree();
void deselectSubtree();
void onViewContextMenuRequested(const QPoint& pos);
void manipulateTree(const QModelIndex& index, const std::function<void (QModelIndex)>& manipulator);
std::function<void (QModelIndex)> createCheckByDepthManipulator(int targetDepth) const;
2023-12-13 20:14:33 +01:00
Ui::SelectOutlineToRegroupDialog* ui;
2021-09-27 11:14:20 +02:00
const pdf::PDFDocument* m_document;
pdf::PDFSelectableOutlineTreeItemModel* m_model;
QModelIndex m_menuIndex;
};
2024-03-16 17:02:44 +01:00
} // namespace pdfpagemaster
2021-09-27 11:14:20 +02:00
2024-03-16 17:02:44 +01:00
#endif // PDFPAGEMASTER_SELECTOUTLINETOREGROUPDIALOG_H