Qucs-GUI  0.0.18
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
textdoc.h
Go to the documentation of this file.
1 /***************************************************************************
2  textdoc.h
3  -----------
4 Copyright (C) 2006 by Michael Margraf <michael.margraf@alumni.tu-berlin.de>
5 Copyright (C) 2014 by Guilherme Brondani Torri <guitorri@gmail.com>
6 
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef TEXTDOC_H
19 #define TEXTDOC_H
20 
21 #include <QPlainTextEdit>
22 #include <QFont>
23 
24 #include "qucsdoc.h"
25 
31 class SyntaxHighlighter;
32 
33 extern const char *smallsave_xpm[];// icon for unsaved files (diskette)
34 extern const char *empty_xpm[]; // provides same height than "smallsave_xpm"
35 
36 // device type flags
37 #define DEV_BJT 0x0001
38 #define DEV_MOS 0x0002
39 #define DEV_MASK_DEV 0x00FF
40 #define DEV_DIG 0x0100
41 #define DEV_ANA 0x0200
42 #define DEV_ALL 0x0300
43 #define DEV_MASK_TYP 0xFF00
44 #define DEV_DEF 0x0200 // default value
45 
49 class TextDoc : public QPlainTextEdit, public QucsDoc {
50  Q_OBJECT
51 public:
52  TextDoc (QucsApp *, const QString&);
53  ~TextDoc ();
54 
55  void setName (const QString&);
56  bool load ();
57  int save ();
58  float zoomBy (float);
59  void showNoZoom ();
60  void becomeCurrent (bool);
61  bool loadSimulationTime (QString&);
62  void commentSelected ();
63  void insertSkeleton ();
64  void setLanguage (int);
65  void setLanguage (const QString&);
66  QString getModuleName (void);
67 
68 
69  QFont TextFont;
70 
71  bool simulation; // simulation or module
72  QString Library; // library this document belongs to
73  QString Libraries; // libraries to be linked with
74  QString ShortDesc; // icon description
75  QString LongDesc; // component description
76  QString Icon; // icon file
77  bool recreate; // recreate output file
78  int devtype; // device type
79 
80  bool SetChanged;
81  int language;
82 
83  bool loadSettings (void);
84  bool saveSettings (void);
85  void refreshLanguage(void);
86 
87  QMenu* createStandardContextMenu(const QPoint&);
88 
89 public slots:
90  void slotCursorPosChanged ();
91  void slotSetChanged ();
92 
93 private:
95 
96 private slots:
97  void highlightCurrentLine();
98 };
99 
100 #endif
void slotCursorPosChanged()
TextDoc::slotCursorPosChanged update status bar with line:column.
Definition: textdoc.cpp:273
int save()
TextDoc::save saves the current document and it settings.
Definition: textdoc.cpp:346
QString Libraries
Definition: textdoc.h:73
void becomeCurrent(bool)
TextDoc::becomeCurrent sets text document as current.
Definition: textdoc.cpp:226
~TextDoc()
TextDoc::~TextDoc Text document destructor.
Definition: textdoc.cpp:91
float zoomBy(float)
TextDoc::zoomBy increases/decreases the text font size.
Definition: textdoc.cpp:379
QString Library
Definition: textdoc.h:72
const char * empty_xpm[]
Definition: qucsdoc.cpp:65
bool saveSettings(void)
TextDoc::saveSettings saves the text document settings .cfg.
Definition: textdoc.cpp:134
bool recreate
Definition: textdoc.h:77
bool simulation
Definition: textdoc.h:71
QString Icon
Definition: textdoc.h:76
void setLanguage(int)
TextDoc::setLanguage(int)
Definition: textdoc.cpp:125
int language
Definition: textdoc.h:81
QString getModuleName(void)
TextDoc::getModuleName parse the module name ou of the text file contents.
Definition: textdoc.cpp:496
QString LongDesc
Definition: textdoc.h:75
QFont TextFont
Definition: textdoc.h:69
int devtype
Definition: textdoc.h:78
bool loadSimulationTime(QString &)
TextDoc::loadSimulationTime set SimTime member variable.
Definition: textdoc.cpp:411
bool load()
TextDoc::load loads a text document.
Definition: textdoc.cpp:322
SyntaxHighlighter * syntaxHighlight
Definition: textdoc.h:94
bool loadSettings(void)
TextDoc::loadSettings loads the text document settings.
Definition: textdoc.cpp:162
void slotSetChanged()
TextDoc::slotSetChanged togles tab icon to indicate unsaved changes.
Definition: textdoc.cpp:286
void refreshLanguage(void)
Definition: textdoc.cpp:546
TextDoc(QucsApp *, const QString &)
TextDoc::TextDoc Text document constructor.
Definition: textdoc.cpp:42
void setName(const QString &)
TextDoc::setName sets the text file name on its tab.
Definition: textdoc.cpp:206
void insertSkeleton()
TextDoc::insertSkeleton adds a basic skeleton for type of text file.
Definition: textdoc.cpp:479
The TextDoc class definition.
Definition: textdoc.h:49
void commentSelected()
TextDoc::commentSelected toggles the comment of selected text See also QucsApp::slotEditActivate.
Definition: textdoc.cpp:424
Definition: qucs.h:61
void showNoZoom()
TextDoc::showNoZoom resets the font scaling.
Definition: textdoc.cpp:397
bool SetChanged
Definition: textdoc.h:80
QString ShortDesc
Definition: textdoc.h:74
void highlightCurrentLine()
TextDoc::highlightCurrentLine mark the current line.
Definition: textdoc.cpp:527
QMenu * createStandardContextMenu(const QPoint &)
TextDoc::createStandardContextMenu creates the standard context menu.
Definition: textdoc.cpp:308
const char * smallsave_xpm[]
Definition: qucsdoc.cpp:28