KTextEditor
editorchooser.h
Go to the documentation of this file.00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2005 Joseph Wenninger <jowenn@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 #ifndef _EDITOR_CHOOSER_H_ 00019 #define _EDITOR_CHOOSER_H_ 00020 00021 #include <ktexteditor/ktexteditor_export.h> 00022 #include <ktexteditor/document.h> 00023 #include <ktexteditor/editor.h> 00024 00025 #include <QtGui/QWidget> 00026 00027 class KConfig; 00028 class QString; 00029 00030 namespace KTextEditor 00031 { 00032 00087 class KTEXTEDITOR_EXPORT EditorChooser: public QWidget 00088 { 00089 friend class PrivateEditorChooser; 00090 00091 Q_OBJECT 00092 00093 public: 00100 EditorChooser(QWidget *parent=0); 00104 virtual ~EditorChooser(); 00105 00106 /* void writeSysDefault();*/ 00107 00115 void readAppSetting(const QString& postfix=QString()); 00121 void writeAppSetting(const QString& postfix=QString()); 00122 00136 static KTextEditor::Editor *editor (const QString& postfix=QString(), bool fallBackToKatePart = true); 00137 00138 Q_SIGNALS: 00143 void changed(); 00144 private: 00145 class PrivateEditorChooser *d; 00146 }; 00147 00148 /* 00149 class EditorChooserBackEnd: public ComponentChooserPlugin { 00150 00151 Q_OBJECT 00152 public: 00153 EditorChooserBackEnd(QObject *parent=0, const char *name=0); 00154 virtual ~EditorChooserBackEnd(); 00155 00156 virtual QWidget *widget(QWidget *); 00157 virtual const QStringList &choices(); 00158 virtual void saveSettings(); 00159 00160 void readAppSetting(KConfig *cfg,const QString& postfix); 00161 void writeAppSetting(KConfig *cfg,const QString& postfix); 00162 00163 public Q_SLOTS: 00164 virtual void madeChoice(int pos,const QString &choice); 00165 00166 }; 00167 */ 00168 00169 } 00170 #endif 00171 00172 // kate: space-indent on; indent-width 2; replace-tabs on;