~neon/kdenetwork/trunk

« back to all changes in this revision

Viewing changes to kopete/protocols/irc/libkirc/client/kirccommand.h

  • Committer: uwolfer
  • Date: 2013-06-08 10:12:41 UTC
  • Revision ID: svn-v4:283d02a7-25f6-0310-bc7c-ecb5cbfe19da:trunk/KDE/kdenetwork:1357331
kdenetwork has moved to Git

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    kircmessageredirector.h - IRC Client
3
 
 
4
 
    Copyright (c) 2004-2007 by Michel Hermier <michel.hermier@gmail.com>
5
 
 
6
 
    Kopete    (c) 2004-2007 by the Kopete developers <kopete-devel@kde.org>
7
 
 
8
 
    *************************************************************************
9
 
    *                                                                       *
10
 
    * This program is free software; you can redistribute it and/or modify  *
11
 
    * it under the terms of the GNU General Public License as published by  *
12
 
    * the Free Software Foundation; either version 2 of the License, or     *
13
 
    * (at your option) any later version.                                   *
14
 
    *                                                                       *
15
 
    *************************************************************************
16
 
*/
17
 
 
18
 
#ifndef KIRC_COMMAND_H
19
 
#define KIRC_COMMAND_H
20
 
 
21
 
#include "kircmessage.h"
22
 
 
23
 
namespace KIrc
24
 
{
25
 
 
26
 
class Message;
27
 
 
28
 
class Command
29
 
        : public QObject
30
 
{
31
 
        Q_OBJECT
32
 
 
33
 
//      Q_PROPERTY(int min READ min WRITE setMin)
34
 
//      Q_PROPERTY(int max READ max WRITE setMax)
35
 
//      Q_PROPERTY(QString help READ help WRITE setHelp)
36
 
 
37
 
public:
38
 
        static QString expand(QString command, QString args);
39
 
 
40
 
public:
41
 
        enum {
42
 
                Unknown = -1,
43
 
                Unlimited = -2
44
 
        };
45
 
/*
46
 
        typedef enum {
47
 
                CHECK_CONNECTED = 0x01
48
 
        } CheckFlag;
49
 
 
50
 
        typdef QFlags<CheckFlag> CheckFlags;
51
 
*/
52
 
        explicit Command(QObject *parent = 0);
53
 
        ~Command();
54
 
 
55
 
public: // READ properties accessors.
56
 
//      int min() const;
57
 
//      int max() const;
58
 
        QString help() const;
59
 
 
60
 
public slots: // WRITE properties accessors.
61
 
//      void setMin();
62
 
//      void setMax();
63
 
        void setHelp(const QString &help);
64
 
 
65
 
public slots:
66
 
//      void setMinMax(int minMax);
67
 
//      void setMinMax(int min, int max);
68
 
 
69
 
        /**
70
 
         * Attempt to send the message.
71
 
         */
72
 
        virtual void handleMessage(KIrc::Message msg);
73
 
 
74
 
signals:
75
 
        void redirect(KIrc::Message);
76
 
 
77
 
protected:
78
 
        /**
79
 
         * Check that the given message can be send.
80
 
         * @return true if the message can be send.
81
 
         */
82
 
        bool checkValidity(const Message &msg);
83
 
 
84
 
private:
85
 
        Q_DISABLE_COPY(Command)
86
 
 
87
 
        class Private;
88
 
        Private * const d;
89
 
};
90
 
 
91
 
}
92
 
 
93
 
#endif