00001 /*************************************************************************** 00002 kmymoneyaccountbutton - description 00003 ------------------- 00004 begin : Mon May 31 2004 00005 copyright : (C) 2000-2004 by Michael Edwardes 00006 email : mte@users.sourceforge.net 00007 Javier Campos Morales <javi_c@users.sourceforge.net> 00008 Felix Rodriguez <frodriguez@users.sourceforge.net> 00009 John C <thetacoturtle@users.sourceforge.net> 00010 Thomas Baumgart <ipwizard@users.sourceforge.net> 00011 Kevin Tambascio <ktambascio@users.sourceforge.net> 00012 ***************************************************************************/ 00013 00014 /*************************************************************************** 00015 * * 00016 * This program is free software; you can redistribute it and/or modify * 00017 * it under the terms of the GNU General Public License as published by * 00018 * the Free Software Foundation; either version 2 of the License, or * 00019 * (at your option) any later version. * 00020 * * 00021 ***************************************************************************/ 00022 00023 #ifndef KMYMONEYACCOUNTBUTTON_H 00024 #define KMYMONEYACCOUNTBUTTON_H 00025 00026 // ---------------------------------------------------------------------------- 00027 // QT Includes 00028 00029 // ---------------------------------------------------------------------------- 00030 // KDE Includes 00031 00032 #include <kpushbutton.h> 00033 #include <kcombobox.h> 00034 00035 // ---------------------------------------------------------------------------- 00036 // Project Includes 00037 00038 #include <kmymoney/kmymoneyutils.h> 00039 class kMyMoneyAccountCompletion; 00040 00044 class KMyMoneyAccountCombo : public KComboBox 00045 { 00046 Q_OBJECT 00047 public: 00048 KMyMoneyAccountCombo( QWidget* parent = 0, const char* name = 0 ); 00049 ~KMyMoneyAccountCombo(); 00050 00054 int count(void) const; 00055 00067 int loadList(const QString& baseName, const QValueList<QString>& accountIdList, const bool clear = true); 00068 00069 QStringList accountList(const QValueList<MyMoneyAccount::accountTypeE>& list = QValueList<MyMoneyAccount::accountTypeE>()) const; 00070 00071 int loadList(KMyMoneyUtils::categoryTypeE typeMask); 00072 int loadList(const QValueList<int>& list); 00073 int loadList(MyMoneyAccount::accountTypeE type); 00074 00075 void setSelected(const QString& id); 00076 void setSelected(const MyMoneyAccount& acc); 00077 00084 QStringList selectedAccounts(void) const; 00085 00086 virtual void keyPressEvent(QKeyEvent* e); 00087 00088 public slots: 00089 void slotButtonPressed(void); 00090 void slotSelected(const QString&); 00091 00092 protected slots: 00093 00094 signals: 00095 void accountSelected(const QString&); 00096 00097 void pressed(); 00098 void released(); 00099 void clicked(); 00100 00101 protected: 00102 void mousePressEvent(QMouseEvent *e); 00103 void mouseReleaseEvent(QMouseEvent *e); 00104 00105 void setText(const QString& txt); 00106 00107 private: 00108 kMyMoneyAccountCompletion* m_completion; 00109 bool m_mlbDown; 00110 }; 00111 00112 #endif
1.5.6