1
/***************************************************************************
2
* Copyright (C) 2004-2009 by Thomas Fischer *
3
* fischer@unix-ag.uni-kl.de *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program; if not, write to the *
17
* Free Software Foundation, Inc., *
18
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19
***************************************************************************/
20
#ifndef KBIBTEXMERGEELEMENTS_H
21
#define KBIBTEXMERGEELEMENTS_H
23
#include <kdialogbase.h>
25
#include <findduplicates.h>
36
class MergeElementsCliqueItem : public QObject, public QCheckListItem
40
MergeElementsCliqueItem( BibTeX::Entry* entry, BibTeX::Macro* macro, BibTeX::Preamble* preamble, QListView *parent );
43
BibTeX::Preamble* preamble;
46
void stateChange( bool );
49
void stateChanged( MergeElementsCliqueItem* );
52
class MergeEntriesAlternativesController: public QCheckListItem
55
MergeEntriesAlternativesController( const QString &label, QListView *parent );
56
MergeEntriesAlternativesController( BibTeX::EntryField::FieldType fieldType, QListView *parent );
57
BibTeX::EntryField::FieldType fieldType;
58
const QString fieldName;
61
class MergeMacrosAlternativesController: public QCheckListItem
64
MergeMacrosAlternativesController( bool isKey, QListView *parent );
68
class MergeEntriesAlternativesItem: public QCheckListItem
71
MergeEntriesAlternativesItem( BibTeX::EntryField *field, MergeEntriesAlternativesController *parent );
72
BibTeX::EntryField *field;
75
class MergeMacrosAlternativesItem: public QCheckListItem
78
MergeMacrosAlternativesItem( BibTeX::Value *value, MergeMacrosAlternativesController *parent );
82
class MergeElementsAlternativesId: public QCheckListItem
85
MergeElementsAlternativesId( const QString &id, MergeEntriesAlternativesController *parent );
89
class MergeMacroAlternativesKey: public QCheckListItem
92
MergeMacroAlternativesKey( const QString &key, MergeMacrosAlternativesController *parent );
97
class MergeEntriesAlternativesEntryType: public QCheckListItem
100
MergeEntriesAlternativesEntryType( const QString &typeString, MergeEntriesAlternativesController *parent );
101
MergeEntriesAlternativesEntryType( BibTeX::Entry::EntryType type, MergeEntriesAlternativesController *parent );
103
BibTeX::Entry::EntryType type;
106
class MergePreambleAlternativesController: public QCheckListItem
109
MergePreambleAlternativesController( QListView *parent );
112
class MergePreambleAlternatives: public QCheckListItem
115
MergePreambleAlternatives( const QString &text, MergePreambleAlternativesController *parent );
120
@author Thomas Fischer <fischer@unix-ag.uni-kl.de>
122
class MergeElements : public KDialogBase
126
MergeElements( QWidget *parent );
128
int mergeDuplicates( BibTeX::File *bibTeXFile );
131
void showEvent( QShowEvent * );
134
void slotRefreshAlternatives();
135
void slotNextClique();
136
void slotPreviousClique();
137
void slotPreviewElement( QListViewItem *item );
138
void saveCurrentMergeSet();
144
BibTeX::Macro *macro;
145
BibTeX::Entry *entry;
146
BibTeX::EntryField *field;
151
QValueList<BibTeX::Macro*> macros;
152
QValueList<BibTeX::Entry*> entries;
153
QValueList<BibTeX::EntryField*> fields;
154
QValueList<BibTeX::Preamble*> preambles;
156
BibTeX::Value *macroValue;
157
QString id, typeString;
158
BibTeX::Entry::EntryType type;
159
QString preambleText;
162
KListView *m_listViewClique;
163
KListView *m_listViewAlternatives;
164
QProgressBar *m_progressBar;
165
FindDuplicates::DuplicateCliqueList m_duplicateCliqueList;
166
MergeSet **m_mergeSetList;
167
int m_currentCliqueIndex;
170
void setClique( int cliqueIndex );
171
void restoreCurrentMergeSet();
172
void applyMergeSet( BibTeX::File *bibTeXFile, BibTeX::File *otherBibTeXFile = NULL );
173
void restoreWindowSize( KConfig *config );
174
void saveWindowSize( KConfig *config ) const;
179
#endif // KBIBTEXMERGEELEMENTS_H