-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | XChat -- -- This package adds bindings to the plugins system of XChat to Haskell. -- Refer to the README file. @package xchat-plugin @version 0.0.3 module Network.IRC.XChat.Plugin -- | The plugin descriptor data PluginDescriptor PluginDescriptor :: String -> String -> String -> PluginDescriptor pluginName :: PluginDescriptor -> String pluginDescription :: PluginDescriptor -> String pluginVersion :: PluginDescriptor -> String data XchatPlugin a -- | The type of plugins; it is associated to a memory which can be used -- and modified by the hooked callbacks. -- -- All the following functions needs a XChatPlugin as -- argument. In fact it is a handle which needs to be initialized by the -- init function, and will be freed by an optional -- deinit function. data XChatPlugin a -- | The plugin initializer. NEVER call it, it is only used by -- hsxchat. xChatPluginInit :: Ptr (XchatPlugin a) -> a -> IO (XChatPlugin a) xChatGetChanList :: XChatPlugin a -> IO [Chan] data ChanFlgs ChanFlgs :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> ChanFlgs -- | Already connected connected :: ChanFlgs -> Bool -- | Connecting in progress connecting :: ChanFlgs -> Bool -- | You are away away :: ChanFlgs -> Bool -- | Login complete logged :: ChanFlgs -> Bool -- | Has WHOX (ircu) whox :: ChanFlgs -> Bool -- | Has IDMSG (FreeNode) idmsg :: ChanFlgs -> Bool -- | Hide Join/Part messages unused flag not figuring in the ChanFlgs jPmsg :: ChanFlgs -> Bool -- | Beep on message beep :: ChanFlgs -> Bool -- | Blink tray blinkTray :: ChanFlgs -> Bool -- | Blink task bar blinkTask :: ChanFlgs -> Bool data ChanType ChanServer :: ChanType ChanChannel :: ChanType ChanDialog :: ChanType data Chan Chan :: String -> String -> XChatContext -> ChanFlgs -> Int32 -> Int32 -> Int32 -> String -> String -> String -> Int32 -> String -> ChanType -> Int32 -> Chan -- | Channel or query name cChannel :: Chan -> String -- | Channel type e.g. "#!&" cChantypes :: Chan -> String -- | Context of the channel cContext :: Chan -> XChatContext -- | Server/Channel bits cFlags :: Chan -> ChanFlgs -- | Unique server ID cId :: Chan -> Int32 -- | Lag in milliseconds cLag :: Chan -> Int32 -- | Maximum modes per line cMaxmodes :: Chan -> Int32 -- | Network name of the channel cNetwork :: Chan -> String -- | Nickname prefixes e.g. "@+" cNickprefixes :: Chan -> String -- | Nickname mod chars e.g. "ov" cNickmodes :: Chan -> String -- | Number of bytes in send-queue cQueue :: Chan -> Int32 -- | Server name of the channel cServer :: Chan -> String -- | Type of context cType :: Chan -> ChanType -- | Number of users in the channel cUsers :: Chan -> Int32 xChatGetDccList :: XChatPlugin a -> IO [Dcc] data DccStatus DccQueued :: DccStatus DccActive :: DccStatus DccFailed :: DccStatus DccDone :: DccStatus DccConnecting :: DccStatus DccAborted :: DccStatus data DccType DccSend :: DccType DccReceive :: DccType DccChatRecv :: DccType DccChatSend :: DccType data Dcc Dcc :: Int32 -> Int32 -> String -> String -> String -> Int32 -> Int32 -> Int32 -> Int64 -> DccStatus -> DccType -> Dcc -- | ipv4 address of remote user (dunno how to have ipv6) dAddress32 :: Dcc -> Int32 -- | Bytes per seconds dCps :: Dcc -> Int32 -- | Destination full pathname dDestfile :: Dcc -> String -- | File name dFile :: Dcc -> String -- | Nickname of the person who the file is from/to (Receive/Send mode) dNick :: Dcc -> String -- | TCP port number dPort :: Dcc -> Int32 -- | Bytes send/received up to now for the current transfert dPos :: Dcc -> Int32 -- | Offset of file from which it is resumed (0 if not resumed) dResume :: Dcc -> Int32 -- | File size in bytes dSize :: Dcc -> Int64 -- | Status of the DCC transfert dStatus :: Dcc -> DccStatus -- | Type of the DCC transfert dType :: Dcc -> DccType xChatGetIgnList :: XChatPlugin a -> IO [Ign] data IgnFlgs IgnFlgs :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> IgnFlgs private :: IgnFlgs -> Bool notice :: IgnFlgs -> Bool channel :: IgnFlgs -> Bool ctcp :: IgnFlgs -> Bool invite :: IgnFlgs -> Bool unIgnore :: IgnFlgs -> Bool noSave :: IgnFlgs -> Bool dcc :: IgnFlgs -> Bool data Ign Ign :: String -> IgnFlgs -> Ign -- | Ignore mask. .e.g: *!*@*.aol.com iMask :: Ign -> String -- | Flags iFlags :: Ign -> IgnFlgs xChatGetNotifyList :: XChatPlugin a -> IO [Notify] data Notify Notify :: [String] -> String -> Bool -> Int32 -> Int32 -> Int32 -> Notify -- | Networks to which this nick applies nNetworks :: Notify -> [String] -- | Nickname nNick :: Notify -> String -- | Currently on-line nOnline :: Notify -> Bool -- | Time when nick came online nOn :: Notify -> Int32 -- | Time when nick went offline nOff :: Notify -> Int32 -- | Time when nick was last seen nSeen :: Notify -> Int32 xChatGetUserList :: XChatPlugin a -> IO [User] data User User :: Bool -> Int32 -> String -> Maybe String -> String -> Maybe String -> Bool -> User -- | Away status uAway :: User -> Bool -- | Last time when user talked uLasttalk :: User -> Int32 -- | Nickname uNick :: User -> String -- | Host name, user@host uHost :: User -> Maybe String -- | e.g. @ or + uPrefix :: User -> String -- | Real name uRealname :: User -> Maybe String -- | If user belongs to the focused tab uSelected :: User -> Bool -- | The type of hooks; it has three type arguments. -- --
-- f ph cb init ---- -- means that a new XChatHook a b c -- hook using the callback cb function is created for the -- ph plugin; the hooking modifies the a -- plugin memory according to init, and returns the -- b returned by init as well as the -- created hook. -- -- The callback function itself is a function which takes some -- d data, the a plugin memory at the -- moment when the callback function is called and returns how the event -- which triggered the callback call is eaten as well as the new -- a plugin memory. type Hook a b c d = XChatPlugin a -> (d -> a -> IO (Eating, a)) -> (a -> IO (b, a)) -> IO (b, XChatHook a b c) -- | a concrete type to define the priority of a command data PriorityC -- | Highest priority (127) Highest :: PriorityC -- | High priority (64) High :: PriorityC -- | Normal priority (0) Norm :: PriorityC -- | Low priority (-64) Low :: PriorityC -- | Lowest priority (-128) Lowest :: PriorityC -- | Custom, is normalized when cast to PriorityA Custom :: Int32 -> PriorityC -- | an abstract type to define the priority of a command data PriorityA -- | to get a (normalized) abstract priority from a concrete one abstractPriority :: PriorityC -> PriorityA -- | to get a concrete priority from an abstract one concretePriority :: PriorityA -> PriorityC -- | flags for file descriptors data Flags Flags :: Bool -> Bool -> Bool -> Bool -> Flags fgRead :: Flags -> Bool fgWrite :: Flags -> Bool fgExn :: Flags -> Bool fgNsock :: Flags -> Bool -- |
-- xChatHookCommand cmd pri help ---- -- Description: -- -- Hooking to the /cmd input box command at priority -- pri with an optional help message. -- -- To capture text without a '/' at the start (non-commands), -- you may hook a special name of "" as in: -- --
-- let eatAll = Eating { eatXChat = True, eatPlugin = True }
-- startWithYou s a = xChatPrint p ("you: "++s) >> return (eatAll, a)
-- in xChatHookCommand "" Norm Nothing p startWithYou ()
--
--
-- which automatically adds "you: " at the beginning of each
-- sentence you type (and is undocumented as the help message argument is
-- Nothing).
--
-- Commands hooked that begin with a period ('.') will be hidden in
-- /HELP and /HELP -l.
--
-- Arguments:
--
-- -- xChatHookServer ev pri ---- -- Hooking to the server event ev at priority -- pri. -- -- To capture all server events, use "RAW LINE". -- -- Arguments: -- --
-- xChatHookPrint prev pri ---- -- Hooking to the print event prev at priority -- pri. -- -- Available events are those in "Advanced > Text Events" plus these -- ones: -- --
-- xChatHookTimeout timeout ---- -- Hooking to call a function every timeout milliseconds. -- -- Arguments: -- --
-- xChatHookFd fd flgs ---- -- Hooking to the file descriptor fd with flags -- flgs. The callback function is called every time the -- file descriptor is available to an action described by the flags. -- -- Arguments: -- --
-- xChatUnhook ph hook restore ---- -- Unhooking of the given hook. According to the xchat -- plugin documentation, hooks are automatically removed at deinit time. -- But you may wish for some reason to hook or unhook dynamically some -- function. There is an argument that allows you to modify the memory at -- unhook time. For example, if you have a counter, your memory could be -- a Maybe Int. When you hook, you may want to put -- it Just 0 and when you unhook to put it back to -- Nothing. -- -- Arguments: -- --
-- xChatSetContext ph ctx ---- -- Changes the current context. -- -- Arguments: -- --
-- xChatFindContext ph servname channel ---- -- Finds a context based on a channel and servername. -- -- If servname is Nothing, it finds the -- channel (or query) by the given name in the same server group as the -- current context. If that doesn't exists then find any by the given -- name. -- -- If channel is Nothing, it finds the front-most -- tab/window of the given servname. -- -- Arguments: -- --
-- xChatGetContext ph ---- -- Get the current context. -- -- Arguments: -- --
-- xChatPrint ph text ---- -- Displays some text in the xchat window. -- -- Arguments: -- --
-- xChatCommand ph cmd ---- -- Executes a command as if it were typed in xchat's input box. -- -- Arguments: -- --
-- xChatNickcmp ph s1 s2 ---- -- Performs a nick name comparision, based on the current server -- connection. This might be a RFC1459 compliant string compare, or plain -- ascii (in the case of DALNet). Use this to compare channels and -- nicknames. The function works the same way as strcasecmp. -- -- Quote from RFC1459: -- -- Because of IRC's scandanavian origin, the characters {}| are -- considered to be the lower case equivalents of the characters []\, -- respectively. This is a critical issue when determining the -- equivalence of two nicknames. -- -- Arguments: -- --
-- xChatGetPrefs ph pref ---- -- Provides xchat's setting information (that which is available through -- the "/set" command). A few extra bits of information are available -- that don't appear in the "/set list", currently they are: -- --
-- xChatGetInfo ph info ---- -- Returns information based on your current context. -- -- Arguments: -- --
-- xChatEmitPrint ph ev args ---- -- Generates a print event. This can be any event found in the -- Preferences > Advanced > Text Events window. The -- args are the arguments of the event. Special care -- should be taken when calling this function inside a print callback -- (from xChatHookPrint), as not to cause endless -- recursion. -- -- Arguments: -- --
-- xChatEmitPrint "Channel Message" ["John", "Hi there", "@"] --xChatEmitPrint :: XChatPlugin a -> String -> [String] -> IO Bool -- | Description: -- -- xChatSendModes ph str_list mpl -- sgn mode Sends a number of channel mode changes to -- the current channel. For example, you can Op a whole group of people -- in one go. It may send multiple MODE lines if the request doesn't fit -- on one. Pass Nothing for mpl to use the current -- server's maximum possible. This function should only be called while -- in a channel context. -- -- Arguments: -- --
-- xChatSendModes "Alice":"Bob":[] 3 True 'o' --xChatSendModes :: XChatPlugin a -> [String] -> Maybe Int32 -> Bool -> Char -> IO () -- | flags on how to strip rules data StripRules StripRules :: Bool -> Bool -> StripRules noColor :: StripRules -> Bool noAttribute :: StripRules -> Bool -- | Description: -- --
-- xChatStrip str rules ---- -- Strips mIRC color codes and/or text attributes (bold, underlined etc) -- from the given string and returns a new string. The original function -- had an unused plugin handle. -- -- Arguments: -- --
-- xChatPluginguiAdd ph filename pdesc ---- -- Add of a new GUI plugin to the list of the current plugins. Due to -- lack of documentation, it is not further documented. In the original -- source code, such added plugins are tagged 'fake'. It seems that -- beside their name, file name, version, description and position in the -- list, there is no memory allocation. Furthermore, the original code -- had an extra unused argument. -- -- Arguments: -- --
-- xChatPluginguiRemove ph ---- -- The counterpart of xChatPluginguiAdd function. So it -- is used to remove 'fake' plugins. Once again, one of the arguments is -- unused in the original source code, so I removed it. -- -- Arguments: -- --
-- xChatGettext str ---- -- Converts a string to its internal XChat representation. I -- automatically free it to avoid memory leak, although as I don't know -- what it really does, it may be a bad idea. The original code had an -- unused plugin handle. -- -- Arguments: -- --