summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/document/katedialogs.h
Unidiff
Diffstat (limited to 'noncore/apps/tinykate/libkate/document/katedialogs.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katedialogs.h160
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
29class QWidgetStack;
30class QVBox;
31class KListView;
32class QListViewItem;
33struct syntaxContextData;
34class QCheckBox;
35//class ItemFont;
36#define HlEUnknown 0
37#define HlEContext 1
38#define HlEItem 2
39 //--------
40
41
42class 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
58class 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
90class 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
99class 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
113class 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