kplato

kptaccountspanel.h
1/* This file is part of the KDE project
2 Copyright (C) 2005 Dag Andersen <danders@get2net.dk>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation;
7 version 2 of the License.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
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
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KPTACCOUNTSPANEL_H
21#define KPTACCOUNTSPANEL_H
22
23#include "kptaccountspanelbase.h"
24
25#include <tqptrlist.h>
26#include <tqdict.h>
27
28class TQListView;
29class TQListViewItem;
30class TQWidget;
31
32class KCommand;
33class KMacroCommand;
34
35namespace KPlato
36{
37
38class AccountItem;
39class Account;
40class Accounts;
41class Part;
42class Project;
43
44class AccountsPanel : public AccountsPanelBase {
45 TQ_OBJECT
46
47public:
48 AccountsPanel(Accounts &acc, TQWidget *parent=0, const char *name=0);
49
50 KCommand *buildCommand(Part *part);
51
52 bool isUnique(TQListViewItem *item);
53 void renameStopped(TQListViewItem *item);
54
55signals:
56 void changed(bool);
57
58 // Internal
59 void renameStarted(TQListViewItem *, int);
60 void startRename(TQListViewItem *item, int col);
61 void selectionChanged();
62
63public slots:
64 void slotOk();
65
66protected slots:
67 void slotChanged();
68 void slotSelectionChanged();
69 void slotItemRenamed(TQListViewItem *item, int col);
70 void slotRemoveBtn();
71 void slotNewBtn();
72 void slotSubBtn();
73 void slotActivated(int);
74 void slotListDoubleClicked(TQListViewItem* item, const TQPoint&, int col);
75 void slotRenameStarted(TQListViewItem *item, int col);
76 void slotStartRename(TQListViewItem *item, int col);
77 void slotRemoveItem(TQListViewItem *i);
78protected:
79 void addItems(TQListView *lv, Accounts &acc);
80 void addItems(TQListViewItem *item, Account *acc);
81 void addElement(const TQListViewItem *item);
82 void removeElement(TQListViewItem *item);
83 void refreshDefaultAccount();
84 KCommand *save(Part *part, Project &project);
85 KCommand *save(Part *part, Project &project, TQListViewItem *item);
86
87private:
88 Accounts &m_accounts;
89
90 TQPtrList<TQListViewItem> m_removedItems;
91 Account *m_oldDefaultAccount;
92 TQDict<TQListViewItem> m_elements;
93 int m_currentIndex;
94 TQString m_renameText;
95 TQListViewItem *m_renameItem;
96};
97
98} //namespace KPlato
99
100#endif
Account holds one account.
Definition kptaccount.h:49
Accounts administrates all accounts.
Definition kptaccount.h:180
Project is the main node in a project, it contains child nodes and possibly sub-projects.
Definition kptproject.h:52