• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kate
 

kate

  • kate
  • part
kateschema.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2001-2003 Christoph Cullmann <cullmann@kde.org>
3  Copyright (C) 2002, 2003 Anders Lund <anders.lund@lund.tdcadsl.dk>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef __KATE_SCHEMA_H__
21 #define __KATE_SCHEMA_H__
22 
23 #include "katehighlight.h"
24 #include "katedialogs.h"
25 
26 #include <tqstringlist.h>
27 #include <tqintdict.h>
28 #include <tqmap.h>
29 #include <tqlistview.h>
30 #include <tqfont.h>
31 
32 #include <tdeconfig.h>
33 #include <tdeaction.h>
34 
35 class KateView;
36 class KateStyleListItem;
37 class KateStyleListCaption;
38 
39 class KColorButton;
40 
41 class TQPopupMenu;
42 class KComboBox;
43 
44 class KateSchemaManager
45 {
46  public:
47  KateSchemaManager ();
48  ~KateSchemaManager ();
49 
53  void update (bool readfromfile = true);
54 
58  TDEConfig *schema (uint number);
59 
60  void addSchema (const TQString &t);
61 
62  void removeSchema (uint number);
63 
67  bool validSchema (uint number);
68 
72  uint number (const TQString &name);
73 
77  TQString name (uint number);
78 
82  const TQStringList &list () { return m_schemas; }
83 
84  static TQString normalSchema ();
85  static TQString printingSchema ();
86 
87  private:
88  TDEConfig m_config;
89  TQStringList m_schemas;
90 };
91 
92 
93 class KateViewSchemaAction : public TDEActionMenu
94 {
95  TQ_OBJECT
96 
97  public:
98  KateViewSchemaAction(const TQString& text, TQObject* parent = 0, const char* name = 0)
99  : TDEActionMenu(text, parent, name) { init(); };
100 
101  ~KateViewSchemaAction(){;};
102 
103  void updateMenu (KateView *view);
104 
105  private:
106  void init();
107 
108  TQGuardedPtr<KateView> m_view;
109  TQStringList names;
110  int last;
111 
112  public slots:
113  void slotAboutToShow();
114 
115  private slots:
116  void setSchema (int mode);
117 };
118 
119 //
120 // DIALOGS
121 //
122 
123 /*
124  TQListView that automatically adds columns for KateStyleListItems and provides a
125  popup menu and a slot to edit a style using the keyboard.
126  Added by anders, jan 23 2002.
127 */
128 class KateStyleListView : public TQListView
129 {
130  TQ_OBJECT
131 
132  friend class KateStyleListItem;
133 
134  public:
135  KateStyleListView( TQWidget *parent=0, bool showUseDefaults=false);
136  ~KateStyleListView() {};
137  /* Display a popupmenu for item i at the specified global position, eventually with a title,
138  promoting the context name of that item */
139  void showPopupMenu( KateStyleListItem *i, const TQPoint &globalPos, bool showtitle=false );
140  void emitChanged() { emit changed(); };
141 
142  void setBgCol( const TQColor &c ) { bgcol = c; }
143  void setSelCol( const TQColor &c ) { selcol = c; }
144  void setNormalCol( const TQColor &c ) { normalcol = c; }
145 
146  private slots:
147  /* Display a popupmenu for item i at item position */
148  void showPopupMenu( TQListViewItem *i, const TQPoint &globalPos );
149  /* call item to change a property, or display a menu */
150  void slotMousePressed( int, TQListViewItem*, const TQPoint&, int );
151  /* asks item to change the property in q */
152  void mSlotPopupHandler( int z );
153  void unsetColor( int );
154 
155  signals:
156  void changed();
157 
158  private:
159  TQColor bgcol, selcol, normalcol;
160  TQFont docfont;
161 };
162 
163 class KateSchemaConfigColorTab : public TQWidget
164 {
165  TQ_OBJECT
166 
167  public:
168  KateSchemaConfigColorTab( TQWidget *parent = 0, const char *name = 0 );
169  ~KateSchemaConfigColorTab();
170 
171  private:
172  KColorButton *m_back;
173  KColorButton *m_selected;
174  KColorButton *m_current;
175  KColorButton *m_bracket;
176  KColorButton *m_wwmarker;
177  KColorButton *m_iconborder;
178  KColorButton *m_tmarker;
179  KColorButton *m_linenumber;
180 
181  KColorButton *m_markers; // bg color for current selected marker
182  KComboBox* m_combobox; // switch marker type
183 
184  // Class for storing the properties on 1 schema.
185  class SchemaColors {
186  public:
187  TQColor back, selected, current, bracket, wwmarker, iconborder, tmarker, linenumber;
188  TQMap<int, TQColor> markerColors; // stores all markerColors
189  };
190 
191  // schemaid=data, created when a schema is entered
192  TQMap<int,SchemaColors> m_schemas;
193  // current schema
194  int m_schema;
195 
196  public slots:
197  void apply();
198  void schemaChanged( int newSchema );
199 
200  signals:
201  void changed(); // connected to parentWidget()->parentWidget() TQ_SLOT(slotChanged)
202 
203  protected slots:
204  void slotMarkerColorChanged(const TQColor&);
205  void slotComboBoxChanged(int index);
206 };
207 
208 typedef TQMap<int,TQFont> FontMap; // ### remove it
209 
210 class KateSchemaConfigFontTab : public TQWidget
211 {
212  TQ_OBJECT
213 
214  public:
215  KateSchemaConfigFontTab( TQWidget *parent = 0, const char *name = 0 );
216  ~KateSchemaConfigFontTab();
217 
218  public:
219  void readConfig (TDEConfig *config);
220 
221  public slots:
222  void apply();
223  void schemaChanged( int newSchema );
224 
225  signals:
226  void changed(); // connected to parentWidget()->parentWidget() TQ_SLOT(slotChanged)
227 
228  private:
229  class TDEFontChooser *m_fontchooser;
230  FontMap m_fonts;
231  int m_schema;
232 
233  private slots:
234  void slotFontSelected( const TQFont &font );
235 };
236 
237 class KateSchemaConfigFontColorTab : public TQWidget
238 {
239  TQ_OBJECT
240 
241  public:
242  KateSchemaConfigFontColorTab( TQWidget *parent = 0, const char *name = 0 );
243  ~KateSchemaConfigFontColorTab();
244 
245  public:
246  void schemaChanged (uint schema);
247  void reload ();
248  void apply ();
249 
250  KateAttributeList *attributeList (uint schema);
251 
252  private:
253  KateStyleListView *m_defaultStyles;
254  TQIntDict<KateAttributeList> m_defaultStyleLists;
255 };
256 
257 class KateSchemaConfigHighlightTab : public TQWidget
258 {
259  TQ_OBJECT
260 
261  public:
262  KateSchemaConfigHighlightTab( TQWidget *parent = 0, const char *name = 0, KateSchemaConfigFontColorTab *page = 0, uint hl = 0 );
263  ~KateSchemaConfigHighlightTab();
264 
265  public:
266  void schemaChanged (uint schema);
267  void reload ();
268  void apply ();
269 
270  protected slots:
271  void hlChanged(int z);
272 
273  private:
274  KateSchemaConfigFontColorTab *m_defaults;
275 
276  TQComboBox *hlCombo;
277  KateStyleListView *m_styles;
278 
279  uint m_schema;
280  int m_hl;
281 
282  TQIntDict< TQIntDict<KateHlItemDataList> > m_hlDict;
283 };
284 
285 class KateSchemaConfigPage : public KateConfigPage
286 {
287  TQ_OBJECT
288 
289  public:
290  KateSchemaConfigPage ( TQWidget *parent, class KateDocument *doc=0 );
291  ~KateSchemaConfigPage ();
292 
293  public slots:
294  void apply();
295  void reload();
296  void reset();
297  void defaults();
298 
299  private slots:
300  void update ();
301  void deleteSchema ();
302  void newSchema ();
303  void schemaChanged (int schema);
304 
305  void newCurrentPage (TQWidget *w);
306 
307  private:
308  int m_lastSchema;
309  int m_defaultSchema;
310 
311  class TQTabWidget *m_tabWidget;
312  class TQPushButton *btndel;
313  class TQComboBox *defaultSchemaCombo;
314  class TQComboBox *schemaCombo;
315  KateSchemaConfigColorTab *m_colorTab;
316  KateSchemaConfigFontTab *m_fontTab;
317  KateSchemaConfigFontColorTab *m_fontColorTab;
318  KateSchemaConfigHighlightTab *m_highlightTab;
319 };
320 
321 #endif
KColorButton
KComboBox
TDEActionMenu
TDEConfig
TDEFontChooser
TDEFontChooser::font
TQFont font() const
TDEStdAccel::name
TQString name(StdAccel id)
TDEStdAccel::back
const TDEShortcut & back()
TDEStdAccel::reload
const TDEShortcut & reload()

kate

Skip menu "kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kate

Skip menu "kate"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kate by doxygen 1.9.1
This website is maintained by Timothy Pearson.