kword

KWStyleManager.cpp
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "KWDocument.h"
21#include "KWStyleManager.h"
22#include "KWStyleManager.moc"
23
24#include <KoUnit.h>
25#include <KoStyleCollection.h>
26#include <kdebug.h>
27/******************************************************************/
28/* Class: KWStyleManager */
29/******************************************************************/
30
31KWStyleManager::KWStyleManager( TQWidget *_parent, KoUnit::Unit unit,
32 KWDocument *_doc, const KoStyleCollection & styles,
33 const TQString & activeStyleName)
34 : KoStyleManager( _parent, unit,
35 styles, activeStyleName,
36 ShowIncludeInToc )
37{
38 m_doc = _doc;
39}
40
41KoParagStyle* KWStyleManager::addStyleTemplate(KoParagStyle *style)
42{
43 m_doc->setModified( true);
44 return m_doc->styleCollection()->addStyle(style);
45}
46
47void KWStyleManager::applyStyleChange( KoStyleChangeDefMap changed )
48{
49 m_doc->applyStyleChange( changed );
50}
51
52void KWStyleManager::removeStyleTemplate( KoParagStyle *style )
53{
54 m_doc->setModified( true);
55 m_doc->styleCollection()->removeStyle(style);
56}
57
58void KWStyleManager::updateAllStyleLists()
59{
60 m_doc->updateAllStyleLists();
61}
62
63void KWStyleManager::updateStyleListOrder( const TQStringList & list)
64{
65 m_doc->styleCollection()->updateStyleListOrder( list );
66}
67
68