]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/mode.h
Apply patch from BuildSmart that fixes a few issues on Mac with the logfile path...
[user/henk/code/inspircd.git] / include / mode.h
index 62374be6c2c279b039c4872a74606e93fd70511f..6d91de1a89b0ea329bba1bb64beb0702f396be3a 100644 (file)
@@ -30,7 +30,9 @@ class InspIRCd;
  */
 enum ModeType
 {
+       /** User mode */
        MODETYPE_USER = 0,
+       /** Channel mode */
        MODETYPE_CHANNEL = 1
 };
 
@@ -64,8 +66,11 @@ enum ModeMasks
  */
 enum PrefixModeValue
 {
+       /* +v */
        VOICE_VALUE     =       10000,
+       /* +h */
        HALFOP_VALUE    =       20000,
+       /* +o */
        OP_VALUE        =       30000
 };
 
@@ -90,9 +95,12 @@ typedef std::pair<bool,std::string> ModePair;
  * mode is expected to have a parameter, then this is
  * equivalent to returning MODEACTION_DENY.
  */
-class ModeHandler : public Extensible
+class CoreExport ModeHandler : public Extensible
 {
  protected:
+       /**
+        * Creator/owner pointer
+        */
        InspIRCd* ServerInstance;
        /**
         * The mode letter you're implementing.
@@ -134,7 +142,7 @@ class ModeHandler : public Extensible
 
        /** Number of items with this mode set on them
         */
-       static unsigned int count;
+       unsigned int count;
 
  public:
        /**
@@ -171,6 +179,9 @@ class ModeHandler : public Extensible
        /** Get number of items with this mode set on them
         */
        virtual unsigned int GetCount();
+       /** Adjust usage count returned by GetCount
+        */
+       virtual void ChangeCount(int modifier);
        /**
         * Get the 'value' of this modes prefix.
         * determines which to display when there are multiple.
@@ -276,9 +287,12 @@ class ModeHandler : public Extensible
  * and attach it to the mode using Server::AddModeWatcher and Server::DelModeWatcher.
  * A ModeWatcher will be called both before and after the mode change.
  */
-class ModeWatcher : public Extensible
+class CoreExport ModeWatcher : public Extensible
 {
  protected:
+       /**
+        * Creator/owner pointer
+        */
        InspIRCd* ServerInstance;
        /**
         * The mode letter this class is watching
@@ -344,9 +358,12 @@ typedef std::vector<ModeWatcher*>::iterator ModeWatchIter;
  * parses client to server MODE strings for user and channel modes, and performs
  * processing for the 004 mode list numeric, amongst other things.
  */
-class ModeParser : public classbase
+class CoreExport ModeParser : public classbase
 {
  private:
+       /**
+        * Creator/owner pointer
+        */
        InspIRCd* ServerInstance;
        /** Mode handlers for each mode, to access a handler subtract
         * 65 from the ascii value of the mode letter.
@@ -481,7 +498,7 @@ class ModeParser : public classbase
        std::string ChanModes();
        /** Used by this class internally during std::sort and 005 generation
         */
-       static bool PrefixComparison(const prefixtype one, const prefixtype two);
+       static bool PrefixComparison(prefixtype one, prefixtype two);
 
        /** This returns the PREFIX=(ohv)@%+ section of the 005 numeric.
         */
@@ -499,3 +516,4 @@ class ModeParser : public classbase
 };
 
 #endif
+