You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
140 lines
3.3 KiB
140 lines
3.3 KiB
15 years ago
|
/*
|
||
|
This file is part of libkabc.
|
||
|
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
|
||
|
|
||
|
This library is free software; you can redistribute it and/or
|
||
|
modify it under the terms of the GNU Library General Public
|
||
|
License as published by the Free Software Foundation; either
|
||
|
version 2 of the License, or (at your option) any later version.
|
||
|
|
||
|
This library is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
Library General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#ifndef KABC_DISTRIBUTIONLISTDIALOG_H
|
||
|
#define KABC_DISTRIBUTIONLISTDIALOG_H
|
||
|
|
||
15 years ago
|
#include <tqwidget.h>
|
||
15 years ago
|
|
||
|
#include <kdialogbase.h>
|
||
|
|
||
15 years ago
|
class TQListView;
|
||
|
class TQComboBox;
|
||
|
class TQButtonGroup;
|
||
15 years ago
|
|
||
|
namespace KABC {
|
||
|
|
||
|
class AddressBook;
|
||
|
class DistributionListEditorWidget;
|
||
|
class DistributionListManager;
|
||
|
|
||
|
/**
|
||
|
@short Frontend to create distribution lists
|
||
|
|
||
|
Creating a new DistributionListDialog does automatically
|
||
|
load all addressees and distribution lists from the config
|
||
|
files. The changes will be saved when clicking the 'OK'
|
||
|
button.
|
||
|
|
||
|
Example:
|
||
|
|
||
|
\code
|
||
|
KABC::DistributionListDialog *dlg = new
|
||
|
KABC::DistributionListDialog( KABC::StdAddressBook::self(), this );
|
||
|
|
||
|
dlg->exec();
|
||
|
\endcode
|
||
|
*/
|
||
|
class KABC_EXPORT DistributionListDialog : public KDialogBase
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
/**
|
||
|
Constructor.
|
||
|
|
||
|
@param ab The addressbook, the addressees should be used from
|
||
|
@param parent The parent widget
|
||
|
*/
|
||
15 years ago
|
DistributionListDialog( AddressBook *ab, TQWidget *parent );
|
||
15 years ago
|
|
||
|
/**
|
||
|
Destructor.
|
||
|
*/
|
||
|
virtual ~DistributionListDialog();
|
||
|
|
||
|
private:
|
||
|
DistributionListEditorWidget *mEditor;
|
||
|
|
||
|
struct Data;
|
||
|
Data *d;
|
||
|
};
|
||
|
|
||
|
/**
|
||
|
@short Helper class
|
||
|
*/
|
||
|
class KABC_EXPORT EmailSelector : public KDialogBase
|
||
|
{
|
||
|
public:
|
||
15 years ago
|
EmailSelector( const TQStringList &emails, const TQString ¤t,
|
||
|
TQWidget *parent );
|
||
15 years ago
|
|
||
15 years ago
|
TQString selected();
|
||
15 years ago
|
|
||
15 years ago
|
static TQString getEmail( const TQStringList &emails, const TQString ¤t,
|
||
|
TQWidget *parent );
|
||
15 years ago
|
|
||
|
private:
|
||
15 years ago
|
TQButtonGroup *mButtonGroup;
|
||
15 years ago
|
};
|
||
|
|
||
|
/**
|
||
|
@short Helper class
|
||
|
*/
|
||
14 years ago
|
class KABC_EXPORT DistributionListEditorWidget : public TQWidget
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
15 years ago
|
DistributionListEditorWidget( AddressBook *, TQWidget *parent );
|
||
15 years ago
|
virtual ~DistributionListEditorWidget();
|
||
|
|
||
|
private slots:
|
||
|
void newList();
|
||
|
void editList();
|
||
|
void removeList();
|
||
|
void addEntry();
|
||
|
void removeEntry();
|
||
|
void changeEmail();
|
||
|
void updateEntryView();
|
||
|
void updateAddresseeView();
|
||
|
void updateNameCombo();
|
||
|
void slotSelectionEntryViewChanged();
|
||
|
void slotSelectionAddresseeViewChanged();
|
||
|
void save();
|
||
|
|
||
|
private:
|
||
15 years ago
|
TQComboBox *mNameCombo;
|
||
|
TQLabel *mListLabel;
|
||
|
TQListView *mEntryView;
|
||
|
TQListView *mAddresseeView;
|
||
15 years ago
|
|
||
|
AddressBook *mAddressBook;
|
||
|
DistributionListManager *mManager;
|
||
15 years ago
|
TQPushButton *mNewButton, *mEditButton, *mRemoveButton;
|
||
|
TQPushButton *mChangeEmailButton, *mRemoveEntryButton, *mAddEntryButton;
|
||
15 years ago
|
|
||
|
struct Data;
|
||
|
Data *d;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
#endif
|