• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Kate

autobookmarker.h

Go to the documentation of this file.
00001 /*
00002     This library is free software you can redistribute it and/or
00003     modify it under the terms of the GNU Library General Public
00004     License.
00005 
00006     This library is distributed in the hope that it will be useful,
00007     but WITHOUT ANY WARRANTY; without even the implied warranty of
00008     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00009     Library General Public License for more details.
00010 
00011     You should have received a copy of the GNU Library General Public License
00012     along with this library; see the file COPYING.LIB.  If not, write to
00013     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00014     Boston, MA 02110-1301, USA.
00015 
00016     ---
00017     file: autobookmarker.h
00018 
00019     KTextEditor plugin to add bookmarks to documents.
00020     Copyright Anders Lund <anders.lund@lund.tdcadsl.dk>, 2003
00021 */
00022 
00023 #ifndef _AUTOBOOKMARKER_H_
00024 #define _AUTOBOOKMARKER_H_
00025 
00026 #include <ktexteditor/plugin.h>
00027 #include <ktexteditor/configinterfaceextension.h>
00028 
00029 #include <kdialogbase.h>
00030 
00031 #include <qptrlist.h>
00032 #include <qvbox.h>
00033 
00034 class AutoBookmarkEnt
00035 {
00036   public:
00037   enum REFlags { CaseSensitive=1, MinimalMatching=2 };
00038   AutoBookmarkEnt(const QString &p=QString::null,
00039                   const QStringList &f=QStringList(),
00040                   const QStringList &m=QStringList(),
00041                   int flags=1 );
00042   ~AutoBookmarkEnt(){};
00043   QString pattern;
00044   QStringList filemask;
00045   QStringList mimemask;
00046   int flags;
00047 };
00048 
00049 class AutoBookmarker
00050   : public KTextEditor::Plugin, public KTextEditor::PluginViewInterface,
00051     public KTextEditor::ConfigInterfaceExtension
00052 {
00053   Q_OBJECT
00054   public:
00055     AutoBookmarker( QObject *parent = 0,
00056                         const char* name = 0,
00057                         const QStringList &args = QStringList() );
00058     virtual ~AutoBookmarker() {};
00059 
00060     void addView (KTextEditor::View *view);
00061     void removeView (KTextEditor::View *view);
00062 
00063     // ConfigInterfaceExtention
00064     uint configPages() const { return 1; };
00065     KTextEditor::ConfigPage * configPage( uint number, QWidget *parent, const char *name );
00066     QString configPageName( uint ) const;
00067     QString configPageFullName( uint ) const;
00068     QPixmap configPagePixmap( uint, int ) const;
00069     bool abDone;
00070 
00071   private slots:
00072     void slotCompleted();
00073     void applyEntity( AutoBookmarkEnt *e );
00074 };
00075 
00076 typedef QPtrList<AutoBookmarkEnt> ABEntityList;
00077 typedef QPtrListIterator<AutoBookmarkEnt> ABEntityListIterator;
00078 
00079 /* singleton to keep the data */
00080 class ABGlobal
00081 {
00082   public:
00083     ABGlobal();
00084     ~ABGlobal();
00085 
00086     static ABGlobal* self();
00087 
00088     ABEntityList* entities() { return m_ents; };
00089     void readConfig();
00090     void writeConfig();
00091 
00092   private:
00093     ABEntityList *m_ents;
00094     static ABGlobal *s_self;
00095 };
00096 
00097 class AutoBookmarkerConfigPage : public KTextEditor::ConfigPage
00098 {
00099   Q_OBJECT
00100   public:
00101     AutoBookmarkerConfigPage( QWidget *parent, const char *name );
00102     virtual ~AutoBookmarkerConfigPage() {};
00103 
00104     virtual void apply();
00105     virtual void reset();
00106     virtual void defaults();
00107 
00108   private slots:
00109     void slotNew();
00110     void slotDel();
00111     void slotEdit();
00112 
00113   private:
00114     class KListView *lvPatterns;
00115     class QPushButton *btnNew, *btnDel, *btnEdit;
00116     ABEntityList *m_ents;
00117 };
00118 
00119 class AutoBookmarkerEntEditor : public KDialogBase
00120 {
00121   Q_OBJECT
00122   public:
00123     AutoBookmarkerEntEditor( QWidget *parent, AutoBookmarkEnt *e );
00124     ~AutoBookmarkerEntEditor(){};
00125 
00126     void apply();
00127 
00128   private slots:
00129   void showMTDlg();
00130     void slotPatternChanged( const QString& );
00131   private:
00132     class QLineEdit *lePattern, *leMimeTypes, *leFileMask;
00133     class QCheckBox *cbCS, *cbMM;
00134     AutoBookmarkEnt *e;
00135 };
00136 
00137 #endif //_AUTOBOOKMARKER_H_

Kate

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

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal