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

« back to all changes in this revision

Viewing changes to src/sidebar.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-2006 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 KBIBTEXSIDEBAR_H
21
 
#define KBIBTEXSIDEBAR_H
22
 
 
23
 
#include <qwidget.h>
24
 
#include <qlistview.h>
25
 
 
26
 
#include <entryfield.h>
27
 
#include <file.h>
28
 
 
29
 
class QComboBox;
30
 
class QToolButton;
31
 
class KListView;
32
 
class QListViewItem;
33
 
class KPopupMenu;
34
 
 
35
 
namespace KBibTeX
36
 
{
37
 
    class SideBar : public QWidget
38
 
    {
39
 
        Q_OBJECT
40
 
    public:
41
 
        SideBar( bool isReadOnly, QWidget *parent = 0, const char *name = 0 );
42
 
        ~SideBar();
43
 
 
44
 
        void restoreState();
45
 
        void setReadOnly( bool isReadOnly );
46
 
 
47
 
    signals:
48
 
        void selected( const QString& text, BibTeX::Element::FilterType, BibTeX::EntryField::FieldType fieldType );
49
 
        void valueRenamed();
50
 
 
51
 
    public slots:
52
 
        void refreshLists( BibTeX::File *bibtexFile = NULL );
53
 
 
54
 
    protected:
55
 
        void resizeEvent( QResizeEvent *event );
56
 
 
57
 
    private:
58
 
        BibTeX::File *m_bibtexFile;
59
 
        QToolButton *m_buttonToggleShowAll;
60
 
        QToolButton *m_buttonToggleMultiSelect;
61
 
        QComboBox *m_listTypeList;
62
 
        KListView *m_listAvailableItems;
63
 
        static const BibTeX::EntryField::FieldType importantFields[ 6 ];
64
 
        bool m_isReadOnly;
65
 
        KPopupMenu *m_popupMenu;
66
 
        QString m_oldText;
67
 
 
68
 
        void setupGUI();
69
 
 
70
 
    private slots:
71
 
        void prepareSearch();
72
 
        void toggleShowAll( bool showAll );
73
 
        void toggleMultiSelect( bool showAll );
74
 
        void showContextMenu( QListViewItem * item, const QPoint & pos );
75
 
        void startRenaming();
76
 
        void endRenaming( QListViewItem * item, int col, const QString & text );
77
 
    };
78
 
 
79
 
    class SideBarListViewItem: QListViewItem
80
 
    {
81
 
    public:
82
 
        SideBarListViewItem( QListView *parent, QString label1, QString label2 );
83
 
 
84
 
        int compare( QListViewItem* item, int column, bool ascending ) const;
85
 
    };
86
 
 
87
 
}
88
 
 
89
 
#endif