~ubuntu-branches/ubuntu/wily/psi/wily

« back to all changes in this revision

Viewing changes to src/bookmarkmanagedlg.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * bookmarkmanagedlg.h - manage groupchat room bookmarks
 
3
 * Copyright (C) 2008  Michail Pishchagin
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License
 
7
 * as published by the Free Software Foundation; either version 2
 
8
 * of the License, or (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 library; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
 *
 
19
 */
 
20
 
 
21
#ifndef BOOKMARKMANAGEDLG_H
 
22
#define BOOKMARKMANAGEDLG_H
 
23
 
 
24
#include <QDialog>
 
25
 
 
26
#include "ui_bookmarkmanage.h"
 
27
 
 
28
class PsiAccount;
 
29
class QPushButton;
 
30
class QStandardItemModel;
 
31
class QStandardItem;
 
32
class ConferenceBookmark;
 
33
 
 
34
#include "xmpp_jid.h"
 
35
 
 
36
class BookmarkManageDlg : public QDialog
 
37
{
 
38
        Q_OBJECT
 
39
public:
 
40
        BookmarkManageDlg(PsiAccount* account);
 
41
        ~BookmarkManageDlg();
 
42
 
 
43
public slots:
 
44
        // reimplemented
 
45
        void reject();
 
46
        void accept();
 
47
 
 
48
private:
 
49
        enum Role {
 
50
                // DisplayRole / EditRole
 
51
                JidRole      = Qt::UserRole + 0,
 
52
                AutoJoinRole = Qt::UserRole + 1,
 
53
                NickRole     = Qt::UserRole + 2,
 
54
                PasswordRole = Qt::UserRole + 3
 
55
        };
 
56
 
 
57
        void loadBookmarks();
 
58
        void saveBookmarks();
 
59
 
 
60
        void appendItem(QStandardItem* item);
 
61
        XMPP::Jid jid() const;
 
62
        QModelIndex currentIndex() const;
 
63
 
 
64
private slots:
 
65
        void addBookmark();
 
66
        void removeBookmark();
 
67
        void updateCurrentItem();
 
68
        void joinCurrentRoom();
 
69
        void closeEditor(QWidget* editor, QAbstractItemDelegate::EndEditHint hint);
 
70
        void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
 
71
 
 
72
private:
 
73
        Ui::BookmarkManage ui_;
 
74
        PsiAccount* account_;
 
75
        QStandardItemModel* model_;
 
76
        QPushButton* addButton_;
 
77
        QPushButton* removeButton_;
 
78
        QPushButton* joinButton_;
 
79
 
 
80
        ConferenceBookmark bookmarkFor(const QModelIndex& index) const;
 
81
};
 
82
 
 
83
#endif