2010-08-24 16:26:52 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 or (at your option)
|
|
|
|
* version 3 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KEEPASSX_DATABASEWIDGET_H
|
|
|
|
#define KEEPASSX_DATABASEWIDGET_H
|
|
|
|
|
2010-10-06 13:40:50 -04:00
|
|
|
#include <QtGui/QStackedWidget>
|
2010-08-24 16:26:52 -04:00
|
|
|
|
|
|
|
class Database;
|
2010-10-06 13:40:50 -04:00
|
|
|
class EditEntryWidget;
|
2011-12-27 09:49:06 -05:00
|
|
|
class EditGroupWidget;
|
2010-10-06 13:40:50 -04:00
|
|
|
class Entry;
|
2010-08-24 16:26:52 -04:00
|
|
|
class EntryView;
|
2011-12-27 09:49:06 -05:00
|
|
|
class Group;
|
2010-08-24 16:26:52 -04:00
|
|
|
class GroupView;
|
|
|
|
|
2010-10-06 13:40:50 -04:00
|
|
|
class DatabaseWidget : public QStackedWidget
|
2010-08-24 16:26:52 -04:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit DatabaseWidget(Database* db, QWidget* parent = 0);
|
2011-12-27 09:49:06 -05:00
|
|
|
GroupView* groupView();
|
|
|
|
EntryView* entryView();
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
void createGroup();
|
|
|
|
void switchToEntryEdit();
|
|
|
|
void switchToGroupEdit();
|
2010-08-24 16:26:52 -04:00
|
|
|
|
2010-10-06 13:40:50 -04:00
|
|
|
private Q_SLOTS:
|
2011-12-27 09:49:06 -05:00
|
|
|
void switchToView(bool accepted);
|
|
|
|
void switchToEntryEdit(Entry* entry);
|
|
|
|
void switchToGroupEdit(Group* entry, bool create);
|
2010-10-06 13:40:50 -04:00
|
|
|
|
2010-08-24 16:26:52 -04:00
|
|
|
private:
|
2010-10-06 13:40:50 -04:00
|
|
|
QWidget* m_mainWidget;
|
2011-12-27 09:49:06 -05:00
|
|
|
EditEntryWidget* m_editEntryWidget;
|
|
|
|
EditGroupWidget* m_editGroupWidget;
|
2010-08-24 16:26:52 -04:00
|
|
|
GroupView* m_groupView;
|
|
|
|
EntryView* m_entryView;
|
2011-12-27 09:49:06 -05:00
|
|
|
Group* m_newGroup;
|
|
|
|
Group* m_newGroupParent;
|
2010-08-24 16:26:52 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // KEEPASSX_DATABASEWIDGET_H
|