00001 /* This file is part of the KDE project 00002 Copyright (C) 2005 Thomas Zander <zander@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 00019 #ifndef kocompletiondia_h 00020 #define kocompletiondia_h 00021 00022 #include "ui_KoCompletionBase.h" 00023 #include <kdialog.h> 00024 #include <KoAutoFormat.h> 00025 00026 class KoCompletionBase : public QWidget, public Ui::KoCompletionBase 00027 { 00028 public: 00029 KoCompletionBase( QWidget *parent ) : QWidget( parent ) { 00030 setupUi( this ); 00031 } 00032 }; 00033 00034 00038 class KoCompletion : public KoCompletionBase { 00039 Q_OBJECT 00040 00041 public: 00042 KoCompletion(QWidget *parent, KoAutoFormat *autoFormat ); 00043 void saveSettings(); 00044 00045 protected slots: 00046 void changeButtonStatus(); 00047 void slotResetConf(); 00048 void slotAddCompletionEntry(); 00049 void slotRemoveCompletionEntry(); 00050 void slotCompletionWordSelected( const QString & ); 00051 void slotSaveCompletionEntry(); 00052 00053 protected: 00054 KoAutoFormat m_autoFormat; // The copy we're working on 00055 KoAutoFormat * m_docAutoFormat; // Pointer to the real one (in KWDocument) 00056 QStringList m_listCompletion; // The copy of the completion items - don't use m_autoFormat.getCompletion()! 00057 }; 00058 00062 class KOTEXT_EXPORT KoCompletionDia : public KDialog { 00063 Q_OBJECT 00064 00065 public: 00066 KoCompletionDia( QWidget *parent, const char *name, KoAutoFormat * autoFormat ); 00067 00068 protected slots: 00069 virtual void slotOk(); 00070 00071 protected: 00072 void setup(); 00073 00074 private: 00075 KoCompletion *m_widget; 00076 }; 00077 #endif