kate Library API Documentation

katedialogs.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2002, 2003 Anders Lund <anders.lund@lund.tdcadsl.dk>
00003    Copyright (C) 2003 Christoph Cullmann <cullmann@kde.org>
00004    Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
00005 
00006    Based on work of:
00007      Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
00008 
00009    This library is free software; you can redistribute it and/or
00010    modify it under the terms of the GNU Library General Public
00011    License version 2 as published by the Free Software Foundation.
00012 
00013    This library is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016    Library General Public License for more details.
00017 
00018    You should have received a copy of the GNU Library General Public License
00019    along with this library; see the file COPYING.LIB.  If not, write to
00020    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021    Boston, MA 02111-1307, USA.
00022 */
00023 
00024 #ifndef __KATE_DIALOGS_H__
00025 #define __KATE_DIALOGS_H__
00026 
00027 #include "katehighlight.h"
00028 #include "kateattribute.h"
00029 
00030 #include "../interfaces/document.h"
00031 
00032 #include <klistview.h>
00033 #include <kdialogbase.h>
00034 #include <kmimetype.h>
00035 
00036 #include <qstringlist.h>
00037 #include <qcolor.h>
00038 #include <qintdict.h>
00039 #include <qvbox.h>
00040 #include <qtabwidget.h>
00041 
00042 class KatePartPluginListItem;
00043 
00044 struct syntaxContextData;
00045 
00046 class KateDocument;
00047 class KateView;
00048 
00049 namespace KIO { class Job; }
00050 
00051 class KAccel;
00052 class KColorButton;
00053 class KComboBox;
00054 class KIntNumInput;
00055 class KKeyButton;
00056 class KKeyChooser;
00057 class KMainWindow;
00058 class KPushButton;
00059 class KRegExpDialog;
00060 class KIntNumInput;
00061 class KSpellConfig;
00062 
00063 class QButtonGroup;
00064 class QCheckBox;
00065 class QHBoxLayout;
00066 class QLabel;
00067 class QLineEdit;
00068 class QPushButton;
00069 class QRadioButton;
00070 class QSpinBox;
00071 class QListBoxItem;
00072 class QWidgetStack;
00073 class QVBox;
00074 class QListViewItem;
00075 class QCheckBox;
00076 
00077 class KateConfigPage : public Kate::ConfigPage
00078 {
00079   Q_OBJECT
00080 
00081   public:
00082     KateConfigPage ( QWidget *parent=0, const char *name=0 );
00083     virtual ~KateConfigPage ();
00084 
00085   public:
00086     bool changed () { return m_changed; }
00087 
00088   private slots:
00089     void somethingHasChanged ();
00090 
00091   private:
00092     bool m_changed;
00093 };
00094 
00095 class SpellConfigPage : public KateConfigPage
00096 {
00097   Q_OBJECT
00098 
00099   public:
00100     SpellConfigPage( QWidget* parent );
00101     ~SpellConfigPage() {};
00102 
00103     void apply();
00104     void reset () { ; };
00105     void defaults () { ; };
00106 
00107   private:
00108     KSpellConfig *cPage;
00109 };
00110 
00111 class GotoLineDialog : public KDialogBase
00112 {
00113   Q_OBJECT
00114 
00115   public:
00116 
00117     GotoLineDialog(QWidget *parent, int line, int max);
00118     int getLine();
00119 
00120   protected:
00121 
00122     KIntNumInput *e1;
00123     QPushButton *btnOK;
00124 };
00125 
00126 class IndentConfigTab : public KateConfigPage
00127 {
00128   Q_OBJECT
00129 
00130   public:
00131     IndentConfigTab(QWidget *parent);
00132 
00133   protected slots:
00134     void spacesToggled();
00135 
00136   protected:
00137     enum { numFlags = 6 };
00138     static const int flags[numFlags];
00139     QCheckBox *opt[numFlags];
00140     KIntNumInput *indentationWidth;
00141     QButtonGroup *m_tabs;
00142     KComboBox *m_indentMode;
00143 
00144   public slots:
00145     void apply ();
00146     void reload ();
00147     void reset () {};
00148     void defaults () {};
00149 };
00150 
00151 class SelectConfigTab : public KateConfigPage
00152 {
00153   Q_OBJECT
00154 
00155   public:
00156     SelectConfigTab(QWidget *parent);
00157 
00158   protected:
00159     QButtonGroup *m_tabs;
00160 
00161   public slots:
00162     void apply ();
00163     void reload ();
00164     void reset () {};
00165     void defaults () {};
00166 };
00167 
00168 class EditConfigTab : public KateConfigPage
00169 {
00170     Q_OBJECT
00171 
00172   public:
00173     EditConfigTab(QWidget *parent);
00174 
00175   protected:
00176     enum { numFlags = 5 };
00177     static const int flags[numFlags];
00178     QCheckBox *opt[numFlags];
00179 
00180     KIntNumInput *e1;
00181     KIntNumInput *e2;
00182     KIntNumInput *e3;
00183     KIntNumInput *e4;
00184     KComboBox *e5;
00185     QCheckBox *e6;
00186 
00187   public slots:
00188     void apply ();
00189     void reload ();
00190     void reset () {};
00191     void defaults () {};
00192 };
00193 
00194 class ViewDefaultsConfig : public KateConfigPage
00195 {
00196   Q_OBJECT
00197 
00198   public:
00199     ViewDefaultsConfig( QWidget *parent );
00200     ~ViewDefaultsConfig();
00201 
00202   private:
00203     QCheckBox *m_line;
00204     QCheckBox *m_folding;
00205     QCheckBox *m_collapseTopLevel;
00206     QCheckBox *m_icons;
00207     QCheckBox *m_dynwrap;
00208     KIntNumInput *m_dynwrapAlignLevel;
00209     QCheckBox *m_wwmarker;
00210     QLabel *m_dynwrapIndicatorsLabel;
00211     KComboBox *m_dynwrapIndicatorsCombo;
00212     QButtonGroup *m_bmSort;
00213 
00214   public slots:
00215   void apply ();
00216   void reload ();
00217   void reset ();
00218   void defaults ();
00219 };
00220 
00221 class EditKeyConfiguration: public KateConfigPage
00222 {
00223   Q_OBJECT
00224 
00225   public:
00226     EditKeyConfiguration( QWidget* parent, KateDocument* doc );
00227 
00228   public slots:
00229     void apply();
00230     void reload()   {};
00231     void reset()    {};
00232     void defaults() {};
00233 
00234   protected:
00235     void showEvent ( QShowEvent * );
00236 
00237   private:
00238     bool m_ready;
00239     class KateDocument *m_doc;
00240     class KActionCollection *m_ac;
00241     KKeyChooser* m_keyChooser;
00242 };
00243 
00244 class SaveConfigTab : public KateConfigPage
00245 {
00246   Q_OBJECT
00247   public:
00248   SaveConfigTab( QWidget *parent );
00249 
00250   public slots:
00251   void apply();
00252   void reload();
00253   void reset();
00254   void defaults();
00255 
00256   protected:
00257   KComboBox *m_encoding, *m_eol;
00258   QCheckBox *cbLocalFiles, *cbRemoteFiles;
00259   QCheckBox *replaceTabs, *removeSpaces;
00260   QLineEdit *leBuSuffix;
00261 };
00262 
00263 class KatePartPluginListItem;
00264 
00265 class KatePartPluginListView : public KListView
00266 {
00267   Q_OBJECT
00268 
00269   friend class KatePartPluginListItem;
00270 
00271   public:
00272     KatePartPluginListView (QWidget *parent = 0, const char *name = 0);
00273 
00274   signals:
00275     void stateChange(KatePartPluginListItem *, bool);
00276 
00277   private:
00278     void stateChanged(KatePartPluginListItem *, bool);
00279 };
00280 
00281 class PluginConfigPage : public KateConfigPage
00282 {
00283   Q_OBJECT
00284 
00285   public:
00286     PluginConfigPage (QWidget *parent);
00287     ~PluginConfigPage ();
00288 
00289   public slots:
00290     void apply ();
00291     void reload () {};
00292     void reset () {};
00293     void defaults () {};
00294 
00295   private:
00296     KatePartPluginListView *listView;
00297     QPtrList<KatePartPluginListItem> m_items;
00298 };
00299 
00307 class KMimeTypeChooser : public QVBox
00308 {
00309   Q_OBJECT
00310 
00311   public:
00312     KMimeTypeChooser( QWidget *parent=0, const QString& text=QString::null, const QStringList &selectedMimeTypes=0,
00313                       bool editbutton=true, bool showcomment=true, bool showpattern=true );
00314     ~KMimeTypeChooser() {};
00315     QStringList selectedMimeTypesStringList();
00316     QStringList patterns();
00317 
00318   public slots:
00319     void editMimeType();
00320     void slotCurrentChanged(QListViewItem* i);
00321 
00322   private:
00323     QListView *lvMimeTypes;
00324     QPushButton *btnEditMimeType;
00325 };
00326 
00340 class KMimeTypeChooserDlg : public KDialogBase
00341 {
00342   public:
00343     KMimeTypeChooserDlg( QWidget *parent=0,
00344                          const QString &caption=QString::null, const QString& text=QString::null,
00345                          const QStringList &selectedMimeTypes=QStringList(),
00346                          bool editbutton=true, bool showcomment=true, bool showpatterns=true );
00347     ~KMimeTypeChooserDlg();
00348 
00349     QStringList mimeTypes();
00350     QStringList patterns();
00351 
00352   private:
00353     KMimeTypeChooser *chooser;
00354 };
00355 
00356 class HlConfigPage : public KateConfigPage
00357 {
00358   Q_OBJECT
00359 
00360   public:
00361     HlConfigPage (QWidget *parent);
00362     ~HlConfigPage ();
00363 
00364   public slots:
00365     void apply ();
00366     void reload ();
00367     void reset () {};
00368     void defaults () {};
00369 
00370   protected slots:
00371     void hlChanged(int);
00372     void hlDownload();
00373     void showMTDlg();
00374 
00375   private:
00376     void writeback ();
00377 
00378     QComboBox *hlCombo;
00379     QLineEdit *wildcards;
00380     QLineEdit *mimetypes;
00381     class KIntNumInput *priority;
00382 
00383     QIntDict<HlData> hlDataDict;
00384     HlData *hlData;
00385 };
00386 
00387 class HlDownloadDialog: public KDialogBase
00388 {
00389   Q_OBJECT
00390 
00391   public:
00392     HlDownloadDialog(QWidget *parent, const char *name, bool modal);
00393     ~HlDownloadDialog();
00394 
00395   private:
00396     class QListView  *list;
00397     class QString listData;
00398 
00399   private slots:
00400     void listDataReceived(KIO::Job *, const QByteArray &data);
00401 
00402   public slots:
00403     void slotUser1();
00404 };
00405 
00406 #endif
KDE Logo
This file is part of the documentation for kate Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Aug 4 05:29:48 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2003