My Project  0.0.16
QUCS Mapping
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
textdoc.h
Go to the documentation of this file.
1 /***************************************************************************
2  textdoc.h
3  -----------
4  begin : Sat Mar 11 2006
5  copyright : (C) 2006 by Michael Margraf
6  email : michael.margraf@alumni.tu-berlin.de
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 <qtextedit.h>
22 #include <qfont.h>
23 
24 #include "qucsdoc.h"
25 
26 class SyntaxHighlighter;
27 
28 extern const char *smallsave_xpm[];// icon for unsaved files (diskette)
29 extern const char *empty_xpm[]; // provides same height than "smallsave_xpm"
30 
31 // device type flags
32 #define DEV_BJT 0x0001
33 #define DEV_MOS 0x0002
34 #define DEV_MASK_DEV 0x00FF
35 #define DEV_DIG 0x0100
36 #define DEV_ANA 0x0200
37 #define DEV_ALL 0x0300
38 #define DEV_MASK_TYP 0xFF00
39 #define DEV_DEF 0x0200 // default value
40 
41 class TextDoc : public QTextEdit, public QucsDoc {
42  Q_OBJECT
43 public:
44  TextDoc (QucsApp *, const QString&);
45  ~TextDoc ();
46 
47  void setName (const QString&);
48  bool load ();
49  int save ();
50  void print (QPrinter*, QPainter*, bool, bool);
51  float zoomBy (float);
52  void showAll ();
53  void showNoZoom ();
54  void becomeCurrent (bool);
55  bool loadSimulationTime (QString&);
56  void commentSelected ();
57  void insertSkeleton ();
58  void setLanguage (int);
59  void setLanguage (const QString&);
60  QString getModuleName (void);
61 
62  QFont TextFont;
63 
64  bool simulation; // simulation or module
65  QString Library; // library this document belongs to
66  QString Libraries; // libraries to be linked with
67  QString ShortDesc; // icon description
68  QString LongDesc; // component description
69  QString Icon; // icon file
70  bool recreate; // recreate output file
71  int devtype; // device type
72 
73  bool SetChanged;
74  int language;
75 
76  bool loadSettings (void);
77  bool saveSettings (void);
78 
79  QPopupMenu * createPopupMenu (const QPoint&);
80 
81 public slots:
82  void slotCursorPosChanged (int, int);
83  void slotSetChanged ();
84 
85 private:
86  SyntaxHighlighter * syntaxHighlight;
87 };
88 
89 #endif