module Graphics.UI.Gtk.WebKit.WebHistoryItem (
WebHistoryItem,
WebHistoryItemClass,
webHistoryItemNew,
webHistoryItemNewWithData,
webHistoryItemTitle,
webHistoryItemAlternateTitle,
webHistoryItemUri,
webHistoryItemOriginalUri,
webHistoryItemLastVisitedTime,
webHistoryItemGetTitle,
webHistoryItemGetAlternateTitle,
webHistoryItemSetAlternateTitle,
webHistoryItemGetUri,
webHistoryItemGetOriginalUri,
webHistoryItemGetLastVisitedTime,
webHistoryItemCopy,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.GList
import System.Glib.GError
import System.Glib.Attributes
import Graphics.UI.Gtk.Gdk.Events
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.WebKit.Types
import System.Glib.GObject
webHistoryItemNew :: IO WebHistoryItem
webHistoryItemNew =
wrapNewGObject mkWebHistoryItem $ webkit_web_history_item_new
webHistoryItemNewWithData ::
GlibString string
=> string
-> string
-> IO WebHistoryItem
webHistoryItemNewWithData uri title =
withUTFString uri $ \uriPtr ->
withUTFString title $ \titlePtr ->
wrapNewGObject mkWebHistoryItem $
webkit_web_history_item_new_with_data
uriPtr
titlePtr
webHistoryItemGetTitle ::
(WebHistoryItemClass self, GlibString string) => self
-> IO (Maybe string)
webHistoryItemGetTitle webhistoryitem =
(\(WebHistoryItem arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_history_item_get_title argPtr1)
(toWebHistoryItem webhistoryitem) >>=
maybePeek peekUTFString
webHistoryItemGetAlternateTitle ::
(WebHistoryItemClass self, GlibString string) => self
-> IO (Maybe string)
webHistoryItemGetAlternateTitle webhistoryitem =
(\(WebHistoryItem arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_history_item_get_alternate_title argPtr1)
(toWebHistoryItem webhistoryitem) >>=
maybePeek peekUTFString
webHistoryItemSetAlternateTitle ::
(WebHistoryItemClass self, GlibString string) => self
-> (Maybe string)
-> IO()
webHistoryItemSetAlternateTitle webhistoryitem title =
maybeWith withUTFString title $ \titlePtr ->
(\(WebHistoryItem arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_history_item_set_alternate_title argPtr1 arg2)
(toWebHistoryItem webhistoryitem)
titlePtr
webHistoryItemGetUri ::
(WebHistoryItemClass self, GlibString string) => self
-> IO (Maybe string)
webHistoryItemGetUri webhistoryitem =
(\(WebHistoryItem arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_history_item_get_uri argPtr1)
(toWebHistoryItem webhistoryitem) >>=
maybePeek peekUTFString
webHistoryItemGetOriginalUri ::
(WebHistoryItemClass self, GlibString string) => self
-> IO (Maybe string)
webHistoryItemGetOriginalUri webhistoryitem =
(\(WebHistoryItem arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_history_item_get_original_uri argPtr1)
(toWebHistoryItem webhistoryitem) >>=
maybePeek peekUTFString
webHistoryItemGetLastVisitedTime ::
WebHistoryItemClass self => self
-> IO Double
webHistoryItemGetLastVisitedTime webhistoryitem =
liftM realToFrac $
(\(WebHistoryItem arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_history_item_get_last_visited_time argPtr1)
(toWebHistoryItem webhistoryitem)
webHistoryItemCopy :: WebHistoryItemClass self => self
-> IO WebHistoryItem
webHistoryItemCopy webhistoryitem =
makeNewGObject mkWebHistoryItem $
(\(WebHistoryItem arg1) -> withForeignPtr arg1 $ \argPtr1 ->webkit_web_history_item_copy argPtr1) (toWebHistoryItem webhistoryitem)
webHistoryItemTitle :: (WebHistoryItemClass self, GlibString string) => ReadAttr self (Maybe string)
webHistoryItemTitle = readAttr webHistoryItemGetTitle
webHistoryItemAlternateTitle :: (WebHistoryItemClass self, GlibString string) => Attr self (Maybe string)
webHistoryItemAlternateTitle = newAttr webHistoryItemGetAlternateTitle webHistoryItemSetAlternateTitle
webHistoryItemUri :: (WebHistoryItemClass self, GlibString string) => ReadAttr self (Maybe string)
webHistoryItemUri = readAttr webHistoryItemGetUri
webHistoryItemOriginalUri :: (WebHistoryItemClass self, GlibString string) => ReadAttr self (Maybe string)
webHistoryItemOriginalUri = readAttr webHistoryItemGetOriginalUri
webHistoryItemLastVisitedTime :: (WebHistoryItemClass self) => ReadAttr self Double
webHistoryItemLastVisitedTime = readAttr webHistoryItemGetLastVisitedTime
foreign import ccall safe "webkit_web_history_item_new"
webkit_web_history_item_new :: (IO (Ptr WebHistoryItem))
foreign import ccall safe "webkit_web_history_item_new_with_data"
webkit_web_history_item_new_with_data :: ((Ptr CChar) -> ((Ptr CChar) -> (IO (Ptr WebHistoryItem))))
foreign import ccall safe "webkit_web_history_item_get_title"
webkit_web_history_item_get_title :: ((Ptr WebHistoryItem) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_web_history_item_get_alternate_title"
webkit_web_history_item_get_alternate_title :: ((Ptr WebHistoryItem) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_web_history_item_set_alternate_title"
webkit_web_history_item_set_alternate_title :: ((Ptr WebHistoryItem) -> ((Ptr CChar) -> (IO ())))
foreign import ccall safe "webkit_web_history_item_get_uri"
webkit_web_history_item_get_uri :: ((Ptr WebHistoryItem) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_web_history_item_get_original_uri"
webkit_web_history_item_get_original_uri :: ((Ptr WebHistoryItem) -> (IO (Ptr CChar)))
foreign import ccall safe "webkit_web_history_item_get_last_visited_time"
webkit_web_history_item_get_last_visited_time :: ((Ptr WebHistoryItem) -> (IO CDouble))
foreign import ccall safe "webkit_web_history_item_copy"
webkit_web_history_item_copy :: ((Ptr WebHistoryItem) -> (IO (Ptr WebHistoryItem)))