lib

KoImportStyleDia.h
1/* This file is part of the KDE project
2 Copyright (C) 2002 Montel Laurent <lmontel@mandrakesoft.com>
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#ifndef __KoImportStyleDia__
21#define __KoImportStyleDia__
22
23#include <kdialogbase.h>
24#include <tqstringlist.h>
25#include <KoStyleCollection.h>
26class TQLineEdit;
27class TQListBox;
28class TQPushButton;
29
30class KOTEXT_EXPORT KoImportStyleDia : public KDialogBase
31{
32 TQ_OBJECT
33
34public:
37 KoImportStyleDia( KoStyleCollection* currentCollection, TQWidget *parent, const char *name );
38 ~KoImportStyleDia();
39
40 const KoStyleCollection& importedStyles() const { return m_styleList; }
41
42protected slots:
43 virtual void slotOk();
44 void slotLoadFile();
45
46protected:
49 virtual void loadFile()=0;
50
51 void clear();
52 TQString generateStyleName( const TQString & templateName ) const;
53 TQString generateStyleDisplayName( const TQString & templateName ) const;
54
55 // @return collection of styles already present in the document
56 const KoStyleCollection* currentCollection() const { return m_currentCollection; }
57
58 void initList();
59
60 // used by subclasses, hmm...
61 TQListBox *m_listStyleName;
62 KoStyleCollection m_styleList;
63
64private:
65 void generateStyleList();
66 void updateFollowingStyle( KoParagStyle* removedStyle );
67
68 KoStyleCollection* m_currentCollection; // Styles already present in the document
69};
70
71#endif
virtual void slotOk()
TDEAction * clear(const TQObject *recvr, const char *slot, TDEActionCollection *parent, const char *name=0)