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 KBIBTEXIDSUGGESTIONSWIDGET_H
21
#define KBIBTEXIDSUGGESTIONSWIDGET_H
35
class IdSuggestionComponent: public QFrame
39
IdSuggestionComponent( const QString& title, QWidget *parent );
40
virtual QString text() const = 0;
41
void setEnableUpDown( bool enableUp, bool enableDown );
49
QWidget *moveWidgets( QWidget *parent );
54
KPushButton *m_pushButtonDel;
55
KPushButton *m_pushButtonUp;
56
KPushButton *m_pushButtonDown;
64
class IdSuggestionComponentAuthor: public IdSuggestionComponent
67
IdSuggestionComponentAuthor( const QString &text, QWidget *parent );
70
KComboBox *m_comboBoxWhichAuthors;
71
KComboBox *m_comboBoxCasing;
72
KLineEdit *m_lineEditInBetween;
73
QSpinBox *m_spinBoxLen;
76
class IdSuggestionComponentTitle: public IdSuggestionComponent
79
IdSuggestionComponentTitle( const QString &text, QWidget *parent );
82
QCheckBox *m_checkBoxRemoveSmallWords;
83
KComboBox *m_comboBoxCasing;
84
KLineEdit *m_lineEditInBetween;
85
QSpinBox *m_spinBoxLen;
88
class IdSuggestionComponentYear: public IdSuggestionComponent
91
IdSuggestionComponentYear( const QString &text, QWidget *parent );
94
KComboBox *m_comboBoxDigits;
97
class IdSuggestionComponentText: public IdSuggestionComponent
100
IdSuggestionComponentText( const QString &text, QWidget *parent );
101
QString text() const;
103
KLineEdit *m_lineEditInBetween;
106
class IdSuggestionsScrollView : public QScrollView
110
IdSuggestionsScrollView( QWidget *parent, const char*name = NULL );
111
~IdSuggestionsScrollView();
113
void setMainWidget( QWidget *widget ) {m_widget = widget;}
116
void viewportResizeEvent( QResizeEvent * );
123
@author Thomas Fischer <fischer@unix-ag.uni-kl.de>
125
class IdSuggestionsWidget : public QWidget
129
~IdSuggestionsWidget();
132
static QDialog::DialogCode execute( QString &formatStr, QWidget *parent = 0, const char *name = 0 );
135
IdSuggestionsWidget( const QString &formatStr, KDialogBase *parent, const char *name = 0 );
137
QString m_originalFormatStr;
138
int m_componentCount;
140
void reset( const QString& formatStr );
141
void apply( QString& formatStr );
144
static QString exampleBibTeXEntry;
145
BibTeX::Entry *m_example;
146
IdSuggestionsScrollView *m_scrollViewComponents;
147
QLabel *m_labelExample;
148
QWidget *m_listOfComponents;
149
KPushButton *m_pushButtonAdd;
150
KDialogBase *m_parent;
155
void addMenuActivated( int id );
157
void componentDeleted();
158
void updateExample();