| 1 | /* |
|---|
| 2 | * This file is part of Licq, an instant messaging client for UNIX. |
|---|
| 3 | * Copyright (C) 1999-2006 Licq developers |
|---|
| 4 | * |
|---|
| 5 | * Licq 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 | * Licq 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 Licq; if not, write to the Free Software |
|---|
| 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 18 | */ |
|---|
| 19 | |
|---|
| 20 | #ifndef EDITGRP_H |
|---|
| 21 | #define EDITGRP_H |
|---|
| 22 | |
|---|
| 23 | #include <QDialog> |
|---|
| 24 | |
|---|
| 25 | class QGroupBox; |
|---|
| 26 | class QLineEdit; |
|---|
| 27 | class QListWidget; |
|---|
| 28 | class QPushButton; |
|---|
| 29 | |
|---|
| 30 | class CICQSignal; |
|---|
| 31 | |
|---|
| 32 | namespace LicqQtGui |
|---|
| 33 | { |
|---|
| 34 | class EditGrpDlg : public QDialog |
|---|
| 35 | { |
|---|
| 36 | Q_OBJECT |
|---|
| 37 | |
|---|
| 38 | public: |
|---|
| 39 | EditGrpDlg(QWidget* parent = 0); |
|---|
| 40 | |
|---|
| 41 | private: |
|---|
| 42 | /** |
|---|
| 43 | * Get group id for group currently marked |
|---|
| 44 | * |
|---|
| 45 | * @return Group id for current group or zero if no group is marked |
|---|
| 46 | */ |
|---|
| 47 | unsigned short currentGroupId() const; |
|---|
| 48 | |
|---|
| 49 | /** |
|---|
| 50 | * Set current group id in list |
|---|
| 51 | * |
|---|
| 52 | * @param groupId Id of group to make current |
|---|
| 53 | */ |
|---|
| 54 | void setCurrentGroupId(unsigned short groupId); |
|---|
| 55 | |
|---|
| 56 | /** |
|---|
| 57 | * Move a group in the list |
|---|
| 58 | * |
|---|
| 59 | * @param delta Direction to move, positive for down |
|---|
| 60 | */ |
|---|
| 61 | void moveGroup(int delta); |
|---|
| 62 | |
|---|
| 63 | QListWidget* lstGroups; |
|---|
| 64 | QGroupBox* grpGroups; |
|---|
| 65 | QPushButton* btnAdd; |
|---|
| 66 | QPushButton* btnRemove; |
|---|
| 67 | QPushButton* btnUp; |
|---|
| 68 | QPushButton* btnDown; |
|---|
| 69 | QPushButton* btnDone; |
|---|
| 70 | QPushButton* btnEdit; |
|---|
| 71 | QPushButton* btnSave; |
|---|
| 72 | |
|---|
| 73 | QLineEdit* edtName; |
|---|
| 74 | |
|---|
| 75 | unsigned short myEditGroupId; |
|---|
| 76 | |
|---|
| 77 | void RefreshList(); |
|---|
| 78 | |
|---|
| 79 | private slots: |
|---|
| 80 | void listUpdated(CICQSignal* sig); |
|---|
| 81 | void slot_add(); |
|---|
| 82 | void slot_remove(); |
|---|
| 83 | void slot_up(); |
|---|
| 84 | void slot_down(); |
|---|
| 85 | void slot_edit(); |
|---|
| 86 | void slot_editok(); |
|---|
| 87 | void slot_editcancel(); |
|---|
| 88 | }; |
|---|
| 89 | |
|---|
| 90 | } // namespace LicqQtGui |
|---|
| 91 | |
|---|
| 92 | #endif |
|---|