#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Poppler.Objects.AnnotText
(
AnnotText(..) ,
IsAnnotText ,
toAnnotText ,
noAnnotText ,
#if ENABLE_OVERLOADING
AnnotTextGetIconMethodInfo ,
#endif
annotTextGetIcon ,
#if ENABLE_OVERLOADING
AnnotTextGetIsOpenMethodInfo ,
#endif
annotTextGetIsOpen ,
#if ENABLE_OVERLOADING
AnnotTextGetStateMethodInfo ,
#endif
annotTextGetState ,
annotTextNew ,
#if ENABLE_OVERLOADING
AnnotTextSetIconMethodInfo ,
#endif
annotTextSetIcon ,
#if ENABLE_OVERLOADING
AnnotTextSetIsOpenMethodInfo ,
#endif
annotTextSetIsOpen ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Poppler.Enums as Poppler.Enums
import {-# SOURCE #-} qualified GI.Poppler.Objects.Annot as Poppler.Annot
import {-# SOURCE #-} qualified GI.Poppler.Objects.AnnotMarkup as Poppler.AnnotMarkup
import {-# SOURCE #-} qualified GI.Poppler.Objects.Document as Poppler.Document
import {-# SOURCE #-} qualified GI.Poppler.Structs.Rectangle as Poppler.Rectangle
newtype AnnotText = AnnotText (ManagedPtr AnnotText)
foreign import ccall "poppler_annot_text_get_type"
c_poppler_annot_text_get_type :: IO GType
instance GObject AnnotText where
gobjectType = c_poppler_annot_text_get_type
class (GObject o, O.IsDescendantOf AnnotText o) => IsAnnotText o
instance (GObject o, O.IsDescendantOf AnnotText o) => IsAnnotText o
instance O.HasParentTypes AnnotText
type instance O.ParentTypes AnnotText = '[Poppler.AnnotMarkup.AnnotMarkup, Poppler.Annot.Annot, GObject.Object.Object]
toAnnotText :: (MonadIO m, IsAnnotText o) => o -> m AnnotText
toAnnotText = liftIO . unsafeCastTo AnnotText
noAnnotText :: Maybe AnnotText
noAnnotText = Nothing
#if ENABLE_OVERLOADING
type family ResolveAnnotTextMethod (t :: Symbol) (o :: *) :: * where
ResolveAnnotTextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAnnotTextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAnnotTextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAnnotTextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAnnotTextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAnnotTextMethod "hasPopup" o = Poppler.AnnotMarkup.AnnotMarkupHasPopupMethodInfo
ResolveAnnotTextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAnnotTextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAnnotTextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAnnotTextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAnnotTextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAnnotTextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAnnotTextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAnnotTextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAnnotTextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAnnotTextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAnnotTextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAnnotTextMethod "getAnnotType" o = Poppler.Annot.AnnotGetAnnotTypeMethodInfo
ResolveAnnotTextMethod "getColor" o = Poppler.Annot.AnnotGetColorMethodInfo
ResolveAnnotTextMethod "getContents" o = Poppler.Annot.AnnotGetContentsMethodInfo
ResolveAnnotTextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAnnotTextMethod "getDate" o = Poppler.AnnotMarkup.AnnotMarkupGetDateMethodInfo
ResolveAnnotTextMethod "getExternalData" o = Poppler.AnnotMarkup.AnnotMarkupGetExternalDataMethodInfo
ResolveAnnotTextMethod "getFlags" o = Poppler.Annot.AnnotGetFlagsMethodInfo
ResolveAnnotTextMethod "getIcon" o = AnnotTextGetIconMethodInfo
ResolveAnnotTextMethod "getIsOpen" o = AnnotTextGetIsOpenMethodInfo
ResolveAnnotTextMethod "getLabel" o = Poppler.AnnotMarkup.AnnotMarkupGetLabelMethodInfo
ResolveAnnotTextMethod "getModified" o = Poppler.Annot.AnnotGetModifiedMethodInfo
ResolveAnnotTextMethod "getName" o = Poppler.Annot.AnnotGetNameMethodInfo
ResolveAnnotTextMethod "getOpacity" o = Poppler.AnnotMarkup.AnnotMarkupGetOpacityMethodInfo
ResolveAnnotTextMethod "getPageIndex" o = Poppler.Annot.AnnotGetPageIndexMethodInfo
ResolveAnnotTextMethod "getPopupIsOpen" o = Poppler.AnnotMarkup.AnnotMarkupGetPopupIsOpenMethodInfo
ResolveAnnotTextMethod "getPopupRectangle" o = Poppler.AnnotMarkup.AnnotMarkupGetPopupRectangleMethodInfo
ResolveAnnotTextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAnnotTextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAnnotTextMethod "getRectangle" o = Poppler.Annot.AnnotGetRectangleMethodInfo
ResolveAnnotTextMethod "getReplyTo" o = Poppler.AnnotMarkup.AnnotMarkupGetReplyToMethodInfo
ResolveAnnotTextMethod "getState" o = AnnotTextGetStateMethodInfo
ResolveAnnotTextMethod "getSubject" o = Poppler.AnnotMarkup.AnnotMarkupGetSubjectMethodInfo
ResolveAnnotTextMethod "setColor" o = Poppler.Annot.AnnotSetColorMethodInfo
ResolveAnnotTextMethod "setContents" o = Poppler.Annot.AnnotSetContentsMethodInfo
ResolveAnnotTextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAnnotTextMethod "setFlags" o = Poppler.Annot.AnnotSetFlagsMethodInfo
ResolveAnnotTextMethod "setIcon" o = AnnotTextSetIconMethodInfo
ResolveAnnotTextMethod "setIsOpen" o = AnnotTextSetIsOpenMethodInfo
ResolveAnnotTextMethod "setLabel" o = Poppler.AnnotMarkup.AnnotMarkupSetLabelMethodInfo
ResolveAnnotTextMethod "setOpacity" o = Poppler.AnnotMarkup.AnnotMarkupSetOpacityMethodInfo
ResolveAnnotTextMethod "setPopup" o = Poppler.AnnotMarkup.AnnotMarkupSetPopupMethodInfo
ResolveAnnotTextMethod "setPopupIsOpen" o = Poppler.AnnotMarkup.AnnotMarkupSetPopupIsOpenMethodInfo
ResolveAnnotTextMethod "setPopupRectangle" o = Poppler.AnnotMarkup.AnnotMarkupSetPopupRectangleMethodInfo
ResolveAnnotTextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAnnotTextMethod "setRectangle" o = Poppler.Annot.AnnotSetRectangleMethodInfo
ResolveAnnotTextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAnnotTextMethod t AnnotText, O.MethodInfo info AnnotText p) => OL.IsLabel t (AnnotText -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList AnnotText
type instance O.AttributeList AnnotText = AnnotTextAttributeList
type AnnotTextAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList AnnotText = AnnotTextSignalList
type AnnotTextSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "poppler_annot_text_new" poppler_annot_text_new ::
Ptr Poppler.Document.Document ->
Ptr Poppler.Rectangle.Rectangle ->
IO (Ptr AnnotText)
annotTextNew ::
(B.CallStack.HasCallStack, MonadIO m, Poppler.Document.IsDocument a) =>
a
-> Poppler.Rectangle.Rectangle
-> m AnnotText
annotTextNew doc rect = liftIO $ do
doc' <- unsafeManagedPtrCastPtr doc
rect' <- unsafeManagedPtrGetPtr rect
result <- poppler_annot_text_new doc' rect'
checkUnexpectedReturnNULL "annotTextNew" result
result' <- (wrapObject AnnotText) result
touchManagedPtr doc
touchManagedPtr rect
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "poppler_annot_text_get_icon" poppler_annot_text_get_icon ::
Ptr AnnotText ->
IO CString
annotTextGetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotText a) =>
a
-> m T.Text
annotTextGetIcon popplerAnnot = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
result <- poppler_annot_text_get_icon popplerAnnot'
checkUnexpectedReturnNULL "annotTextGetIcon" result
result' <- cstringToText result
freeMem result
touchManagedPtr popplerAnnot
return result'
#if ENABLE_OVERLOADING
data AnnotTextGetIconMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAnnotText a) => O.MethodInfo AnnotTextGetIconMethodInfo a signature where
overloadedMethod _ = annotTextGetIcon
#endif
foreign import ccall "poppler_annot_text_get_is_open" poppler_annot_text_get_is_open ::
Ptr AnnotText ->
IO CInt
annotTextGetIsOpen ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotText a) =>
a
-> m Bool
annotTextGetIsOpen popplerAnnot = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
result <- poppler_annot_text_get_is_open popplerAnnot'
let result' = (/= 0) result
touchManagedPtr popplerAnnot
return result'
#if ENABLE_OVERLOADING
data AnnotTextGetIsOpenMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAnnotText a) => O.MethodInfo AnnotTextGetIsOpenMethodInfo a signature where
overloadedMethod _ = annotTextGetIsOpen
#endif
foreign import ccall "poppler_annot_text_get_state" poppler_annot_text_get_state ::
Ptr AnnotText ->
IO CUInt
annotTextGetState ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotText a) =>
a
-> m Poppler.Enums.AnnotTextState
annotTextGetState popplerAnnot = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
result <- poppler_annot_text_get_state popplerAnnot'
let result' = (toEnum . fromIntegral) result
touchManagedPtr popplerAnnot
return result'
#if ENABLE_OVERLOADING
data AnnotTextGetStateMethodInfo
instance (signature ~ (m Poppler.Enums.AnnotTextState), MonadIO m, IsAnnotText a) => O.MethodInfo AnnotTextGetStateMethodInfo a signature where
overloadedMethod _ = annotTextGetState
#endif
foreign import ccall "poppler_annot_text_set_icon" poppler_annot_text_set_icon ::
Ptr AnnotText ->
CString ->
IO ()
annotTextSetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotText a) =>
a
-> T.Text
-> m ()
annotTextSetIcon popplerAnnot icon = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
icon' <- textToCString icon
poppler_annot_text_set_icon popplerAnnot' icon'
touchManagedPtr popplerAnnot
freeMem icon'
return ()
#if ENABLE_OVERLOADING
data AnnotTextSetIconMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAnnotText a) => O.MethodInfo AnnotTextSetIconMethodInfo a signature where
overloadedMethod _ = annotTextSetIcon
#endif
foreign import ccall "poppler_annot_text_set_is_open" poppler_annot_text_set_is_open ::
Ptr AnnotText ->
CInt ->
IO ()
annotTextSetIsOpen ::
(B.CallStack.HasCallStack, MonadIO m, IsAnnotText a) =>
a
-> Bool
-> m ()
annotTextSetIsOpen popplerAnnot isOpen = liftIO $ do
popplerAnnot' <- unsafeManagedPtrCastPtr popplerAnnot
let isOpen' = (fromIntegral . fromEnum) isOpen
poppler_annot_text_set_is_open popplerAnnot' isOpen'
touchManagedPtr popplerAnnot
return ()
#if ENABLE_OVERLOADING
data AnnotTextSetIsOpenMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsAnnotText a) => O.MethodInfo AnnotTextSetIsOpenMethodInfo a signature where
overloadedMethod _ = annotTextSetIsOpen
#endif