File indexing completed on 2024-04-28 15:51:38

0001 /*
0002     SPDX-FileCopyrightText: 2019 Simone Gaiarin <simgunz@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef _ANNOTATIONACTIONHANDLER_H_
0008 #define _ANNOTATIONACTIONHANDLER_H_
0009 
0010 #include <QObject>
0011 
0012 class QAction;
0013 class QColor;
0014 class QFont;
0015 class KActionCollection;
0016 class PageViewAnnotator;
0017 class AnnotationActionHandlerPrivate;
0018 
0019 /**
0020  * @short Handles all the actions of the annotation toolbar
0021  */
0022 class AnnotationActionHandler : public QObject
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     AnnotationActionHandler(PageViewAnnotator *parent, KActionCollection *ac);
0028     ~AnnotationActionHandler() override;
0029 
0030     /**
0031      * @short Reads the settings for the current annotation and rebuild the quick annotations menu
0032      *
0033      * This method is called each time okularpartrc is modified. This happens in the following
0034      * situations (among others): the quick annotations are modified from the KCM settings
0035      * page, a tool is modified using the "advanced settings" action, a quick annotation is
0036      * selected, an annotation property (line width, colors, opacity, font) is modified.
0037      */
0038     void setupAnnotationToolBarVisibilityAction();
0039     void reparseBuiltinToolsConfig();
0040     void reparseQuickToolsConfig();
0041     void setToolsEnabled(bool on);
0042     void setTextToolsEnabled(bool on);
0043     void deselectAllAnnotationActions();
0044 
0045 private Q_SLOTS:
0046     void slotAnnotationToolBarVisibilityChanged(bool visible);
0047 
0048 private:
0049     class AnnotationActionHandlerPrivate *d;
0050 };
0051 
0052 #endif // _ANNOTATIONACTIONHANDLER_H_