kplato
kptaccountspanel.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KPTACCOUNTSPANEL_H
00021 #define KPTACCOUNTSPANEL_H
00022
00023 #include "kptaccountspanelbase.h"
00024
00025 #include <qptrlist.h>
00026 #include <qdict.h>
00027
00028 class QListView;
00029 class QListViewItem;
00030 class QWidget;
00031
00032 class KCommand;
00033 class KMacroCommand;
00034
00035 namespace KPlato
00036 {
00037
00038 class AccountItem;
00039 class Account;
00040 class Accounts;
00041 class Part;
00042 class Project;
00043
00044 class AccountsPanel : public AccountsPanelBase {
00045 Q_OBJECT
00046 public:
00047 AccountsPanel(Accounts &acc, QWidget *parent=0, const char *name=0);
00048
00049 KCommand *buildCommand(Part *part);
00050
00051 bool isUnique(QListViewItem *item);
00052 void renameStopped(QListViewItem *item);
00053
00054 signals:
00055 void changed(bool);
00056
00057
00058 void renameStarted(QListViewItem *, int);
00059 void startRename(QListViewItem *item, int col);
00060 void selectionChanged();
00061
00062 public slots:
00063 void slotOk();
00064
00065 protected slots:
00066 void slotChanged();
00067 void slotSelectionChanged();
00068 void slotItemRenamed(QListViewItem *item, int col);
00069 void slotRemoveBtn();
00070 void slotNewBtn();
00071 void slotSubBtn();
00072 void slotActivated(int);
00073 void slotListDoubleClicked(QListViewItem* item, const QPoint&, int col);
00074 void slotRenameStarted(QListViewItem *item, int col);
00075 void slotStartRename(QListViewItem *item, int col);
00076 void slotRemoveItem(QListViewItem *i);
00077 protected:
00078 void addItems(QListView *lv, Accounts &acc);
00079 void addItems(QListViewItem *item, Account *acc);
00080 void addElement(const QListViewItem *item);
00081 void removeElement(QListViewItem *item);
00082 void refreshDefaultAccount();
00083 KCommand *save(Part *part, Project &project);
00084 KCommand *save(Part *part, Project &project, QListViewItem *item);
00085
00086 private:
00087 Accounts &m_accounts;
00088
00089 QPtrList<QListViewItem> m_removedItems;
00090 Account *m_oldDefaultAccount;
00091 QDict<QListViewItem> m_elements;
00092 int m_currentIndex;
00093 QString m_renameText;
00094 QListViewItem *m_renameItem;
00095 };
00096
00097 }
00098
00099 #endif
|