summaryrefslogtreecommitdiffstats
path: root/ksirc/chanButtons.h
blob: c9eab5d52ec2725a3a9455d08263e3f2807c56f6 (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
/* mode buttons for ksirc - Robbie Ward <[email protected]>*/

#ifndef CHANBUTTONS_H
#define CHANBUTTONS_H

#include <tqwidget.h>
#include <tqpushbutton.h>
#include <kdialog.h>

class TQHBoxLayout;
class TQVBoxLayout;
class KPopupMenu;
class chanbuttonsDialog;
class KIntSpinBox;
class TQLineEdit;
class KSircProcess;
class KPushButton;

class chanButtons : public QWidget
{
  Q_OBJECT
  friend class KSircTopLevel;
  public:
    chanButtons(KSircProcess *proc, TQWidget* parent=0, const char* name=0);
    ~chanButtons() {};

    void setProtectMode(bool value) { protectButton->setOn(value); }
    void setModerateMode(bool value) { moderateButton->setOn(value); }
    void setNooutsideMode(bool value) { outsideButton->setOn(value); }
    void setButtonsEnabled(bool);
    void setMenuItemMode(int, bool);

  signals:
    void mode(TQString, int, TQString nick = TQString::null);  /// int == 0 channel mode, int == 1 user nick mode

  private slots:
    void protectMode();
    void outsideMode();
    void moderateMode();
    void invite();
    void limited();
    void key();
    void secret();
    void invisible();
    void wallops();
    void serverNotices();

  private:
    int toggleMenu[7];
    TQHBoxLayout *layout;
    TQPushButton *protectButton;
    TQPushButton *moderateButton;
    TQPushButton *outsideButton;
    TQPushButton *menuButton;
    KPopupMenu *Popupmenu;
    chanbuttonsDialog *chanDialog;
    KSircProcess *m_proc;
};

class chanbuttonsDialog : public KDialog
{
  Q_OBJECT
  friend class chanButtons;
  public:
    enum type { limited, key };
    chanbuttonsDialog(const type &modeType, TQWidget *parent=0, const char *name=0, bool modal=true);
    ~chanbuttonsDialog() {};

  private slots:
    void keyString();
    void limitedUsers();
    TQString sendKey() { return m_sendKey; }
    int sendLimitedUsers() { return m_sendLimitedUsers; };

  private:
    TQString m_sendKey;
    int m_sendLimitedUsers;
    TQVBoxLayout *LimitedLayout;
    TQHBoxLayout *Layout;
    KIntSpinBox *SpinBox;
    TQLineEdit *EditBox;
    KPushButton *okButton;
    KPushButton *cancelButton;
};
#endif