hexchat_api/
consts.rs

1#![allow(dead_code, non_camel_case_types)]
2
3use enumflags2::bitflags;
4
5/// Channel flags.
6#[bitflags]
7#[repr(u32)]
8#[derive(Copy, Clone, Debug, PartialEq)]
9pub enum ChanFlag {
10    CONNECTED           = 0x0001,
11    CONNECTING          = 0x0002,
12    MARKED_AWAY         = 0x0004,
13    END_OF_MOTD         = 0x0008,
14    HAS_WHOX            = 0x0010,
15    HAS_IDMSG           = 0x0020,
16    HIDE_JOIN           = 0x0040,
17    HIDE_JOIN_UNSET     = 0x0080,
18    BEEP_ON_MESSAGE     = 0x0100,
19    BLINK_TRAY          = 0x0200,
20    BLINK_TASKBAR       = 0x0400,
21    LOGGING             = 0x0800,
22    LOGGING_UNSET       = 0x1000,
23    SCROLLBACK          = 0x2000,
24    SCROLLBACK_UNSET    = 0x4000,
25    STRIP_COLORS        = 0x8000,
26    STRIP_COLORS_UNSET  =0x10000,
27}
28
29/// Channel types.
30#[repr(u32)]
31#[derive(Copy, Clone, Debug, PartialEq)]
32pub enum ChanType {
33    SERVER                   = 1,
34    CHANNEL                  = 2,
35    DIALOG                   = 3,
36    NOTICE                   = 4,
37    SNOTICE                  = 5,
38}
39
40/// DCC status values.
41#[repr(u32)]
42#[derive(Copy, Clone, Debug, PartialEq)]
43pub enum DccStatus {
44    QUEUED                  = 0,
45    ACTIVE                  = 1,
46    FAILED                  = 2,
47    DONE                    = 3,
48    CONNECTING              = 4,
49    ABORTED                 = 5,
50}
51
52/// DCC action type.
53#[repr(u32)]
54#[derive(Copy, Clone, Debug, PartialEq)]
55pub enum DccType {
56    SEND                    = 0,
57    RECIEVE                 = 1,
58    CHATRECV                = 2,
59    CHATSEND                = 3,
60}
61
62// The table online has these "flags" listed as sequential ints.
63// I need to verify whether the online page is wrong, or my understanding
64// of what "flags" means wrt HexChat is wrong.
65
66#[bitflags]
67#[repr(u32)]
68#[derive(Copy, Clone, Debug, PartialEq)]
69pub enum IgnFlag {
70    PRIVATE              = 0x01,
71    NOTICE               = 0x02,
72    CHANNEL              = 0x04,
73    CTCP                 = 0x08,
74    INVITE               = 0x10,
75    UNIGNORE             = 0x20,
76    NOSAVE               = 0x40,
77    DCC                  = 0x80,
78}
79
80// IRC color codes. Use these in strings printed to he/xchat.
81pub const IRC_WHITE: &str            = "\x0300";
82pub const IRC_BLACK: &str            = "\x0301";
83pub const IRC_NAVY: &str             = "\x0302";
84pub const IRC_GREEN: &str            = "\x0303";
85pub const IRC_RED: &str              = "\x0304";
86pub const IRC_MAROON: &str           = "\x0305";
87pub const IRC_PURPLE: &str           = "\x0306";
88pub const IRC_OLIVE: &str            = "\x0307";
89pub const IRC_YELLOW: &str           = "\x0308";
90pub const IRC_LIGHT_GREEN: &str      = "\x0309";
91pub const IRC_TEAL: &str             = "\x0310";
92pub const IRC_CYAN: &str             = "\x0311";
93pub const IRC_ROYAL_BLUE: &str       = "\x0312";
94pub const IRC_MAGENTA: &str          = "\x0313";
95pub const IRC_GRAY: &str             = "\x0314";
96pub const IRC_LIGHT_GRAY: &str       = "\x0315";
97
98
99// IRC text format codes. Use these in strings printed to he/xchat.
100
101pub const IRC_BOLD: &str               = "\x02"; //"\002";
102pub const IRC_HIDDEN: &str             = "\x08"; //"\010";
103pub const IRC_UNDERLINE: &str          = "\x1F"; //"\037";
104pub const IRC_ORIG_ATTRIBS: &str       = "\x0F"; //"\017";
105pub const IRC_REVERSE_COLOR: &str      = "\x16"; //"\026";
106pub const IRC_BEEP: &str               = "\x07"; //"\007";
107pub const IRC_ITALICS: &str            = "\x1D"; //"\035";
108
109