Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
The EntryBuffer
class contains the actual text displayed in a
Entry
widget.
A single EntryBuffer
object can be shared by multiple Entry
widgets which will then share the same text content, but not the cursor
position, visibility attributes, icon etc.
EntryBuffer
may be derived from. Such a derived class might allow
text to be stored in an alternate location, such as non-pageable memory,
useful in the case of important passwords. Or a derived class could
integrate with an application’s concept of undo/redo.
- newtype EntryBuffer = EntryBuffer (ManagedPtr EntryBuffer)
- class GObject o => IsEntryBuffer o
- toEntryBuffer :: IsEntryBuffer o => o -> IO EntryBuffer
- noEntryBuffer :: Maybe EntryBuffer
- data EntryBufferDeleteTextMethodInfo
- entryBufferDeleteText :: (HasCallStack, MonadIO m, IsEntryBuffer a) => a -> Word32 -> Int32 -> m Word32
- data EntryBufferEmitDeletedTextMethodInfo
- entryBufferEmitDeletedText :: (HasCallStack, MonadIO m, IsEntryBuffer a) => a -> Word32 -> Word32 -> m ()
- data EntryBufferEmitInsertedTextMethodInfo
- entryBufferEmitInsertedText :: (HasCallStack, MonadIO m, IsEntryBuffer a) => a -> Word32 -> Text -> Word32 -> m ()
- data EntryBufferGetBytesMethodInfo
- entryBufferGetBytes :: (HasCallStack, MonadIO m, IsEntryBuffer a) => a -> m Word64
- data EntryBufferGetLengthMethodInfo
- entryBufferGetLength :: (HasCallStack, MonadIO m, IsEntryBuffer a) => a -> m Word32
- data EntryBufferGetMaxLengthMethodInfo
- entryBufferGetMaxLength :: (HasCallStack, MonadIO m, IsEntryBuffer a) => a -> m Int32
- data EntryBufferGetTextMethodInfo
- entryBufferGetText :: (HasCallStack, MonadIO m, IsEntryBuffer a) => a -> m Text
- data EntryBufferInsertTextMethodInfo
- entryBufferInsertText :: (HasCallStack, MonadIO m, IsEntryBuffer a) => a -> Word32 -> Text -> Int32 -> m Word32
- entryBufferNew :: (HasCallStack, MonadIO m) => Maybe Text -> Int32 -> m EntryBuffer
- data EntryBufferSetMaxLengthMethodInfo
- entryBufferSetMaxLength :: (HasCallStack, MonadIO m, IsEntryBuffer a) => a -> Int32 -> m ()
- data EntryBufferSetTextMethodInfo
- entryBufferSetText :: (HasCallStack, MonadIO m, IsEntryBuffer a) => a -> Text -> Int32 -> m ()
- data EntryBufferLengthPropertyInfo
- entryBufferLength :: AttrLabelProxy "length"
- getEntryBufferLength :: (MonadIO m, IsEntryBuffer o) => o -> m Word32
- data EntryBufferMaxLengthPropertyInfo
- constructEntryBufferMaxLength :: IsEntryBuffer o => Int32 -> IO (GValueConstruct o)
- entryBufferMaxLength :: AttrLabelProxy "maxLength"
- getEntryBufferMaxLength :: (MonadIO m, IsEntryBuffer o) => o -> m Int32
- setEntryBufferMaxLength :: (MonadIO m, IsEntryBuffer o) => o -> Int32 -> m ()
- data EntryBufferTextPropertyInfo
- clearEntryBufferText :: (MonadIO m, IsEntryBuffer o) => o -> m ()
- constructEntryBufferText :: IsEntryBuffer o => Text -> IO (GValueConstruct o)
- entryBufferText :: AttrLabelProxy "text"
- getEntryBufferText :: (MonadIO m, IsEntryBuffer o) => o -> m Text
- setEntryBufferText :: (MonadIO m, IsEntryBuffer o) => o -> Text -> m ()
- type C_EntryBufferDeletedTextCallback = Ptr () -> Word32 -> Word32 -> Ptr () -> IO ()
- type EntryBufferDeletedTextCallback = Word32 -> Word32 -> IO ()
- data EntryBufferDeletedTextSignalInfo
- afterEntryBufferDeletedText :: (GObject a, MonadIO m) => a -> EntryBufferDeletedTextCallback -> m SignalHandlerId
- genClosure_EntryBufferDeletedText :: EntryBufferDeletedTextCallback -> IO Closure
- mk_EntryBufferDeletedTextCallback :: C_EntryBufferDeletedTextCallback -> IO (FunPtr C_EntryBufferDeletedTextCallback)
- noEntryBufferDeletedTextCallback :: Maybe EntryBufferDeletedTextCallback
- onEntryBufferDeletedText :: (GObject a, MonadIO m) => a -> EntryBufferDeletedTextCallback -> m SignalHandlerId
- wrap_EntryBufferDeletedTextCallback :: EntryBufferDeletedTextCallback -> Ptr () -> Word32 -> Word32 -> Ptr () -> IO ()
- type C_EntryBufferInsertedTextCallback = Ptr () -> Word32 -> CString -> Word32 -> Ptr () -> IO ()
- type EntryBufferInsertedTextCallback = Word32 -> Text -> Word32 -> IO ()
- data EntryBufferInsertedTextSignalInfo
- afterEntryBufferInsertedText :: (GObject a, MonadIO m) => a -> EntryBufferInsertedTextCallback -> m SignalHandlerId
- genClosure_EntryBufferInsertedText :: EntryBufferInsertedTextCallback -> IO Closure
- mk_EntryBufferInsertedTextCallback :: C_EntryBufferInsertedTextCallback -> IO (FunPtr C_EntryBufferInsertedTextCallback)
- noEntryBufferInsertedTextCallback :: Maybe EntryBufferInsertedTextCallback
- onEntryBufferInsertedText :: (GObject a, MonadIO m) => a -> EntryBufferInsertedTextCallback -> m SignalHandlerId
- wrap_EntryBufferInsertedTextCallback :: EntryBufferInsertedTextCallback -> Ptr () -> Word32 -> CString -> Word32 -> Ptr () -> IO ()
Exported types
newtype EntryBuffer Source #
GObject EntryBuffer Source # | |
IsObject EntryBuffer Source # | |
IsEntryBuffer EntryBuffer Source # | |
((~) * info (ResolveEntryBufferMethod t EntryBuffer), MethodInfo * info EntryBuffer p) => IsLabel t (EntryBuffer -> p) Source # | |
((~) * info (ResolveEntryBufferMethod t EntryBuffer), MethodInfo * info EntryBuffer p) => IsLabelProxy t (EntryBuffer -> p) Source # | |
HasAttributeList * EntryBuffer Source # | |
type AttributeList EntryBuffer Source # | |
type SignalList EntryBuffer Source # | |
class GObject o => IsEntryBuffer o Source #
toEntryBuffer :: IsEntryBuffer o => o -> IO EntryBuffer Source #
Methods
deleteText
data EntryBufferDeleteTextMethodInfo Source #
((~) * signature (Word32 -> Int32 -> m Word32), MonadIO m, IsEntryBuffer a) => MethodInfo * EntryBufferDeleteTextMethodInfo a signature Source # | |
entryBufferDeleteText Source #
:: (HasCallStack, MonadIO m, IsEntryBuffer a) | |
=> a |
|
-> Word32 |
|
-> Int32 |
|
-> m Word32 | Returns: The number of characters deleted. |
Deletes a sequence of characters from the buffer. nChars
characters are
deleted starting at position
. If nChars
is negative, then all characters
until the end of the text are deleted.
If position
or nChars
are out of bounds, then they are coerced to sane
values.
Note that the positions are specified in characters, not bytes.
Since: 2.18
emitDeletedText
data EntryBufferEmitDeletedTextMethodInfo Source #
((~) * signature (Word32 -> Word32 -> m ()), MonadIO m, IsEntryBuffer a) => MethodInfo * EntryBufferEmitDeletedTextMethodInfo a signature Source # | |
entryBufferEmitDeletedText Source #
:: (HasCallStack, MonadIO m, IsEntryBuffer a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Used when subclassing EntryBuffer
Since: 2.18
emitInsertedText
data EntryBufferEmitInsertedTextMethodInfo Source #
((~) * signature (Word32 -> Text -> Word32 -> m ()), MonadIO m, IsEntryBuffer a) => MethodInfo * EntryBufferEmitInsertedTextMethodInfo a signature Source # | |
entryBufferEmitInsertedText Source #
:: (HasCallStack, MonadIO m, IsEntryBuffer a) | |
=> a |
|
-> Word32 |
|
-> Text |
|
-> Word32 |
|
-> m () |
Used when subclassing EntryBuffer
Since: 2.18
getBytes
data EntryBufferGetBytesMethodInfo Source #
((~) * signature (m Word64), MonadIO m, IsEntryBuffer a) => MethodInfo * EntryBufferGetBytesMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsEntryBuffer a) | |
=> a |
|
-> m Word64 | Returns: The byte length of the buffer. |
Retrieves the length in bytes of the buffer.
See entryBufferGetLength
.
Since: 2.18
getLength
data EntryBufferGetLengthMethodInfo Source #
((~) * signature (m Word32), MonadIO m, IsEntryBuffer a) => MethodInfo * EntryBufferGetLengthMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsEntryBuffer a) | |
=> a |
|
-> m Word32 | Returns: The number of characters in the buffer. |
Retrieves the length in characters of the buffer.
Since: 2.18
getMaxLength
data EntryBufferGetMaxLengthMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsEntryBuffer a) => MethodInfo * EntryBufferGetMaxLengthMethodInfo a signature Source # | |
entryBufferGetMaxLength Source #
:: (HasCallStack, MonadIO m, IsEntryBuffer a) | |
=> a |
|
-> m Int32 | Returns: the maximum allowed number of characters
in |
Retrieves the maximum allowed length of the text in
buffer
. See entryBufferSetMaxLength
.
Since: 2.18
getText
data EntryBufferGetTextMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsEntryBuffer a) => MethodInfo * EntryBufferGetTextMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsEntryBuffer a) | |
=> a |
|
-> m Text | Returns: a pointer to the contents of the widget as a string. This string points to internally allocated storage in the buffer and must not be freed, modified or stored. |
Retrieves the contents of the buffer.
The memory pointer returned by this call will not change unless this object emits a signal, or is finalized.
Since: 2.18
insertText
data EntryBufferInsertTextMethodInfo Source #
((~) * signature (Word32 -> Text -> Int32 -> m Word32), MonadIO m, IsEntryBuffer a) => MethodInfo * EntryBufferInsertTextMethodInfo a signature Source # | |
entryBufferInsertText Source #
:: (HasCallStack, MonadIO m, IsEntryBuffer a) | |
=> a |
|
-> Word32 |
|
-> Text |
|
-> Int32 |
|
-> m Word32 | Returns: The number of characters actually inserted. |
Inserts nChars
characters of chars
into the contents of the
buffer, at position position
.
If nChars
is negative, then characters from chars will be inserted
until a null-terminator is found. If position
or nChars
are out of
bounds, or the maximum buffer text length is exceeded, then they are
coerced to sane values.
Note that the position and length are in characters, not in bytes.
Since: 2.18
new
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> Int32 |
|
-> m EntryBuffer | Returns: A new GtkEntryBuffer object. |
Create a new GtkEntryBuffer object.
Optionally, specify initial text to set in the buffer.
Since: 2.18
setMaxLength
data EntryBufferSetMaxLengthMethodInfo Source #
((~) * signature (Int32 -> m ()), MonadIO m, IsEntryBuffer a) => MethodInfo * EntryBufferSetMaxLengthMethodInfo a signature Source # | |
entryBufferSetMaxLength Source #
:: (HasCallStack, MonadIO m, IsEntryBuffer a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the maximum allowed length of the contents of the buffer. If the current contents are longer than the given length, then they will be truncated to fit.
Since: 2.18
setText
data EntryBufferSetTextMethodInfo Source #
((~) * signature (Text -> Int32 -> m ()), MonadIO m, IsEntryBuffer a) => MethodInfo * EntryBufferSetTextMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsEntryBuffer a) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> m () |
Sets the text in the buffer.
This is roughly equivalent to calling entryBufferDeleteText
and entryBufferInsertText
.
Note that nChars
is in characters, not in bytes.
Since: 2.18
Properties
length
data EntryBufferLengthPropertyInfo Source #
entryBufferLength :: AttrLabelProxy "length" Source #
getEntryBufferLength :: (MonadIO m, IsEntryBuffer o) => o -> m Word32 Source #
maxLength
data EntryBufferMaxLengthPropertyInfo Source #
constructEntryBufferMaxLength :: IsEntryBuffer o => Int32 -> IO (GValueConstruct o) Source #
entryBufferMaxLength :: AttrLabelProxy "maxLength" Source #
getEntryBufferMaxLength :: (MonadIO m, IsEntryBuffer o) => o -> m Int32 Source #
setEntryBufferMaxLength :: (MonadIO m, IsEntryBuffer o) => o -> Int32 -> m () Source #
text
data EntryBufferTextPropertyInfo Source #
clearEntryBufferText :: (MonadIO m, IsEntryBuffer o) => o -> m () Source #
constructEntryBufferText :: IsEntryBuffer o => Text -> IO (GValueConstruct o) Source #
entryBufferText :: AttrLabelProxy "text" Source #
getEntryBufferText :: (MonadIO m, IsEntryBuffer o) => o -> m Text Source #
setEntryBufferText :: (MonadIO m, IsEntryBuffer o) => o -> Text -> m () Source #
Signals
deletedText
afterEntryBufferDeletedText :: (GObject a, MonadIO m) => a -> EntryBufferDeletedTextCallback -> m SignalHandlerId Source #
mk_EntryBufferDeletedTextCallback :: C_EntryBufferDeletedTextCallback -> IO (FunPtr C_EntryBufferDeletedTextCallback) Source #
onEntryBufferDeletedText :: (GObject a, MonadIO m) => a -> EntryBufferDeletedTextCallback -> m SignalHandlerId Source #
wrap_EntryBufferDeletedTextCallback :: EntryBufferDeletedTextCallback -> Ptr () -> Word32 -> Word32 -> Ptr () -> IO () Source #
insertedText
type C_EntryBufferInsertedTextCallback = Ptr () -> Word32 -> CString -> Word32 -> Ptr () -> IO () Source #
afterEntryBufferInsertedText :: (GObject a, MonadIO m) => a -> EntryBufferInsertedTextCallback -> m SignalHandlerId Source #
mk_EntryBufferInsertedTextCallback :: C_EntryBufferInsertedTextCallback -> IO (FunPtr C_EntryBufferInsertedTextCallback) Source #
onEntryBufferInsertedText :: (GObject a, MonadIO m) => a -> EntryBufferInsertedTextCallback -> m SignalHandlerId Source #
wrap_EntryBufferInsertedTextCallback :: EntryBufferInsertedTextCallback -> Ptr () -> Word32 -> CString -> Word32 -> Ptr () -> IO () Source #