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

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 __REGEXPBUTTONS_H
0008 #define __REGEXPBUTTONS_H
0009 
0010 #include "widgetfactory.h"
0011 #include <QToolBar>
0012 
0013 class DoubleClickButton;
0014 class QButtonGroup;
0015 class QToolButton;
0016 
0017 class RegExpButtons : public QToolBar
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     explicit RegExpButtons(QWidget *parent, const QString &name = QString());
0023     void setFeatures(int features);
0024 
0025 protected:
0026     DoubleClickButton *insert(RegExpType tp, const QString &file, const QString &tooltip, const QString &whatsthis);
0027 
0028 public Q_SLOTS:
0029     void slotSelectNewAction();
0030     void slotUnSelect();
0031 
0032 protected Q_SLOTS:
0033     void slotSetKeepMode();
0034     void slotSetNonKeepMode();
0035 
0036 Q_SIGNALS:
0037     void clicked(int);
0038     void doSelect();
0039 
0040 private:
0041     QButtonGroup *_grp = nullptr;
0042     QToolButton *_selectBut = nullptr;
0043     QToolButton *_wordBoundary = nullptr;
0044     QToolButton *_nonWordBoundary = nullptr;
0045     QToolButton *_posLookAhead = nullptr;
0046     QToolButton *_negLookAhead = nullptr;
0047 
0048     /**
0049        This variable is true if the use wishes to continue editing in the
0050        selected mode after the previous editing is completed (that is, if the
0051        user has double clicked the buttons).
0052     */
0053     bool _keepMode;
0054 };
0055 
0056 #endif // __REGEXPBUTTON_H