29#ifndef KMAIL_ANTISPAMWIZARD_H 
   30#define KMAIL_ANTISPAMWIZARD_H 
   32#include "simplefoldertree.h" 
   35#include <tdelistbox.h> 
   38#include <tqcheckbox.h> 
   42class TDEActionCollection;
 
   49  class FolderRequester;
 
   52  class ASWizSpamRulesPage;
 
   53  class ASWizVirusRulesPage;
 
   54  class ASWizSummaryPage;
 
  124                      TQWidget * parent, KMFolderTree * mainFolderTree );
 
  137                        TQString name, TQString exec, TQString url, TQString filter,
 
  138                        TQString detection, TQString spam, TQString ham,
 
  139                        TQString header, TQString pattern, TQString pattern2,
 
  140                        TQString serverPattern,
 
  141                        bool detectionOnly, 
bool regExp, 
bool bayesFilter, 
 
  144          int getVersion()
 const { 
return mVersion; }
 
  145          int getPrio()
 const { 
return mPrio; }
 
  146          TQString getId()
  const { 
return mId; }
 
  147          TQString getVisibleName()
  const { 
return mVisibleName; }
 
  148          TQString getExecutable()
 const { 
return mExecutable; }
 
  149          TQString getWhatsThisText()
 const { 
return mWhatsThisText; }
 
  150          TQString getFilterName()
 const { 
return mFilterName; }
 
  151          TQString getDetectCmd()
 const { 
return mDetectCmd; }
 
  152          TQString getSpamCmd()
 const { 
return mSpamCmd; }
 
  153          TQString getHamCmd()
 const { 
return mHamCmd; }
 
  154          TQString getDetectionHeader()
 const { 
return mDetectionHeader; }
 
  155          TQString getDetectionPattern()
 const { 
return mDetectionPattern; }
 
  156          TQString getDetectionPattern2()
 const { 
return mDetectionPattern2; }
 
  157          TQString getServerPattern()
 const { 
return mServerPattern; }
 
  158          bool isServerBased() 
const;
 
  159          bool isDetectionOnly()
 const { 
return mDetectionOnly; }
 
  160          bool isUseRegExp()
 const { 
return mUseRegExp; }
 
  161          bool useBayesFilter()
 const { 
return mSupportsBayesFilter; }
 
  162          bool hasTristateDetection()
 const { 
return mSupportsUnsure; }
 
  165          bool isSpamTool()
 const { 
return ( mType == AntiSpam ); }
 
  166          bool isVirusTool()
 const { 
return ( mType == AntiVirus ); }
 
  177          TQString mVisibleName;
 
  179          TQString mExecutable;
 
  181          TQString mWhatsThisText;
 
  183          TQString mFilterName;
 
  191          TQString mDetectionHeader;
 
  193          TQString mDetectionPattern;
 
  195          TQString mDetectionPattern2;
 
  197          TQString mServerPattern;
 
  203          bool mSupportsBayesFilter;
 
  205          bool mSupportsUnsure;
 
  219                        TQValueList<SpamToolConfig> & configList );
 
  222          TQValueList<SpamToolConfig> & getToolList() { 
return mToolList; }
 
  224          void readAndMergeConfig();
 
  227          TQValueList<SpamToolConfig> & mToolList;
 
  255      int checkForProgram( 
const TQString &executable );
 
  257      bool anyVirusOptionChecked();
 
  259      const TQString uniqueNameFor( 
const TQString & name );
 
  261      void sortFilterOnExistance( 
const TQString & intendedFilterName,
 
  262                                  TQString & newFilters, 
 
  263                                  TQString & replaceFilters );
 
  266      ASWizInfoPage * mInfoPage;
 
  267      ASWizSpamRulesPage * mSpamRulesPage;
 
  268      ASWizVirusRulesPage * mVirusRulesPage;
 
  269      ASWizSummaryPage * mSummaryPage;
 
  272      TQValueList<SpamToolConfig> mToolList;
 
  277      bool mVirusToolsUsed;
 
  284  class ASWizPage : 
public TQWidget
 
  287      ASWizPage( TQWidget *parent, 
const char *name, 
 
  288                 const TQString *bannerName = 0);
 
  291      TQBoxLayout *mLayout;
 
  294      TQLabel *mBannerLabel;
 
  299  class ASWizInfoPage : 
public ASWizPage
 
  306                     TQWidget *parent, 
const char *name );
 
  308      void setScanProgressText( 
const TQString &toolName );
 
  309      void addAvailableTool( 
const TQString &visibleName );
 
  310      bool isProgramSelected( 
const TQString &visibleName );
 
  313      void processSelectionChange();
 
  316      void selectionChanged();
 
  320      TQLabel *mScanProgressText;
 
  321      TQLabel *mSelectionHint;
 
  322      TDEListBox *mToolsList;
 
  326  class ASWizSpamRulesPage : 
public ASWizPage
 
  332      ASWizSpamRulesPage( TQWidget * parent, 
const char * name, KMFolderTree * mainFolderTree );
 
  334      bool markAsReadSelected() 
const;
 
  335      bool moveSpamSelected() 
const;
 
  336      bool moveUnsureSelected() 
const;
 
  338      TQString selectedSpamFolderName() 
const;
 
  339      TQString selectedUnsureFolderName() 
const;
 
  341      void allowUnsureFolderSelection( 
bool enabled );
 
  344      void processSelectionChange();
 
  345      void processSelectionChange( 
KMFolder* );
 
  348      void selectionChanged();
 
  351      TQCheckBox * mMarkRules;
 
  352      TQCheckBox * mMoveSpamRules;
 
  353      TQCheckBox * mMoveUnsureRules;
 
  354      FolderRequester *mFolderReqForSpamFolder;
 
  355      FolderRequester *mFolderReqForUnsureFolder;
 
  359  class ASWizVirusRulesPage : 
public ASWizPage
 
  365      ASWizVirusRulesPage( TQWidget * parent, 
const char * name, KMFolderTree * mainFolderTree );
 
  367      bool pipeRulesSelected() 
const;
 
  368      bool moveRulesSelected() 
const;
 
  369      bool markReadRulesSelected() 
const;
 
  371      TQString selectedFolderName() 
const;
 
  374      void processSelectionChange();
 
  376      void selectionChanged();
 
  379      TQCheckBox * mPipeRules;
 
  380      TQCheckBox * mMoveRules;
 
  381      SimpleFolderTree *mFolderTree;
 
  382      TQCheckBox * mMarkRules;
 
  386  class ASWizSummaryPage : 
public ASWizPage
 
  392      ASWizSummaryPage( TQWidget * parent, 
const char * name );
 
  394      void setSummaryText( 
const TQString & text );
 
  397      TQLabel * mSummaryText;
 
Instances of this class control reading the configuration of the anti-spam tools from global and user...
 
void slotBuildSummary()
Create the summary text based on the current settings.
 
void checkToolAvailability()
Check if the spam tools are available via the PATH.
 
void checkProgramsSelections()
Modify the status of the wizard to reflect the selection of spam tools.
 
AntiSpamWizard(WizardMode mode, TQWidget *parent, KMFolderTree *mainFolderTree)
Constructor that needs to initialize from the main folder tree of KMail.
 
WizardMode
The wizard can be used for setting up anti-spam tools and for setting up anti-virus tools.
 
void checkVirusRulesSelections()
Modify the status of the wizard to reflect the selected functionality.
 
void slotHelpClicked()
Show a help topic.
 
void accept()
Evaluate the settings made and create the appropriate filter rules.