Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

contacteditor.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org>
00003  *
00004  * This file is an add-on for the OPIE Palmtop Environment
00005  *
00006  * This file may be distributed and/or modified under the terms of the
00007  * GNU General Public License version 2 as published by the Free Software
00008  * Foundation and appearing in the file LICENSE.GPL included in the pacakaging
00009  * of this file.
00010  *
00011  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013  *
00014  *
00015  * This is a rewrite of the abeditor.h file, modified to provide a more
00016  * intuitive interface to TrollTech's original Address Book editor.  This
00017  * is made to operate exactly in interface with the exception of name.
00018  *
00019  */
00020 
00021 #ifndef CONTACTEDITOR_H
00022 #define CONTACTEDITOR_H
00023 
00024 #include <opie2/opimcontact.h>
00025 #include <opie2/opimcontactfields.h>
00026 #include <opie2/otabwidget.h>
00027 
00028 #include <qpe/datebookmonth.h>
00029 
00030 #include <qdialog.h>
00031 #include <qlist.h>
00032 #include <qmap.h>
00033 #include <qstringlist.h>
00034 #include <qwidgetstack.h>
00035 
00036 const int NAME_LF  = 0;
00037 const int NAME_LFM = 1;
00038 const int NAME_FL  = 2;
00039 const int NAME_FML = 3;
00040 
00041 const int NAME_F = 4;
00042 const int NAME_M = 5;
00043 const int NAME_L = 6;
00044 const int NAME_S = 7;
00045 
00046 class QScrollView;
00047 class QMultiLineEdit;
00048 class QLineEdit;
00049 class QComboBox;
00050 class QPushButton;
00051 class CategorySelect;
00052 class QLabel;
00053 
00054 class ContactEditor : public QDialog {
00055         Q_OBJECT
00056 
00057         public:
00058                 ContactEditor(  const Opie::OPimContact &entry,
00059                                 QWidget *parent = 0,
00060                                 const char *name = 0,
00061                                 WFlags fl = 0 );
00062                 ~ContactEditor();
00063                 void setNameFocus();
00064                 void setPersonalView( bool personal = true );
00065                 Opie::OPimContact entry() const { return ent; }
00066 
00067         public slots:
00068                 void slotNote();
00069                 void slotName();
00070                 void setEntry(const Opie::OPimContact &entry);
00071 
00072         protected slots:
00073                 void accept();
00074 
00075         private:
00076                 void init();
00077                 void saveEntry();
00078                 bool isEmpty();
00079                 void cleanupFields();
00080                 void updateDatePicker();
00081                 QString parseName( QString fullName, int type );
00082                 void chooserError( int index );
00083         private slots:
00084                 void slotChooser1Change( const QString &textChanged );
00085                 void slotChooser2Change( const QString &textChanged );
00086                 void slotChooser3Change( const QString &textChanged );
00087                 void slotChooser4Change( const QString &textChanged );
00088                 void slotCmbChooser1Change( int index );
00089                 void slotCmbChooser2Change( int index );
00090                 void slotCmbChooser3Change( int index );
00091                 void slotCmbChooser4Change( int index );
00092                 void slotAddressTypeChange( int index );
00093                 void slotAddressChange( const QString &textChanged );
00094                 void slotAddress2Change( const QString &textChanged );
00095                 void slotPOBoxChange( const QString &textChanged );
00096                 void slotCityChange( const QString &textChanged );
00097                 void slotStateChange( const QString &textChanged );
00098                 void slotZipChange( const QString &textChanged );
00099                 void slotCountryChange( const QString &textChanged );
00100                 void slotFullNameChange( const QString &textChanged );
00101                 void slotSuffixChange( const QString &textChanged );
00102                 void slotOrganizationChange( const QString &textChanged );
00103                 void slotAnniversaryDateChanged( int year, int month, int day);
00104                 void slotBirthdayDateChanged( int year, int month, int day);
00105                 void slotRemoveBirthday();
00106                 void slotRemoveAnniversary();
00107                 void defaultEmailChanged(int);
00108 
00109         private:
00110                 enum StackWidgets { TextField = 1, Combo };
00111                 int defaultEmailChooserPosition;
00112                 void populateDefaultEmailCmb();
00113                 void chooserChange( const QString&, int , QLineEdit*, int );
00114                 bool cmbChooserChange( int , QWidgetStack*, int );
00115                 Opie::OPimContactFields contactfields;
00116 
00117                 Opie::OPimContact ent;
00118 
00119                 QDialog *dlgNote;
00120                 QDialog *dlgName;
00121 
00122                 QList<QLineEdit> listValue;
00123                 QList<QLabel> listName;
00124 
00125                 QStringList slDynamicEntries;
00126                 QStringList trlDynamicEntries;
00127 
00128                 bool m_personalView;
00129 
00130                 QStringList slHomeAddress;
00131                 QStringList slBusinessAddress;
00132                 QStringList slChooserNames;
00133                 QStringList slChooserValues;
00134                 QStringList emails;
00135                 QString defaultEmail;
00136 
00137                 QMultiLineEdit *txtNote;
00138                 QLabel *lblNote;
00139 
00140                 //QLineEdit *txtTitle;
00141                 QLineEdit *txtFirstName;
00142                 QLineEdit *txtMiddleName;
00143                 QLineEdit *txtLastName;
00144                 QLineEdit *txtSuffix;
00145 
00146                 Opie::Ui::OTabWidget *tabMain;
00147         QWidget     *m_generalWidget;
00148                 QScrollView *svGeneral;
00149                 QPushButton *btnFullName;
00150                 QPushButton *btnNote;
00151                 QLineEdit *txtFullName;
00152                 QLineEdit *txtJobTitle;
00153                 QLineEdit *txtOrganization;
00154                 QLineEdit *txtChooserField1;
00155                 QLineEdit *txtChooserField2;
00156                 QLineEdit *txtChooserField3;
00157                 QLineEdit *txtChooserField4;
00158                 QWidgetStack* m_widgetStack1;
00159                 QWidgetStack* m_widgetStack2;
00160                 QWidgetStack* m_widgetStack3;
00161                 QWidgetStack* m_widgetStack4;
00162                 QComboBox *cmbChooserField1;
00163                 QComboBox *cmbChooserField2;
00164                 QComboBox *cmbChooserField3;
00165                 QComboBox *cmbChooserField4;
00166                 QComboBox *cmbDefaultEmail;
00167                 QComboBox *cmbFileAs;
00168                 CategorySelect *cmbCat;
00169                 QLabel *labCat;
00170 
00171                 QScrollView *svAddress;
00172                 QLineEdit *txtAddress;
00173                 //QLineEdit *txtAddress2;
00174                 //QLineEdit *txtPOBox;
00175                 QLineEdit *txtCity;
00176                 QLineEdit *txtState;
00177                 QLineEdit *txtZip;
00178                 QComboBox *cmbAddress;
00179                 QComboBox *cmbCountry;
00180 
00181                 QScrollView *svDetails;
00182                 QComboBox *cmbGender;
00183                 DateBookMonth* birthdayPicker;
00184                 QToolButton* birthdayButton;
00185                 DateBookMonth* anniversaryPicker;
00186                 QToolButton* anniversaryButton;
00187 
00188                 bool initializing;
00189         };
00190 
00191 #endif

Generated on Sat Nov 5 16:15:47 2005 for OPIE by  doxygen 1.4.2