# configlist.h

Go to the documentation of this file.

    00001 /***************************************************************************
    00002                           configlist.h  -  description
    00003                              -------------------
    00004     begin                : Tue May 9 2000
    00005     copyright            : (C) 2000-2001 by Eggert Ehmke
    00006                            (C) 2007 by Ulrich Weigelt
    00007     email                : eggert.ehmke@berlin.de
    00008                            ulrich.weigelt@gmx.de
    00009
    00010     26 Sep 2002 - Allow for columns to be hidden. Allistar Melville
    00011  ***************************************************************************/
    00012
    00013 /***************************************************************************
    00014  *                                                                         *
    00015  *   This program is free software; you can redistribute it and/or modify  *
    00016  *   it under the terms of the GNU General Public License as published by  *
    00017  *   the Free Software Foundation; either version 2 of the License, or     *
    00018  *   (at your option) any later version.                                   *
    00019  *                                                                         *
    00020  ***************************************************************************/
    00021
    00022 #ifndef CONFIGLIST_H
    00023 #define CONFIGLIST_H
    00024
    00025 //TQt header
    00026 #include <ntqptrlist.h>
    00027 #include <ntqlistview.h>
    00028 #include <ntqobject.h>
    00029
    00030 //KDE headers
    00031 #include <kcombobox.h>
    00032 #include <kprocess.h>
    00033 #include <kdebug.h>
    00034
    00035 //KShowmail headers
    00036 #include "configelem.h"
    00037 #include "constants.h"
    00038 #include "kshowmailview.h"
    00039 #include "types.h"
    00040 #include "encryption.h"
    00041 #include "tdewalletaccess.h"
    00042 #include "filteritem.h"
    00043 #include "headerfilter.h"
    00044 #include "filterlog.h"
    00045
    00046 using namespace Constants;
    00047 using namespace Types;
    00048 using namespace Encryption;
    00049
    00050 class ConfigElem;
    00051 class KshowmailView;
    00052
    00059 class ConfigList : public TQObject, public TQPtrList<ConfigElem>
    00060 {
    00061
    00062   Q_OBJECT
    00063
    00064   public:
    00065
    00069     ConfigList ();
    00070
    00074     virtual ~ConfigList () {};
    00075
    00081     void refreshSetup( TDEListView* view );
    00082
    00087     int getRefreshTimeInterval() const;
    00088
    00093     void setRefreshTimeInterval( unsigned int interval );
    00094
    00099     bool AutoRefreshOn() const;
    00100
    00105     void setConfirmDeletion( bool confirm );
    00106
    00112     bool confirmDeletion();
    00113
    00119     bool confirmClose() const;
    00120
    00126     bool startMinimized() const;
    00127
    00133     bool closeToTray() const;
    00134
    00140     bool minimizesToTray() const;
    00141
    00147     bool showConnectionErrors() const;
    00148
    00154     void setAllowHTML( bool allowHTML );
    00155
    00162     bool allowHTML() const;
    00163
    00169     bool hasActiveAccounts();
    00170
    00175     uint getTimeoutTime() const;
    00176
    00183     void setTimeoutTime( uint time );
    00184
    00191     ConfigElem* getSelectedAccount();
    00192
    00198     void deleteSelectedMails();
    00199
    00209     void connectAccounts();
    00210
    00215     TQStringList getSelectedSubjects() const;
    00216
    00223     bool hasSelectedMails();
    00224
    00231     void showSelectedMails();
    00232
    00240     void refreshMailLists( FilterLog* log = NULL );
    00241
    00246     int getNumberNewMails();
    00247
    00252     int getNumberMails();
    00253
    00258     long getTotalSize();
    00259
    00265     void fillMailListView( KshowmailView* view );
    00266
    00273     bool showMainWindowForNewMails();
    00274
    00281     bool showAlertMessageForNewMails();
    00282
    00289     bool quitNoNewMails();
    00290
    00297     bool minimizeMainWindowNoNewMails();
    00298
    00303     int getInitTime();
    00304
    00309     void setInitTime( int time );
    00310
    00316     bool hasInitTime();
    00317
    00321     void refreshAccountList();
    00322
    00326     void killPOP3Jobs();
    00327
    00331     void showSelectedHeaders();
    00332
    00337     void executeNewMailCommand();
    00338
    00344     bool keepNew();
    00345
    00349     void printSetup();
    00350
    00356     void saveOptions();
    00357
    00363     void readStoredMails();
    00364
    00369      FilterAction_Type getSpamAction();
    00370
    00375      TQString getSpamMailbox();
    00376
    00377
    00378         bool setItem (const char* item);
    00379         void setList (TQListView* list);
    00380         void beep ();
    00381         void playSound ();
    00382         void playSound (const char* file);
    00383
    00384
    00385   private:
    00386
    00390     TDEConfig* config;
    00391
    00395     int m_nIntervalTimer;
    00396
    00400     uint m_nPop3Timer;
    00401
    00413     AccountTaskMap_Type AccountDeletionMap;
    00414
    00426     AccountTaskMap_Type AccountShowBodiesMap;
    00427
    00439     AccountTaskMap_Type AccountRefreshMap;
    00440
    00445     bool m_bConfirmDelete;
    00446
    00453     bool m_bAllowHTML;
    00454
    00461     int ctrOpenMessageWindows;
    00462
    00468     int m_nInitTimer;
    00469
    00473     bool m_bShowMessage;
    00474
    00478     bool m_bShowMainWindow;
    00479
    00483     bool m_bBeep;
    00484
    00488     bool m_bSound;
    00489
    00493     TQString m_strSoundFile;
    00494
    00498     bool m_bCommand;
    00499
    00503     TQString m_strCommandPath;
    00504
    00508     bool m_bTerminate;
    00509
    00513     bool m_bMinimize;
    00514
    00518     bool m_bShowConnectionErrors;
    00519
    00523     bool m_bConfirmClose;
    00524
    00528     bool m_bStartMinimized;
    00529
    00533     bool m_bCloseMinimizes;
    00534
    00538     bool m_bMinimizeToTray;
    00539
    00543     bool m_bKeepNew;
    00544
    00548      TQString spamMailbox;
    00549
    00553       FilterAction_Type spamAction;
    00554
    00555
    00556   protected:
    00557
    00565     virtual TQCollection::Item newItem( TQCollection::Item item );
    00566
    00575     virtual int compareItems( TQCollection::Item item1, TQCollection::Item item2 );
    00576
    00583     bool hasAccount( const TQString& name ) const;
    00584
    00590     ConfigElem* getAccount( const TQString& name ) const;
    00591
    00592   protected slots:
    00593
    00598     void slotAccountConfigChanged();
    00599
    00609     void slotCheckDeletionState( TQString account );
    00610
    00620     void slotCheckShowBodiesState( TQString account );
    00621
    00631     void slotMessageWindowOpened();
    00632
    00642     void slotMessageWindowClosed();
    00643
    00653     void slotCheckRefreshState( TQString account );
    00654
    00655   signals:
    00656
    00661     void sigConfigChanged();
    00662
    00666     void sigDeleteReady();
    00667
    00671     void sigShowBodiesReady();
    00672
    00678     void sigMessageWindowOpened();
    00679
    00685     void sigAllMessageWindowsClosed();
    00686
    00690     void sigRefreshReady();
    00691 };
    00692
    00693 #endif