kaddressbook

stylepage.h

00001 /*
00002     This file is part of KAddressBook.
00003     Copyright (c) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk>
00004                        Tobias Koenig <tokoe@kde.org>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of TQt, and distribute the resulting executable,
00022     without including the source code for TQt in the source distribution.
00023 */
00024 
00025 #ifndef STYLEPAGE_H
00026 #define STYLEPAGE_H
00027 
00028 #include <tqwidget.h>
00029 
00030 #include <tdeabc/addressbook.h>
00031 #include <tdeabc/field.h>
00032 
00033 class TQLabel;
00034 class TQPixmap;
00035 class TQRadioButton;
00036 class KComboBox;
00037 
00038 class StylePage : public TQWidget
00039 {
00040   Q_OBJECT
00041   
00042 
00043   public:
00044     StylePage( TDEABC::AddressBook *ab, TQWidget* parent = 0, const char* name = 0 );
00045     ~StylePage();
00046 
00051     void setPreview( const TQPixmap &pixmap );
00052 
00056     void addStyleName( const TQString &name );
00057 
00061     void clearStyleNames();
00062 
00066     void setSortField( TDEABC::Field *field );
00067 
00071      TDEABC::Field* sortField();
00072 
00076     void setSortAscending( bool value = true );
00077 
00081     bool sortAscending();
00082 
00083   signals:
00088     void styleChanged( int index );
00089 
00090   private:
00091     void initGUI();
00092     void initFieldCombo();
00093 
00094     KComboBox *mFieldCombo;
00095     KComboBox *mSortTypeCombo;
00096     KComboBox *mStyleCombo;
00097     TQLabel *mPreview;
00098 
00099     TDEABC::AddressBook *mAddressBook;
00100     TDEABC::Field::List mFields;
00101 };
00102 
00103 #endif // STYLEPAGE_H