summaryrefslogtreecommitdiffstats
path: root/kmail/kmfoldercombobox.h
blob: 42461c0b9988c890427a7ae0dcd83dd7230476b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* kmail folder-list combo-box
 * A specialized TQComboBox widget that refreshes its contents when
 * the folder list changes.
 */

#ifndef __KMFOLDERCOMBOBOX
#define __KMFOLDERCOMBOBOX

#include "kmfolder.h"

#include <tqcombobox.h>
#include <tqguardedptr.h>

class KMFolderComboBox : public TQComboBox
{
  TQ_OBJECT
  

public:
  KMFolderComboBox( TQWidget *parent = 0, char *name = 0 );
  KMFolderComboBox( bool rw, TQWidget *parent = 0, char *name = 0 );

  /** Select whether the outbox folder is shown.  Default is yes. */
  void showOutboxFolder(bool shown);

  /** Select whether the IMAP folders should be shown.  Default is yes. */
  void showImapFolders(bool shown);

  void setFolder( KMFolder *aFolder );
  void setFolder( const TQString &idString );
  KMFolder *getFolder();

public slots:
  /** Refresh list of folders in the combobox. */
  void refreshFolders();

private slots:
  void slotActivated(int index);

private:
  /** Create folder list using the folder manager. */
  void createFolderList(TQStringList *names,
                        TQValueList<TQGuardedPtr<KMFolder> > *folders);
  void init();

  TQGuardedPtr<KMFolder> mFolder;
  bool mOutboxShown;
  bool mImapShown;
  int mSpecialIdx;
};

#endif /* __KMFOLDERCOMBOBOX */