kmail

folderrequester.h
00001 /*
00002  * Copyright (c) 2004 Carsten Burghardt <burghardt@kde.org>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; version 2 of the License
00007  *
00008  *  This program is distributed in the hope that it will be useful,
00009  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  *  GNU General Public License for more details.
00012  *
00013  *  You should have received a copy of the GNU General Public License
00014  *  along with this program; if not, write to the Free Software
00015  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00016  *
00017  *  In addition, as a special exception, the copyright holders give
00018  *  permission to link the code of this program with any edition of
00019  *  the TQt library by Trolltech AS, Norway (or with modified versions
00020  *  of TQt that use the same license as TQt), and distribute linked
00021  *  combinations including the two.  You must obey the GNU General
00022  *  Public License in all respects for all of the code used other than
00023  *  TQt.  If you modify this file, you may extend this exception to
00024  *  your version of the file, but you are not obligated to do so.  If
00025  *  you do not wish to do so, delete this exception statement from
00026  *  your version.
00027  */
00028 
00029 #ifndef folderrequester_h
00030 #define folderrequester_h
00031 
00032 #include <tqwidget.h>
00033 #include <klineedit.h>
00034 
00035 class KMFolder;
00036 class KMFolderTree;
00037 
00038 namespace KMail {
00039 
00046   class FolderRequester: public TQWidget
00047   {
00048     Q_OBJECT
00049   
00050 
00051     public:
00057       FolderRequester( TQWidget *parent, KMFolderTree* tree );
00058       virtual ~FolderRequester();
00059 
00061       KMFolder* folder( void ) const;
00062 
00064       TQString folderId() const { return mFolderId; } 
00065 
00067       TQString text() const { return edit->originalText(); } 
00068 
00070       void setFolder( KMFolder* );
00071       void setFolder( const TQString& idString );
00072 
00078       void setMustBeReadWrite( bool readwrite ) 
00079       { mMustBeReadWrite = readwrite; }
00080 
00082       void setShowOutbox( bool show )
00083       { mShowOutbox = show; }
00084 
00086       void setShowImapFolders( bool show )
00087       { mShowImapFolders = show; }
00088 
00089     protected slots:
00091       void slotOpenDialog();
00092 
00093     signals:
00095       void folderChanged( KMFolder* );
00096 
00097     protected:
00099       virtual void keyPressEvent( TQKeyEvent * e );
00100 
00101     protected:
00102       KLineEdit* edit;
00103       KMFolder* mFolder;
00104       KMFolderTree* mFolderTree;
00105       TQString mFolderId;
00106       bool mMustBeReadWrite;
00107       bool mShowOutbox;
00108       bool mShowImapFolders;
00109   };
00110 
00111 } // namespace KMail
00112 
00113 #endif /*folderrequester_h*/