kword
KWImportStyleDia.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2002 Montel Laurent <lmontel@mandrakesoft.com> 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 as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef __KWImportStyleDia__ 00021 #define __KWImportStyleDia__ 00022 00023 #include <kdialogbase.h> 00024 #include <KoImportStyleDia.h> 00025 #include <qstringlist.h> 00026 00027 #include "KWFrameStyle.h" 00028 #include "KWTableStyle.h" 00029 00030 class QLineEdit; 00031 class QListBox; 00032 class KWDocument; 00033 class QPushButton; 00034 class KoParagStyle; 00035 00036 class KWImportStyleDia : public KoImportStyleDia 00037 { 00038 Q_OBJECT 00039 public: 00040 KWImportStyleDia( KWDocument *_doc, KoStyleCollection* currentCollection, QWidget *parent, const char *name = 0 ); 00041 ~KWImportStyleDia(); 00042 00043 protected: 00044 virtual void loadFile(); 00045 00046 private: 00047 KWDocument *m_doc; 00048 }; 00049 00050 00051 class KWImportFrameTableStyleDia : public KDialogBase 00052 { 00053 Q_OBJECT 00054 public: 00055 enum StyleType { frameStyle, TableStyle}; 00056 KWImportFrameTableStyleDia( KWDocument *_doc, const QStringList & _list, StyleType _type , QWidget *parent, const char *name ); 00057 ~KWImportFrameTableStyleDia(); 00058 QPtrList<KWFrameStyle> listOfFrameStyleImported() const { return m_frameStyleList;} 00059 QPtrList<KWTableStyle> listOfTableStyleImported() const { return m_tableStyleList;} 00060 00061 protected slots: 00062 virtual void slotOk(); 00063 00064 protected: 00065 QString generateStyleName( const QString & templateName ); 00066 void loadFile(); 00067 void initList(); 00068 QListBox *m_listStyleName; 00069 KWDocument *m_doc; 00070 QPtrList<KWFrameStyle> m_frameStyleList; 00071 QPtrList<KWTableStyle> m_tableStyleList; 00072 QStringList m_list; 00073 StyleType m_typeStyle; 00074 }; 00075 00076 #endif