~ubuntu-branches/ubuntu/wily/kbibtex/wily

« back to all changes in this revision

Viewing changes to src/settingsidsuggestions.h

  • Committer: Package Import Robot
  • Author(s): Michael Hanke
  • Date: 2011-07-18 09:29:48 UTC
  • mfrom: (1.1.6) (2.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20110718092948-ksxjmg7kdfamolmg
Tags: 0.3-1
* First upstream release for KDE4 (Closes: #634255). A number of search
  engines are still missing, in comparison to the 0.2 series.
* Bumped Standards-Version to 3.9.2, no changes necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2004-2009 by Thomas Fischer                             *
3
 
 *   fischer@unix-ag.uni-kl.de                                             *
4
 
 *                                                                         *
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.                                   *
9
 
 *                                                                         *
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.                          *
14
 
 *                                                                         *
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 KBIBTEXSETTINGSIDSUGGESTIONS_H
21
 
#define KBIBTEXSETTINGSIDSUGGESTIONS_H
22
 
 
23
 
#include <qwidget.h>
24
 
 
25
 
#include <klistview.h>
26
 
 
27
 
#include <entry.h>
28
 
 
29
 
class QRegExpValidator;
30
 
class QCheckBox;
31
 
 
32
 
class KPushButton;
33
 
class KLineEdit;
34
 
 
35
 
namespace KBibTeX
36
 
{
37
 
 
38
 
    class IdSuggestionsListViewItem: public KListViewItem
39
 
    {
40
 
    public:
41
 
        IdSuggestionsListViewItem( KListView *, const QString&, BibTeX::Entry *example );
42
 
        IdSuggestionsListViewItem( KListView *, KListViewItem *, const QString&, BibTeX::Entry *example );
43
 
        void setText( int, const QString& );
44
 
        QString originalText() const;
45
 
        int width( const QFontMetrics &, const QListView *, int ) const;
46
 
 
47
 
    private:
48
 
        QString m_original;
49
 
        BibTeX::Entry *m_example;
50
 
        QString parse( const QString& );
51
 
    };
52
 
 
53
 
    /**
54
 
     @author Thomas Fischer <fischer@unix-ag.uni-kl.de>
55
 
    */
56
 
    class SettingsIdSuggestions : public QWidget
57
 
    {
58
 
        Q_OBJECT
59
 
    public:
60
 
        SettingsIdSuggestions( QWidget *parent = 0, const char *name = 0 );
61
 
        ~SettingsIdSuggestions();
62
 
 
63
 
        void applyData();
64
 
        void readData();
65
 
 
66
 
    signals:
67
 
        void configChanged();
68
 
 
69
 
    protected slots:
70
 
        void slotConfigChanged();
71
 
 
72
 
    private slots:
73
 
        void slotNewIdSuggestion();
74
 
        void slotEditIdSuggestion();
75
 
        void slotDeleteIdSuggestion();
76
 
        void slotMoveUpIdSuggestion();
77
 
        void slotMoveDownIdSuggestion();
78
 
        void slotToggleDefault();
79
 
        void slotEditSmallWordsChanged( const QString & );
80
 
        void slotAddSmallWord();
81
 
        void slotDeleteSmallWord();
82
 
        void slotListSmallWordsChanged();
83
 
        void updateGUI();
84
 
 
85
 
    private:
86
 
        KListView *m_listIdSuggestions;
87
 
        KPushButton *m_buttonNewIdSuggestion;
88
 
        KPushButton *m_buttonEditIdSuggestion;
89
 
        KPushButton *m_buttonDeleteIdSuggestion;
90
 
        KPushButton *m_buttonMoveUpIdSuggestion;
91
 
        KPushButton *m_buttonMoveDownIdSuggestion;
92
 
        KPushButton *m_buttonToggleDefault;
93
 
        QCheckBox *m_checkBoxForceDefault;
94
 
        KListView *m_listSmallWords;
95
 
        KLineEdit *m_lineEditSmallWords;
96
 
        KPushButton *m_buttonAddSmallWord;
97
 
        KPushButton *m_buttonDeleteSmallWord;
98
 
        QRegExpValidator *m_validator;
99
 
        QListViewItem *m_defaultSuggestionItem;
100
 
        static QString exampleBibTeXEntry;
101
 
        BibTeX::Entry *m_example;
102
 
 
103
 
        void setupGUI();
104
 
    };
105
 
 
106
 
}
107
 
 
108
 
#endif