"Fossies" - the Fresh Open Source Software Archive

Member "cb2bib-2.0.1/src/c2bClipEdit.h" (12 Feb 2021, 1367 Bytes) of package /linux/privat/cb2bib-2.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "c2bClipEdit.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.0.0_vs_2.0.1.

    1 /***************************************************************************
    2  *   Copyright (C) 2004-2021 by Pere Constans
    3  *   constans@molspaces.com
    4  *   cb2Bib version 2.0.1. Licensed under the GNU GPL version 3.
    5  *   See the LICENSE file that comes with this distribution.
    6  ***************************************************************************/
    7 #ifndef C2BCLIPEDIT_H
    8 #define C2BCLIPEDIT_H
    9 
   10 #include <QPlainTextEdit>
   11 
   12 
   13 /**
   14     @author Pere Constans
   15 */
   16 class c2bClipEdit : public QPlainTextEdit
   17 {
   18 
   19     Q_OBJECT
   20 
   21 public:
   22     enum Mode
   23     {
   24         Editor,
   25         Browser
   26     };
   27 
   28     explicit c2bClipEdit(const Mode mode, QWidget* parentw = 0);
   29     ~c2bClipEdit();
   30 
   31     void setText(const QString& text, const QString& tagged_text = QString());
   32     void setTaggedViewMode(bool tagged_view);
   33     void insertTag(const QString& tag);
   34     void updatePlainText(const QString& text);
   35 
   36 
   37 signals:
   38     void userEndedSelection(const QPoint& position);
   39 
   40 
   41 protected:
   42     virtual void contextMenuEvent(QContextMenuEvent* qevent);
   43     virtual void keyPressEvent(QKeyEvent* qevent);
   44     virtual void keyReleaseEvent(QKeyEvent* qevent);
   45     virtual void mouseReleaseEvent(QMouseEvent* qevent);
   46 
   47 
   48 private slots:
   49     virtual void selectionHasChanged();
   50 
   51 
   52 private:
   53     QString _tagged_text;
   54     QString _text;
   55     bool _has_selecting_ended;
   56     bool _is_tagged_view;
   57 };
   58 
   59 #endif