author | jowenn <jowenn> | 2002-11-10 21:08:01 (UTC) |
---|---|---|
committer | jowenn <jowenn> | 2002-11-10 21:08:01 (UTC) |
commit | e97a6da57804aa14907dec327fbae71bff9b383e (patch) (unidiff) | |
tree | 15f6ee292dba24bdda72f5c72f6d2224c3516763 /noncore/apps/tinykate/libkate/document/katedialogs.h | |
parent | 7c012ee8cd16d8befacc6f6750711443fac0fd5e (diff) | |
download | opie-e97a6da57804aa14907dec327fbae71bff9b383e.zip opie-e97a6da57804aa14907dec327fbae71bff9b383e.tar.gz opie-e97a6da57804aa14907dec327fbae71bff9b383e.tar.bz2 |
import of tiny kate. (saving not possible yet)
Diffstat (limited to 'noncore/apps/tinykate/libkate/document/katedialogs.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tinykate/libkate/document/katedialogs.h | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katedialogs.h b/noncore/apps/tinykate/libkate/document/katedialogs.h new file mode 100644 index 0000000..f37f45a --- a/dev/null +++ b/noncore/apps/tinykate/libkate/document/katedialogs.h | |||
@@ -0,0 +1,160 @@ | |||
1 | /*************************************************************************** | ||
2 | katedialogs.h - description | ||
3 | ------------------- | ||
4 | copyright : (C) 2001 by The Kate Team | ||
5 | (C) 2002 by Joseph Wenninger | ||
6 | email : kwrite-devel@kde.org | ||
7 | jowenn@kde.org | ||
8 | |||
9 | ***************************************************************************/ | ||
10 | |||
11 | /*************************************************************************** | ||
12 | * * | ||
13 | * This program is free software; you can redistribute it and/or modify * | ||
14 | * it under the terms of the GNU General Public License as published by * | ||
15 | * the Free Software Foundation; either version 2 of the License, or * | ||
16 | * (at your option) any later version. * | ||
17 | * * | ||
18 | ***************************************************************************/ | ||
19 | #ifndef KATEDIALOGS_H | ||
20 | #define KATEDIALOGS_H | ||
21 | #include <kdialog.h> | ||
22 | #include <kdialogbase.h> | ||
23 | #include "katesyntaxdocument.h" | ||
24 | #include "katehighlight.h" | ||
25 | #include <klistview.h> | ||
26 | #include <qtabwidget.h> | ||
27 | #include <kcolorbutton.h> | ||
28 | |||
29 | class QWidgetStack; | ||
30 | class QVBox; | ||
31 | class KListView; | ||
32 | class QListViewItem; | ||
33 | struct syntaxContextData; | ||
34 | class QCheckBox; | ||
35 | //class ItemFont; | ||
36 | #define HlEUnknown 0 | ||
37 | #define HlEContext 1 | ||
38 | #define HlEItem 2 | ||
39 | //-------- | ||
40 | |||
41 | |||
42 | class StyleChanger : public QWidget { | ||
43 | Q_OBJECT | ||
44 | public: | ||
45 | StyleChanger(QWidget *parent ); | ||
46 | void setRef(ItemStyle *); | ||
47 | void setEnabled(bool); | ||
48 | protected slots: | ||
49 | void changed(); | ||
50 | protected: | ||
51 | ItemStyle *style; | ||
52 | KColorButton *col; | ||
53 | KColorButton *selCol; | ||
54 | QCheckBox *bold; | ||
55 | QCheckBox *italic; | ||
56 | }; | ||
57 | |||
58 | class HighlightDialogPage : public QTabWidget | ||
59 | { | ||
60 | Q_OBJECT | ||
61 | public: | ||
62 | HighlightDialogPage(HlManager *, ItemStyleList *, HlDataList *, int hlNumber, | ||
63 | QWidget *parent=0, const char *name=0); | ||
64 | void saveData(); | ||
65 | |||
66 | protected slots: | ||
67 | void defaultChanged(int); | ||
68 | |||
69 | void hlChanged(int); | ||
70 | void itemChanged(int); | ||
71 | void changed(); | ||
72 | void hlEdit(); | ||
73 | void hlNew(); | ||
74 | protected: | ||
75 | StyleChanger *defaultStyleChanger; | ||
76 | ItemStyleList *defaultItemStyleList; | ||
77 | |||
78 | void writeback(); | ||
79 | QComboBox *itemCombo, *hlCombo; | ||
80 | QLineEdit *wildcards; | ||
81 | QLineEdit *mimetypes; | ||
82 | QCheckBox *styleDefault; | ||
83 | StyleChanger *styleChanger; | ||
84 | |||
85 | HlDataList *hlDataList; | ||
86 | HlData *hlData; | ||
87 | ItemData *itemData; | ||
88 | }; | ||
89 | |||
90 | class ItemInfo | ||
91 | { | ||
92 | public: | ||
93 | ItemInfo():trans_i18n(),length(0){}; | ||
94 | ItemInfo(QString _trans,int _length):trans_i18n(_trans),length(_length){}; | ||
95 | QString trans_i18n; | ||
96 | int length; | ||
97 | }; | ||
98 | |||
99 | class HighlightDialog : public KDialogBase | ||
100 | { | ||
101 | Q_OBJECT | ||
102 | public: | ||
103 | HighlightDialog( HlManager *hlManager, ItemStyleList *styleList, | ||
104 | HlDataList *highlightDataList, | ||
105 | int hlNumber, QWidget *parent, | ||
106 | const char *name=0, bool modal=true ); | ||
107 | private: | ||
108 | HighlightDialogPage *content; | ||
109 | protected: | ||
110 | virtual void done(int r); | ||
111 | }; | ||
112 | |||
113 | class HlEditDialog : public KDialogBase | ||
114 | { | ||
115 | Q_OBJECT | ||
116 | public: | ||
117 | HlEditDialog(HlManager *,QWidget *parent=0, const char *name=0, bool modal=true, HlData *data=0); | ||
118 | private: | ||
119 | class QWidgetStack *stack; | ||
120 | class QVBox *contextOptions, *itemOptions; | ||
121 | class KListView *contextList; | ||
122 | class QListViewItem *currentItem; | ||
123 | void initContextOptions(class QVBox *co); | ||
124 | void initItemOptions(class QVBox *co); | ||
125 | void loadFromDocument(HlData *hl); | ||
126 | void showContext(); | ||
127 | void showItem(); | ||
128 | |||
129 | QListViewItem *addContextItem(QListViewItem *_parent,QListViewItem *prev,struct syntaxContextData *data); | ||
130 | void insertTranslationList(QString tag, QString trans,int length); | ||
131 | void newDocument(); | ||
132 | |||
133 | class QLineEdit *ContextDescr; | ||
134 | class QComboBox *ContextAttribute; | ||
135 | class QComboBox *ContextLineEnd; | ||
136 | |||
137 | class QComboBox *ItemType; | ||
138 | class QComboBox *ItemContext; | ||
139 | class QLineEdit *ItemParameter; | ||
140 | class QComboBox *ItemAttribute; | ||
141 | |||
142 | class QMap<int,QString> id2tag; | ||
143 | class QMap<int,ItemInfo> id2info; | ||
144 | class QMap<QString,int> tag2id; | ||
145 | int transTableCnt; | ||
146 | protected slots: | ||
147 | void currentSelectionChanged ( QListViewItem * ); | ||
148 | void contextDescrChanged(const QString&); | ||
149 | void contextLineEndChanged(int); | ||
150 | void contextAttributeChanged(int); | ||
151 | void contextAddNew(); | ||
152 | |||
153 | void ItemTypeChanged(int id); | ||
154 | void ItemParameterChanged(const QString& name); | ||
155 | void ItemAttributeChanged(int attr); | ||
156 | void ItemContextChanged(int cont); | ||
157 | void ItemAddNew(); | ||
158 | }; | ||
159 | |||
160 | #endif | ||