summaryrefslogtreecommitdiffstats
path: root/kbiff/kbiff.h
blob: d8c2524bc906c610441dd01f23211984cfa0b88f (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
 * kbiff.h
 * Copyright (C) 1999-2004 Kurt Granroth <granroth@kde.org>
 *
 * This file contains the declaration of the main KBiff
 * widget.
 *
 * $Id$
 */
#ifndef KBIFF_H 
#define KBIFF_H 

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif 

#include <ntqlist.h>

#include <kbiffmonitor.h>
#include <setupdlg.h>

#include <kbiffurl.h>
#include <kapp.h>

#include <ntqlabel.h>
#include <ntqtimer.h>

#include <notify.h>
#include <status.h>

#include <dcopclient.h>
#include <dcopobject.h>

class Led;

class KBiff : public TQLabel, virtual public DCOPObjectProxy
{
    Q_OBJECT
public:
    KBiff(DCOPClient *client_, TQWidget *parent_ = 0);
    virtual ~KBiff();

    bool isDocked() const;

    void processSetup(const KBiffSetup* setup, bool start);
    void readSessionConfig();

    void setMailboxList(const TQList<KBiffMailbox>& mailbox_list, unsigned int poll = 60);

    virtual bool process(const TQCString& obj, const TQCString& function,
                         const TQByteArray& data, TQCString& replyType,
                         TQByteArray &replyData );

public slots:
    void slotPlaySound(const TQString&);
    void slotLaunchFetchClient(const TQString&);
    void slotLaunchMailClient();

protected:
    void mousePressEvent(TQMouseEvent *);
    void enterEvent(TQEvent *);
    void leaveEvent(TQEvent *);

protected:
    void popupMenu();
    void reset();
    bool isRunning();
    bool isGIF8x(const TQString & file);
    void executeCommand(const TQString& command);
    void registerMe(DCOPClient *client);

protected slots:
    void saveYourself();
    void invokeHelp();
    void displayPixmap();
    void haveNewMail(const int, const TQString &);
    void haveNoNewMail();
    void currentStatus(const int, const TQString &, const KBiffMailState);
    void dock();
    void setup();
    void checkMailNow();
    void readMailNow();
    void readPop3MailNow();
    void stop();
    void start();
    void popupStatus();
    void invalidLogin(const TQString& mailbox);

private:
    bool findMailbox(const TQString& url, TQString& proxy);
    int newMailCount(const TQString& url);

    TQString getURLWithNewMail();
    TQString getMailBoxWithNewMail();
    TQString replaceCommandArgs(TQString cmdStr);

protected:
    bool myMUTEX;
    TQList<KBiffMonitor> monitorList;
    TQList<KBiffNotify>  notifyList;
    KBiffStatusList     statusList;
    TQStringList         proxyList;

    // Capability
    TQTimer  *statusTimer;
    
    // General settings
    TQString profile;
    TQString mailClient;

    // New mail
    bool    systemBeep;
    bool    runCommand;
    TQString runCommandPath;
    bool    runResetCommand;
    TQString runResetCommandPath;
    bool    playSound;
    TQString playSoundPath;
    bool    notify;
    bool    dostatus;

    bool    docked;
    bool    sessions;
    bool    skipcheck;

    bool    isSecure;

    TQString noMailIcon;
    TQString newMailIcon;
    TQString oldMailIcon;
    TQString noConnIcon;
    TQString stoppedIcon;

    KBiffStatus *status;
    bool         statusChanged;

    Led *mled;
};

#endif // KBIFF_H