"Fossies" - the Fresh Open Source Software Archive

Member "cb2bib-2.0.1/src/c2bEditor.h" (12 Feb 2021, 2933 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 "c2bEditor.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 C2BEDITOR_H
    8 #define C2BEDITOR_H
    9 
   10 #include "ui_c2bEditor.h"
   11 
   12 #include <QMainWindow>
   13 #include <QPointer>
   14 
   15 
   16 class QDockWidget;
   17 class QLabel;
   18 class QStackedWidget;
   19 class QSyntaxHighlighter;
   20 class bibSearcher;
   21 class c2bBibParser;
   22 class c2bReferenceList;
   23 class c2bSettings;
   24 class c2bTextBrowser;
   25 class c2bTextEdit;
   26 class findDialog;
   27 
   28 
   29 class c2bEditor : public QMainWindow
   30 {
   31 
   32     Q_OBJECT
   33 
   34 public:
   35     enum Mode
   36     {
   37         Annote,
   38         BibTeX,
   39         JAbbrev,
   40         NetQInfo,
   41         RegExp
   42     };
   43 
   44     c2bEditor(const QString& file, const Mode mode, QWidget* main, QWidget* parentw = 0);
   45     c2bEditor(const QString& file, bibSearcher* searcher, QWidget* main, QWidget* parentw = 0);
   46 
   47     ~c2bEditor();
   48 
   49     inline QString editorFilename() const
   50     {
   51         return _editor_fn;
   52     }
   53     bool closeEditor();
   54 
   55 
   56 signals:
   57     void editFileRenamed(const QString& old_name, const QString& new_name);
   58     void execute();
   59     void openBookmarks();
   60     void openFile(const QString& fn);
   61     void restartEngine();
   62     void restartQuery();
   63 
   64 
   65 protected:
   66     virtual void closeEvent(QCloseEvent* qevent);
   67 
   68 
   69 protected slots:
   70     bool fileSave();
   71     bool fileSaveAs();
   72     void cursorPositionChanged();
   73     void exportEntries();
   74     void fileOpen();
   75     void helpCb2Bib();
   76     void helpEditor();
   77     void htmlView();
   78     void isModified(int position, int charsRemoved, int charsAdded);
   79     void journalsToAbbreviated();
   80     void journalsToAlternateAbbreviated();
   81     void journalsToAlternateFull();
   82     void journalsToFull();
   83     void load();
   84     void overwriteModeChanged();
   85     void pasteCurrentBibTeX();
   86     void postProcess();
   87     void reload(const QString& fn);
   88     void saveAndExecute();
   89     void setViewMode(bool edit_mode);
   90     void showMessage(const QString& ms);
   91     void updateMetadata();
   92     void viewCb2Bib();
   93 
   94 
   95 private:
   96     Mode _editor_mode;
   97     QDockWidget* _dockWidgetP;
   98     QLabel* _lineLabelP;
   99     QLabel* _overwriteLabelP;
  100     QPointer<bibSearcher> _searcherP;
  101     QStackedWidget* _stackedWidgetP;
  102     QString _edit_reference_at_position;
  103     QString _editor_fn;
  104     QSyntaxHighlighter* _shP;
  105     QWidget* _c2b_mainP;
  106     Ui::c2bEditor ui;
  107     bool _is_modified_by_user;
  108     c2bBibParser* _bpP;
  109     c2bReferenceList* _referencesP;
  110     c2bSettings* _settingsP;
  111     c2bTextBrowser* _browserP;
  112     c2bTextEdit* _editorP;
  113     findDialog* _textFinderP;
  114     void createReferenceList();
  115     void importActions();
  116     void initEditor();
  117     void setEditorMode();
  118 
  119     QMenu* createPopupMenu() // to avoid default context menu
  120     {
  121         return 0;
  122     }
  123 };
  124 
  125 #endif