Qucs-GUI  0.0.19
/home/travis/build/Qucs/qucs/qucs/qucs/textdoc.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                                 textdoc.h
00003                                -----------
00004 Copyright (C) 2006 by Michael Margraf <michael.margraf@alumni.tu-berlin.de>
00005 Copyright (C) 2014 by Guilherme Brondani Torri <guitorri@gmail.com>
00006 
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef TEXTDOC_H
00019 #define TEXTDOC_H
00020 
00021 #include <QPlainTextEdit>
00022 #include <QFont>
00023 
00024 #include "qucsdoc.h"
00025 
00031 class SyntaxHighlighter;
00032 class QString;
00033 
00034 // device type flags
00035 #define DEV_BJT      0x0001
00036 #define DEV_MOS      0x0002
00037 #define DEV_MASK_DEV 0x00FF
00038 #define DEV_DIG      0x0100
00039 #define DEV_ANA      0x0200
00040 #define DEV_ALL      0x0300
00041 #define DEV_MASK_TYP 0xFF00
00042 #define DEV_DEF      0x0200 // default value
00043 
00047 class TextDoc : public QPlainTextEdit, public QucsDoc {
00048   Q_OBJECT
00049 public:
00050   TextDoc (QucsApp *, const QString&);
00051  ~TextDoc ();
00052 
00053   void  setName (const QString&);
00054   bool  load ();
00055   int   save ();
00056   float zoomBy (float);
00057   void  showNoZoom ();
00058   void  becomeCurrent (bool);
00059   bool  loadSimulationTime (QString&);
00060   void  commentSelected ();
00061   void  insertSkeleton ();
00062   void  setLanguage (int);
00063   void  setLanguage (const QString&);
00064   QString getModuleName (void);
00065 
00066 
00067   QFont TextFont;
00068 
00069   bool simulation;   // simulation or module
00070   QString Library;   // library this document belongs to
00071   QString Libraries; // libraries to be linked with
00072   QString ShortDesc; // icon description
00073   QString LongDesc;  // component description
00074   QString Icon;      // icon file
00075   bool recreate;     // recreate output file
00076   int devtype;       // device type
00077 
00078   bool SetChanged;
00079   int language;
00080 
00081   bool loadSettings (void);
00082   bool saveSettings (void);
00083   void refreshLanguage(void);
00084 
00085   QMenu* createStandardContextMenu();
00086 
00087 signals:
00088   void signalCursorPosChanged(int, int);
00089   void signalFileChanged(bool);
00090   void signalUndoState(bool);
00091   void signalRedoState(bool);
00092 
00093 public slots:
00094   void search(const QString &str, bool CaseSensitive, bool wordOnly, bool backward);
00095   void replace(const QString &str, const QString &str2, bool needConfirmed,
00096                bool CaseSensitive, bool wordOnly, bool backward);
00097   void slotCursorPosChanged ();
00098   void slotSetChanged ();
00099 
00100 private:
00101   SyntaxHighlighter * syntaxHighlight;
00102 
00103 private slots:
00104   void highlightCurrentLine();
00105   bool baseSearch(const QString &, bool, bool, bool);
00106 };
00107 
00108 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines