Communi  3.0.0
A cross-platform IRC framework written with Qt
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Macros Groups Pages
irc.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2008-2013 The Communi Project
3 *
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12 * License for more details.
13 */
14 
15 #ifndef IRC_H
16 #define IRC_H
17 
18 #include <IrcGlobal>
19 #include <QtCore/qobject.h>
20 #include <QtCore/qstring.h>
21 #include <QtCore/qmetatype.h>
22 
23 IRC_BEGIN_NAMESPACE
24 
25 #ifdef IRC_DOXYGEN
26 namespace Irc
27 {
28  Q_INVOKABLE QString version();
29  Q_INVOKABLE QString codeToString(int code);
30  Q_INVOKABLE QString nickFromPrefix(const QString& prefix);
31  Q_INVOKABLE QString identFromPrefix(const QString& prefix);
32  Q_INVOKABLE QString hostFromPrefix(const QString& prefix);
33  Q_INVOKABLE void registerMetaTypes();
34 #else
35 class IRC_CORE_EXPORT Irc : public QObject
36 {
37  Q_OBJECT
38  Q_ENUMS(Color DataRole SortMethod Code)
39 
40 public:
41  Q_INVOKABLE static QString version();
42  Q_INVOKABLE static QString codeToString(int code);
43  Q_INVOKABLE static QString nickFromPrefix(const QString& prefix);
44  Q_INVOKABLE static QString identFromPrefix(const QString& prefix);
45  Q_INVOKABLE static QString hostFromPrefix(const QString& prefix);
46  Q_INVOKABLE static void registerMetaTypes();
47 #endif
48 
49  enum Color {
50  White = 0,
51  Black = 1,
52  Blue = 2,
53  Green = 3,
54  Red = 4,
55  Brown = 5,
56  Purple = 6,
57  Orange = 7,
58  Yellow = 8,
60  Cyan = 10,
61  LightCyan = 11,
62  LightBlue = 12,
63  Pink = 13,
64  Gray = 14,
65  LightGray = 15
66  };
67 
68  enum DataRole {
76  };
77 
78  enum SortMethod {
83  };
84 
85  enum Code {
93  RPL_BOUNCE = 10,
96  RPL_YOURID = 42,
111  RPL_STATS = 210,
121  RPL_UMODEIS = 221,
122  RPL_MODLIST = 222,
128  RPL_SERVICE = 233,
147  RPL_LUSEROP = 252,
150  RPL_LUSERME = 255,
151  RPL_ADMINME = 256,
162  RPL_NETSTAT = 268,
164  RPL_PRIVS = 270,
167  RPL_NOTIFY = 273,
173  RPL_GLIST = 280,
179  RPL_FEATURE = 284,
184  RPL_CHKHEAD = 286,
192  RPL_HELPHDR = 290,
193  RPL_DATASTR = 290,
195  RPL_HELPOP = 291,
198  RPL_HELPTLR = 292,
200  RPL_HELPHLP = 293,
202  RPL_HELPFWD = 294,
204  RPL_HELPIGN = 295,
207  RPL_NONE = 300,
208  RPL_AWAY = 301,
210  RPL_ISON = 303,
211  RPL_TEXT = 304,
212  RPL_UNAWAY = 305,
213  RPL_NOWAWAY = 306,
237  RPL_LIST = 322,
238  RPL_LISTEND = 323,
248  RPL_NOTOPIC = 331,
249  RPL_TOPIC = 332,
259  RPL_INVITED = 345,
264  RPL_VERSION = 351,
270  RPL_CLOSING = 362,
272  RPL_LINKS = 364,
275  RPL_BANLIST = 367,
278  RPL_INFO = 371,
279  RPL_MOTD = 372,
285  RPL_SPAM = 377,
297  RPL_QLIST = 386,
298  RPL_IRCOPS = 386,
301  RPL_ALIST = 388,
303  RPL_TIME = 391,
305  RPL_USERS = 393,
307  RPL_NOUSERS = 395,
324  ERR_BADMASK = 415,
329  ERR_NOMOTD = 422,
339  ERR_NORULES = 434,
346  ERR_DEAD = 438,
352  ERR_NOLOGIN = 444,
372  ERR_KEYSET = 467,
375  ERR_LINKSET = 469,
389  ERR_NOULINE = 480,
396  ERR_DESYNC = 484,
426  ERR_BADPING = 513,
434  ERR_ADMONLY = 519,
450  RPL_LOGON = 600,
451  RPL_LOGOFF = 601,
454  RPL_NOWON = 604,
455  RPL_NOWOFF = 605,
459  RPL_ISOPER = 610,
460  RPL_ISLOCOP = 611,
464  RPL_DCCLIST = 618,
467  RPL_DCCINFO = 620,
468  RPL_ENDOFO = 626,
471  RPL_DUMPING = 640,
472  RPL_DUMPRPL = 641,
473  RPL_EODUMP = 642,
493  RPL_HELPTXT = 705,
496  RPL_ETRACE = 709,
497  RPL_KNOCK = 710,
507  ERR_NOPRIVS = 723,
511  RPL_XINFO = 771,
526  };
527 };
528 
529 #ifndef QT_NO_DEBUG_STREAM
530 IRC_CORE_EXPORT QDebug operator<<(QDebug debug, Irc::Code code);
531 IRC_CORE_EXPORT QDebug operator<<(QDebug debug, Irc::DataRole role);
532 IRC_CORE_EXPORT QDebug operator<<(QDebug debug, Irc::Color color);
533 IRC_CORE_EXPORT QDebug operator<<(QDebug debug, Irc::SortMethod method);
534 #endif // QT_NO_DEBUG_STREAM
535 
536 IRC_END_NAMESPACE
537 
538 Q_DECLARE_METATYPE(IRC_PREPEND_NAMESPACE(Irc::Code))
539 Q_DECLARE_METATYPE(IRC_PREPEND_NAMESPACE(Irc::DataRole))
540 Q_DECLARE_METATYPE(IRC_PREPEND_NAMESPACE(Irc::Color))
541 Q_DECLARE_METATYPE(IRC_PREPEND_NAMESPACE(Irc::SortMethod))
542 
543 #endif // IRC_H
304
Definition: irc.h:211
494
Definition: irc.h:413
245
Definition: irc.h:139
237
Definition: irc.h:132
423
Definition: irc.h:330
363
Definition: irc.h:271
479
Definition: irc.h:387
214
Definition: irc.h:115
484
Definition: irc.h:395
600
Definition: irc.h:450
226
Definition: irc.h:125
486
Definition: irc.h:404
232
Definition: irc.h:127
375
Definition: irc.h:282
252
Definition: irc.h:147
503
Definition: irc.h:422
519
Definition: irc.h:435
354
Definition: irc.h:267
262
Definition: irc.h:157
485
Definition: irc.h:401
429
Definition: irc.h:333
Q_INVOKABLE QString nickFromPrefix(const QString &prefix)
Definition: irc.cpp:68
291
Definition: irc.h:195
369
Definition: irc.h:277
294
Definition: irc.h:201
386
Definition: irc.h:297
435
Definition: irc.h:340
716
Definition: irc.h:503
302
Definition: irc.h:209
289
Definition: irc.h:190
617
Definition: irc.h:463
630
Definition: irc.h:469
626
Definition: irc.h:468
466
Definition: irc.h:371
206
Definition: irc.h:106
724
Definition: irc.h:508
333
Definition: irc.h:250
550
Definition: irc.h:446
443
Definition: irc.h:351
353
Definition: irc.h:266
518
Definition: irc.h:432
326
Definition: irc.h:242
434
Definition: irc.h:339
665
Definition: irc.h:479
495
Definition: irc.h:414
330
Definition: irc.h:247
256
Definition: irc.h:151
551
Definition: irc.h:447
421
Definition: irc.h:328
602
Definition: irc.h:452
682
Definition: irc.h:487
478
Definition: irc.h:386
Channel object (IrcChannel*)
Definition: irc.h:71
239
Definition: irc.h:133
389
Definition: irc.h:302
446
Definition: irc.h:354
673
Definition: irc.h:484
400
Definition: irc.h:309
243
Definition: irc.h:137
406
Definition: irc.h:315
522
Definition: irc.h:440
355
Definition: irc.h:268
687
Definition: irc.h:488
320
Definition: irc.h:235
608
Definition: irc.h:458
433
Definition: irc.h:337
319
Definition: irc.h:232
321
Definition: irc.h:236
493
Definition: irc.h:412
451
Definition: irc.h:357
717
Definition: irc.h:504
307
Definition: irc.h:215
973
Definition: irc.h:515
255
Definition: irc.h:150
User object (IrcUser*)
Definition: irc.h:69
219
Definition: irc.h:120
502
Definition: irc.h:420
999
Definition: irc.h:525
392
Definition: irc.h:304
202
Definition: irc.h:102
309
Definition: irc.h:220
499
Definition: irc.h:418
43
Definition: irc.h:97
474
Definition: irc.h:381
434
Definition: irc.h:338
320
Definition: irc.h:233
465
Definition: irc.h:370
688
Definition: irc.h:489
349
Definition: irc.h:263
290
Definition: irc.h:192
381
Definition: irc.h:292
705
Definition: irc.h:493
395
Definition: irc.h:307
477
Definition: irc.h:385
603
Definition: irc.h:453
247
Definition: irc.h:141
289
Definition: irc.h:189
288
Definition: irc.h:188
489
Definition: irc.h:408
The default value is &quot;white&quot;.
Definition: irc.h:50
513
Definition: irc.h:426
374
Definition: irc.h:281
296
Definition: irc.h:205
SortMethod
Definition: irc.h:78
709
Definition: irc.h:496
396
Definition: irc.h:308
642
Definition: irc.h:473
711
Definition: irc.h:498
240
Definition: irc.h:134
325
Definition: irc.h:241
366
Definition: irc.h:274
613
Definition: irc.h:462
318
Definition: irc.h:231
Sort by name (Irc::NameRole)
Definition: irc.h:80
415
Definition: irc.h:324
249
Definition: irc.h:143
679
Definition: irc.h:486
479
Definition: irc.h:388
Color
Definition: irc.h:49
338
Definition: irc.h:255
274
Definition: irc.h:168
307
Definition: irc.h:214
216
Definition: irc.h:117
345
Definition: irc.h:259
517
Definition: irc.h:431
660
Definition: irc.h:474
373
Definition: irc.h:280
663
Definition: irc.h:477
468
Definition: irc.h:373
10
Definition: irc.h:94
371
Definition: irc.h:278
468
Definition: irc.h:374
378
Definition: irc.h:286
671
Definition: irc.h:482
496
Definition: irc.h:415
611
Definition: irc.h:460
330
Definition: irc.h:246
310
Definition: irc.h:223
404
Definition: irc.h:313
477
Definition: irc.h:384
269
Definition: irc.h:163
983
Definition: irc.h:524
411
Definition: irc.h:320
295
Definition: irc.h:203
310
Definition: irc.h:222
394
Definition: irc.h:306
257
Definition: irc.h:152
604
Definition: irc.h:454
455
Definition: irc.h:360
286
Definition: irc.h:183
285
Definition: irc.h:180
386
Definition: irc.h:298
391
Definition: irc.h:303
437
Definition: irc.h:344
472
Definition: irc.h:379
324
Definition: irc.h:239
678
Definition: irc.h:485
242
Definition: irc.h:136
670
Definition: irc.h:481
368
Definition: irc.h:276
372
Definition: irc.h:279
Q_INVOKABLE QString codeToString(int code)
Definition: irc.cpp:51
382
Definition: irc.h:293
209
Definition: irc.h:109
377
Definition: irc.h:284
258
Definition: irc.h:153
320
Definition: irc.h:234
631
Definition: irc.h:470
244
Definition: irc.h:138
497
Definition: irc.h:416
The default value is &quot;black&quot;.
Definition: irc.h:51
710
Definition: irc.h:497
974
Definition: irc.h:516
306
Definition: irc.h:213
317
Definition: irc.h:230
379
Definition: irc.h:288
431
Definition: irc.h:335
316
Definition: irc.h:229
516
Definition: irc.h:430
288
Definition: irc.h:187
The default value is &quot;brown&quot;.
Definition: irc.h:55
The default value is &quot;lightgray&quot;.
Definition: irc.h:65
376
Definition: irc.h:283
405
Definition: irc.h:314
612
Definition: irc.h:461
430
Definition: irc.h:334
449
Definition: irc.h:356
The default value is &quot;yellow&quot;.
Definition: irc.h:58
380
Definition: irc.h:291
491
Definition: irc.h:410
Q_INVOKABLE QString hostFromPrefix(const QString &prefix)
Definition: irc.cpp:102
460
Definition: irc.h:365
Buffer object (IrcBuffer*)
Definition: irc.h:70
210
Definition: irc.h:111
309
Definition: irc.h:219
486
Definition: irc.h:403
204
Definition: irc.h:104
416
Definition: irc.h:325
714
Definition: irc.h:501
488
Definition: irc.h:407
207
Definition: irc.h:107
The default value is &quot;green&quot;.
Definition: irc.h:53
463
Definition: irc.h:368
982
Definition: irc.h:523
273
Definition: irc.h:167
774
Definition: irc.h:513
The default value is &quot;lightgreen&quot;.
Definition: irc.h:59
276
Definition: irc.h:170
435
Definition: irc.h:341
259
Definition: irc.h:154
483
Definition: irc.h:393
203
Definition: irc.h:103
295
Definition: irc.h:204
329
Definition: irc.h:245
715
Definition: irc.h:502
291
Definition: irc.h:194
The default value is &quot;pink&quot;.
Definition: irc.h:63
DataRole
Definition: irc.h:68
484
Definition: irc.h:396
511
Definition: irc.h:424
515
Definition: irc.h:429
236
Definition: irc.h:131
225
Definition: irc.h:124
422
Definition: irc.h:329
605
Definition: irc.h:455
231
Definition: irc.h:126
User mode (QString)
Definition: irc.h:74
287
Definition: irc.h:185
475
Definition: irc.h:382
262
Definition: irc.h:156
201
Definition: irc.h:101
342
Definition: irc.h:258
10
Definition: irc.h:93
263
Definition: irc.h:158
Buffer/user name (QString)
Definition: irc.h:72
3
Definition: irc.h:88
407
Definition: irc.h:316
250
Definition: irc.h:145
432
Definition: irc.h:336
640
Definition: irc.h:471
341
Definition: irc.h:257
348
Definition: irc.h:262
619
Definition: irc.h:465
208
Definition: irc.h:108
606
Definition: irc.h:456
461
Definition: irc.h:366
689
Definition: irc.h:490
436
Definition: irc.h:342
312
Definition: irc.h:225
5
Definition: irc.h:90
442
Definition: irc.h:350
377
Definition: irc.h:285
518
Definition: irc.h:433
Channel/user prefix and name (QString)
Definition: irc.h:75
303
Definition: irc.h:210
205
Definition: irc.h:105
322
Definition: irc.h:237
619
Definition: irc.h:466
438
Definition: irc.h:345
250
Definition: irc.h:144
666
Definition: irc.h:480
268
Definition: irc.h:162
292
Definition: irc.h:198
972
Definition: irc.h:514
327
Definition: irc.h:243
347
Definition: irc.h:261
439
Definition: irc.h:347
311
Definition: irc.h:224
725
Definition: irc.h:509
50
Definition: irc.h:98
979
Definition: irc.h:520
270
Definition: irc.h:164
773
Definition: irc.h:512
485
Definition: irc.h:400
484
Definition: irc.h:397
The default value is &quot;lightcyan&quot;.
Definition: irc.h:61
980
Definition: irc.h:521
387
Definition: irc.h:299
217
Definition: irc.h:118
459
Definition: irc.h:364
The default value is &quot;orange&quot;.
Definition: irc.h:57
The default value is &quot;lightblue&quot;.
Definition: irc.h:62
523
Definition: irc.h:441
The default value is &quot;blue&quot;.
Definition: irc.h:52
281
Definition: irc.h:174
771
Definition: irc.h:511
267
Definition: irc.h:161
408
Definition: irc.h:318
456
Definition: irc.h:361
618
Definition: irc.h:464
519
Definition: irc.h:434
492
Definition: irc.h:411
690
Definition: irc.h:491
453
Definition: irc.h:359
271
Definition: irc.h:165
482
Definition: irc.h:392
314
Definition: irc.h:227
620
Definition: irc.h:467
408
Definition: irc.h:317
51
Definition: irc.h:99
235
Definition: irc.h:130
Sort by hand by calling sort()
Definition: irc.h:79
424
Definition: irc.h:331
290
Definition: irc.h:193
484
Definition: irc.h:394
42
Definition: irc.h:96
975
Definition: irc.h:517
473
Definition: irc.h:380
514
Definition: irc.h:428
722
Definition: irc.h:506
976
Definition: irc.h:518
308
Definition: irc.h:216
520
Definition: irc.h:436
280
Definition: irc.h:173
367
Definition: irc.h:275
328
Definition: irc.h:244
325
Definition: irc.h:240
501
Definition: irc.h:419
Q_INVOKABLE QString version()
Definition: irc.cpp:41
457
Definition: irc.h:362
467
Definition: irc.h:372
486
Definition: irc.h:402
334
Definition: irc.h:251
14
Definition: irc.h:95
299
Definition: irc.h:206
309
Definition: irc.h:218
293
Definition: irc.h:199
440
Definition: irc.h:348
285
Definition: irc.h:181
282
Definition: irc.h:177
8
Definition: irc.h:91
464
Definition: irc.h:369
416
Definition: irc.h:326
414
Definition: irc.h:323
476
Definition: irc.h:383
246
Definition: irc.h:140
287
Definition: irc.h:186
470
Definition: irc.h:376
215
Definition: irc.h:116
266
Definition: irc.h:160
315
Definition: irc.h:228
601
Definition: irc.h:451
210
Definition: irc.h:110
253
Definition: irc.h:148
553
Definition: irc.h:449
The default value is &quot;purple&quot;.
Definition: irc.h:56
378
Definition: irc.h:287
308
Definition: irc.h:217
265
Definition: irc.h:159
403
Definition: irc.h:312
334
Definition: irc.h:252
480
Definition: irc.h:390
481
Definition: irc.h:391
346
Definition: irc.h:260
487
Definition: irc.h:405
Code
Definition: irc.h:85
Sort by title (Irc::TitleRole)
Definition: irc.h:81
520
Definition: irc.h:438
610
Definition: irc.h:459
672
Definition: irc.h:483
200
Definition: irc.h:100
364
Definition: irc.h:272
708
Definition: irc.h:495
401
Definition: irc.h:310
241
Definition: irc.h:135
393
Definition: irc.h:305
351
Definition: irc.h:264
323
Definition: irc.h:238
662
Definition: irc.h:476
641
Definition: irc.h:472
498
Definition: irc.h:417
2
Definition: irc.h:87
361
Definition: irc.h:269
977
Definition: irc.h:519
485
Definition: irc.h:399
520
Definition: irc.h:437
221
Definition: irc.h:121
292
Definition: irc.h:197
310
Definition: irc.h:221
233
Definition: irc.h:128
293
Definition: irc.h:200
213
Definition: irc.h:114
444
Definition: irc.h:352
4
Definition: irc.h:89
286
Definition: irc.h:184
514
Definition: irc.h:427
The default value is &quot;cyan&quot;.
Definition: irc.h:60
362
Definition: irc.h:270
281
Definition: irc.h:175
339
Definition: irc.h:256
383
Definition: irc.h:294
981
Definition: irc.h:522
254
Definition: irc.h:149
331
Definition: irc.h:248
1
Definition: irc.h:86
437
Definition: irc.h:343
712
Definition: irc.h:499
524
Definition: irc.h:443
485
Definition: irc.h:398
413
Definition: irc.h:322
218
Definition: irc.h:119
283
Definition: irc.h:178
664
Definition: irc.h:478
385
Definition: irc.h:296
334
Definition: irc.h:253
Channel/user prefix (QString)
Definition: irc.h:73
661
Definition: irc.h:475
272
Definition: irc.h:166
294
Definition: irc.h:202
313
Definition: irc.h:226
300
Definition: irc.h:207
285
Definition: irc.h:182
458
Definition: irc.h:363
379
Definition: irc.h:289
277
Definition: irc.h:171
452
Definition: irc.h:358
438
Definition: irc.h:346
284
Definition: irc.h:179
524
Definition: irc.h:442
380
Definition: irc.h:290
447
Definition: irc.h:355
222
Definition: irc.h:122
525
Definition: irc.h:444
704
Definition: irc.h:492
384
Definition: irc.h:295
469
Definition: irc.h:375
248
Definition: irc.h:142
274
Definition: irc.h:169
278
Definition: irc.h:172
521
Definition: irc.h:439
726
Definition: irc.h:510
212
Definition: irc.h:113
706
Definition: irc.h:494
222
Definition: irc.h:123
723
Definition: irc.h:507
338
Definition: irc.h:254
526
Definition: irc.h:445
251
Definition: irc.h:146
480
Definition: irc.h:389
412
Definition: irc.h:321
419
Definition: irc.h:327
462
Definition: irc.h:367
332
Definition: irc.h:249
607
Definition: irc.h:457
512
Definition: irc.h:425
305
Definition: irc.h:212
718
Definition: irc.h:505
365
Definition: irc.h:273
504
Definition: irc.h:423
Sort by activity.
Definition: irc.h:82
387
Definition: irc.h:300
409
Definition: irc.h:319
282
Definition: irc.h:176
489
Definition: irc.h:409
261
Definition: irc.h:155
9
Definition: irc.h:92
234
Definition: irc.h:129
388
Definition: irc.h:301
211
Definition: irc.h:112
Q_INVOKABLE QString identFromPrefix(const QString &prefix)
Definition: irc.cpp:85
425
Definition: irc.h:332
352
Definition: irc.h:265
Q_INVOKABLE void registerMetaTypes()
Definition: irc.cpp:114
402
Definition: irc.h:311
301
Definition: irc.h:208
441
Definition: irc.h:349
The default value is &quot;red&quot;.
Definition: irc.h:54
470
Definition: irc.h:377
471
Definition: irc.h:378
The default value is &quot;gray&quot;.
Definition: irc.h:64
487
Definition: irc.h:406
445
Definition: irc.h:353
290
Definition: irc.h:191
291
Definition: irc.h:196
713
Definition: irc.h:500
552
Definition: irc.h:448
503
Definition: irc.h:421