1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: private wxMacTextControl base class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MAC_PRIVATE_MACTEXT_H_
13 #define _WX_MAC_PRIVATE_MACTEXT_H_
15 #include "wx/mac/private.h"
17 // common interface for all implementations
18 class wxMacTextControl
: public wxMacControl
21 wxMacTextControl( wxTextCtrl
*peer
) ;
22 virtual ~wxMacTextControl() ;
24 virtual wxString
GetStringValue() const = 0 ;
25 virtual void SetStringValue( const wxString
&val
) = 0 ;
26 virtual void SetSelection( long from
, long to
) = 0 ;
27 virtual void GetSelection( long* from
, long* to
) const = 0 ;
28 virtual void WriteText( const wxString
& str
) = 0 ;
30 virtual void SetStyle( long start
, long end
, const wxTextAttr
& style
) ;
33 virtual void Paste() ;
34 virtual bool CanPaste() const ;
35 virtual void SetEditable( bool editable
) ;
36 virtual wxTextPos
GetLastPosition() const ;
37 virtual void Replace( long from
, long to
, const wxString
&str
) ;
38 virtual void Remove( long from
, long to
) ;
41 virtual bool HasOwnContextMenu() const
44 virtual bool SetupCursor( const wxPoint
& WXUNUSED(pt
) )
47 virtual void Clear() ;
48 virtual bool CanUndo() const;
50 virtual bool CanRedo() const;
52 virtual int GetNumberOfLines() const ;
53 virtual long XYToPosition(long x
, long y
) const;
54 virtual bool PositionToXY(long pos
, long *x
, long *y
) const ;
55 virtual void ShowPosition(long WXUNUSED(pos
)) ;
56 virtual int GetLineLength(long lineNo
) const ;
57 virtual wxString
GetLineText(long lineNo
) const ;
58 virtual void CheckSpelling(bool WXUNUSED(check
)) { }
59 virtual void SetFont( const wxFont
& font
, const wxColour
& foreground
, long windowStyle
);
62 class wxMacUnicodeTextControl
: public wxMacTextControl
65 wxMacUnicodeTextControl( wxTextCtrl
*wxPeer
) ;
66 wxMacUnicodeTextControl( wxTextCtrl
*wxPeer
,
69 const wxSize
& size
, long style
) ;
70 virtual ~wxMacUnicodeTextControl();
72 virtual bool Create( wxTextCtrl
*wxPeer
,
75 const wxSize
& size
, long style
) ;
76 virtual void VisibilityChanged(bool shown
);
77 virtual wxString
GetStringValue() const ;
78 virtual void SetStringValue( const wxString
&str
) ;
82 virtual bool CanPaste() const;
83 virtual void SetEditable(bool editable
) ;
84 virtual void GetSelection( long* from
, long* to
) const ;
85 virtual void SetSelection( long from
, long to
) ;
86 virtual void WriteText(const wxString
& str
) ;
89 virtual void CreateControl( wxTextCtrl
* peer
, const Rect
* bounds
, CFStringRef cfr
);
91 // contains the tag for the content (is different for password and non-password controls)
94 ControlEditTextSelectionRec m_selection
;
97 #endif // _WX_MAC_PRIVATE_MACTEXT_H_