Use qtpaths directly
[kdepim.git] / kaddressbook / contactswitcher.h
blobfdea7ecf7f66e0b563c5359d9ee8f4a26ac8ed5c
1 /*
2 Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
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 the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
20 #ifndef CONTACTSWITCHER_H
21 #define CONTACTSWITCHER_H
23 #include <QWidget>
25 class QAbstractItemView;
26 class QLabel;
27 class QPushButton;
29 /**
30 * @short A widget to switch between the contacts of an contact view.
32 * This widgets provides a 'Next' and 'Previous' button to allow the
33 * user to switch between the entries of a contact view.
35 * @author Tobias Koenig <tokoe@kde.org>
37 class ContactSwitcher : public QWidget
39 Q_OBJECT
41 public:
42 /**
43 * Creates a new contact switcher.
45 * @param parent The parent widget.
47 explicit ContactSwitcher(QWidget *parent = Q_NULLPTR);
49 /**
50 * Sets the @p view the contact switcher shall work on.
52 void setView(QAbstractItemView *view);
54 private Q_SLOTS:
55 /**
56 * This slot is called when the 'Next' button is clicked.
58 void nextClicked();
60 /**
61 * This slot is called when the 'Previous' button is clicked.
63 void previousClicked();
65 /**
66 * This slot is called whenever the layout of the model has changed
67 * or the user has clicked a button.
69 void updateStatus();
71 private:
72 QAbstractItemView *mView;
73 QPushButton *mNextButton;
74 QPushButton *mPreviousButton;
75 QLabel *mStatusLabel;
78 #endif