File indexing completed on 2024-04-21 05:51:39

0001 /*
0002  *  SPDX-FileCopyrightText: 2002-2003 Jesper K. Pedersen <blackie@kde.org>
0003  *
0004  *  SPDX-License-Identifier: LGPL-2.0-only
0005  **/
0006 
0007 #ifndef __scrolledEditorWindow
0008 #define __scrolledEditorWindow
0009 
0010 #include <QWidget>
0011 
0012 class QScrollArea;
0013 class RegExpEditorWindow;
0014 class RegExp;
0015 
0016 /**
0017    Regular Expression editor window.
0018 */
0019 class RegExpScrolledEditorWindow : public QWidget
0020 {
0021     Q_OBJECT
0022 public:
0023     RegExpScrolledEditorWindow(QWidget *parent);
0024     RegExp *regExp();
0025 
0026 private:
0027     RegExpScrolledEditorWindow()
0028     {
0029     } // Do not use!
0030 
0031 protected:
0032     void resizeEvent(QResizeEvent *) override;
0033 
0034 public Q_SLOTS:
0035     void slotSetRegExp(RegExp *);
0036     void slotInsertRegExp(int);
0037     void slotInsertRegExp(RegExp *);
0038     void slotDeleteSelection();
0039     void slotDoSelect();
0040     void slotCut();
0041     void slotCopy();
0042     void slotSave();
0043     void slotPaste();
0044 
0045 protected Q_SLOTS:
0046     void slotUpdateContentSize(QPointF focusPoint);
0047     void slotScroll(QPointF focusPoint);
0048 
0049 Q_SIGNALS:
0050     /**
0051        This signal is emitted when the user has completed an editing
0052        action. The application may chose to call @ref slotDoSelect as a
0053        consequence to reset to selection mode.
0054     */
0055     void doneEditing();
0056 
0057     /**
0058        This signal is emitted whenever a change has taken place in the editor widget
0059     */
0060     void change();
0061 
0062     /**
0063        This signal is emitted when the user saves a regular expression.
0064     */
0065     void savedRegexp();
0066 
0067     void anythingSelected(bool);
0068     void anythingOnClipboard(bool);
0069     void canSave(bool);
0070 
0071     /**
0072        This signal is emitted when the regular expression has changed, or
0073        when the selection has changed.
0074      */
0075     void verifyRegExp();
0076 
0077 private:
0078     RegExpEditorWindow *_editorWindow = nullptr;
0079     QScrollArea *_scrollArea = nullptr;
0080 };
0081 
0082 #endif // __scrolledEditorWindow