kword
KWStyleManager.cpp
00001 /* This file is part of the KDE project 00002 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@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 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 #include "KWDocument.h" 00021 #include "KWStyleManager.h" 00022 #include "KWStyleManager.moc" 00023 00024 #include <KoUnit.h> 00025 #include <KoStyleCollection.h> 00026 #include <kdebug.h> 00027 /******************************************************************/ 00028 /* Class: KWStyleManager */ 00029 /******************************************************************/ 00030 00031 KWStyleManager::KWStyleManager( QWidget *_parent, KoUnit::Unit unit, 00032 KWDocument *_doc, const KoStyleCollection & styles, 00033 const QString & activeStyleName) 00034 : KoStyleManager( _parent, unit, 00035 styles, activeStyleName, 00036 ShowIncludeInToc ) 00037 { 00038 m_doc = _doc; 00039 } 00040 00041 KoParagStyle* KWStyleManager::addStyleTemplate(KoParagStyle *style) 00042 { 00043 m_doc->setModified( true); 00044 return m_doc->styleCollection()->addStyle(style); 00045 } 00046 00047 void KWStyleManager::applyStyleChange( KoStyleChangeDefMap changed ) 00048 { 00049 m_doc->applyStyleChange( changed ); 00050 } 00051 00052 void KWStyleManager::removeStyleTemplate( KoParagStyle *style ) 00053 { 00054 m_doc->setModified( true); 00055 m_doc->styleCollection()->removeStyle(style); 00056 } 00057 00058 void KWStyleManager::updateAllStyleLists() 00059 { 00060 m_doc->updateAllStyleLists(); 00061 } 00062 00063 void KWStyleManager::updateStyleListOrder( const QStringList & list) 00064 { 00065 m_doc->styleCollection()->updateStyleListOrder( list ); 00066 } 00067 00068