JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
JXTextSelection Class Reference

#include <JXTextSelection.h>

Inheritance diagram for JXTextSelection:
[legend]

Public Member Functions

 JXTextSelection (JXDisplay *display, const JString &text, const JRunArray< JFont > *style=nullptr)
 
 JXTextSelection (JXDisplay *display, JString *text, JRunArray< JFont > *style=nullptr)
 
 JXTextSelection (JXDisplay *display, const JPtrArray< JString > &list)
 
 JXTextSelection (JXWidget *widget, const JUtf8Byte *id)
 
 ~JXTextSelection () override
 
bool GetText (const JString **text) const
 
bool GetStyle (const JRunArray< JFont > **style) const
 
bool GetTextEditor (JTextEditor **te) const
 
void SetData (const JString &text, const JRunArray< JFont > *style=nullptr)
 
void SetData (JString *text, JRunArray< JFont > *style)
 
void SetData (const JPtrArray< JString > &list)
 
void SetTextEditor (JTextEditor *te, const JCharacterRange &selection)
 
- Public Member Functions inherited from JXSelectionData
 JXSelectionData (JXDisplay *display)
 
 JXSelectionData (JXWidget *widget, const JUtf8Byte *id)
 
 ~JXSelectionData () override
 
JXDisplayGetDisplay () const
 
JXSelectionManagerGetSelectionManager () const
 
JXDNDManagerGetDNDManager () const
 
Atom GetDNDSelectionName () const
 
Atom GetSelectionName () const
 
Time GetStartTime () const
 
bool IsCurrent () const
 
bool GetEndTime (Time *t) const
 
void SetSelectionInfo (const Atom selectionName, const Time startTime)
 
void SetEndTime (const Time endTime)
 
const JArray< Atom > & GetTypeList () const
 
void Resolve () const
 
bool Convert (const Atom requestType, Atom *returnType, unsigned char **data, JSize *dataLength, JSize *bitsPerBlock) const
 
- Public Member Functions inherited from JBroadcaster
 JBroadcaster ()
 
virtual ~JBroadcaster ()
 
JBroadcasteroperator= (const JBroadcaster &source)
 
bool HasSenders () const
 
JSize GetSenderCount () const
 
bool HasRecipients () const
 
JSize GetRecipientCount () const
 
virtual JString ToString () const
 
template<class T >
void ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f)
 

Static Public Member Functions

static const JUtf8ByteGetStyledText0XAtomName ()
 

Protected Member Functions

void AddTypes (const Atom selectionName) override
 
bool ConvertData (const Atom requestType, Atom *returnType, unsigned char **data, JSize *dataLength, JSize *bitsPerBlock) const override
 
- Protected Member Functions inherited from JXSelectionData
Atom AddType (const JUtf8Byte *name)
 
void AddType (const Atom type)
 
void RemoveType (const Atom type)
 
void ReceiveGoingAway (JBroadcaster *sender) override
 
- Protected Member Functions inherited from JBroadcaster
 JBroadcaster (const JBroadcaster &source)
 
void ListenTo (const JBroadcaster *sender)
 
void StopListening (const JBroadcaster *sender)
 
void ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember)
 
void StopListening (const JBroadcaster *sender, const std::type_info &messageType)
 
template<class T >
void Send (JBroadcaster *recipient, const T &message)
 
template<class T >
void Broadcast (const T &message)
 
virtual void Receive (JBroadcaster *sender, const Message &message)
 
void SendWithFeedback (JBroadcaster *recipient, Message *message)
 
void BroadcastWithFeedback (Message *message)
 
virtual void ReceiveWithFeedback (JBroadcaster *sender, Message *message)
 

Detailed Description

text/plain, text/x-jxstyled0 for all, and STRING, TEXT for all but DND.
DELETE is supported if a JTextEditor is provided.

Constructor & Destructor Documentation

◆ JXTextSelection() [1/4]

JXTextSelection::JXTextSelection ( JXDisplay display,
const JString text,
const JRunArray< JFont > *  style = nullptr 
)

◆ JXTextSelection() [2/4]

JXTextSelection::JXTextSelection ( JXDisplay display,
JString text,
JRunArray< JFont > *  style = nullptr 
)

◆ JXTextSelection() [3/4]

JXTextSelection::JXTextSelection ( JXDisplay display,
const JPtrArray< JString > &  list 
)

◆ JXTextSelection() [4/4]

JXTextSelection::JXTextSelection ( JXWidget widget,
const JUtf8Byte id 
)

◆ ~JXTextSelection()

JXTextSelection::~JXTextSelection ( )
override

Member Function Documentation

◆ AddTypes()

void JXTextSelection::AddTypes ( const Atom  selectionName)
overrideprotectedvirtual

Implements JXSelectionData.

◆ ConvertData()

bool JXTextSelection::ConvertData ( const Atom  requestType,
Atom *  returnType,
unsigned char **  data,
JSize dataLength,
JSize bitsPerBlock 
) const
overrideprotectedvirtual

Implements JXSelectionData.

◆ GetStyle()

bool JXTextSelection::GetStyle ( const JRunArray< JFont > **  style) const
inline

◆ GetStyledText0XAtomName()

const JUtf8Byte * JXTextSelection::GetStyledText0XAtomName ( )
static

◆ GetText()

bool JXTextSelection::GetText ( const JString **  text) const
inline

◆ GetTextEditor()

bool JXTextSelection::GetTextEditor ( JTextEditor **  te) const
inline

◆ SetData() [1/3]

void JXTextSelection::SetData ( const JPtrArray< JString > &  list)

If there is a single string, this becomes the text. If there are multiple strings, they are separated with newlines.

◆ SetData() [2/3]

void JXTextSelection::SetData ( const JString text,
const JRunArray< JFont > *  style = nullptr 
)

Makes a copy of text and style.

colormap and style can be nullptr. If style != nullptr, colormap must not be nullptr.

◆ SetData() [3/3]

void JXTextSelection::SetData ( JString text,
JRunArray< JFont > *  style 
)

Takes ownership of text and style.

colormap and style can be nullptr. If style != nullptr, colormap must not be nullptr.

◆ SetTextEditor()

void JXTextSelection::SetTextEditor ( JTextEditor te,
const JCharacterRange selection 
)

Call this to support DELETE.


The documentation for this class was generated from the following files: