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/osx/private.h"
17 // common interface for all implementations
18 class wxMacTextControl
: public wxMacControl
21 wxMacTextControl( wxTextCtrl
*peer
) ;
22 virtual ~wxMacTextControl() ;
24 virtual bool CanFocus() const { return true; }
26 virtual wxString
GetStringValue() const = 0 ;
27 virtual void SetStringValue( const wxString
&val
) = 0 ;
28 virtual void SetSelection( long from
, long to
) = 0 ;
29 virtual void GetSelection( long* from
, long* to
) const = 0 ;
30 virtual void WriteText( const wxString
& str
) = 0 ;
32 virtual void SetStyle( long start
, long end
, const wxTextAttr
& style
) ;
35 virtual void Paste() ;
36 virtual bool CanPaste() const ;
37 virtual void SetEditable( bool editable
) ;
38 virtual wxTextPos
GetLastPosition() const ;
39 virtual void Replace( long from
, long to
, const wxString
&str
) ;
40 virtual void Remove( long from
, long to
) ;
43 virtual bool HasOwnContextMenu() const
46 virtual bool SetupCursor( const wxPoint
& WXUNUSED(pt
) )
49 virtual void Clear() ;
50 virtual bool CanUndo() const;
52 virtual bool CanRedo() const;
54 virtual int GetNumberOfLines() const ;
55 virtual long XYToPosition(long x
, long y
) const;
56 virtual bool PositionToXY(long pos
, long *x
, long *y
) const ;
57 virtual void ShowPosition(long WXUNUSED(pos
)) ;
58 virtual int GetLineLength(long lineNo
) const ;
59 virtual wxString
GetLineText(long lineNo
) const ;
60 virtual void CheckSpelling(bool WXUNUSED(check
)) { }
61 virtual void SetFont( const wxFont
& font
, const wxColour
& foreground
, long windowStyle
);
64 class wxMacUnicodeTextControl
: public wxMacTextControl
67 wxMacUnicodeTextControl( wxTextCtrl
*wxPeer
) ;
68 wxMacUnicodeTextControl( wxTextCtrl
*wxPeer
,
71 const wxSize
& size
, long style
) ;
72 virtual ~wxMacUnicodeTextControl();
74 virtual bool Create( wxTextCtrl
*wxPeer
,
77 const wxSize
& size
, long style
) ;
78 virtual void VisibilityChanged(bool shown
);
79 virtual wxString
GetStringValue() const ;
80 virtual void SetStringValue( const wxString
&str
) ;
84 virtual bool CanPaste() const;
85 virtual void SetEditable(bool editable
) ;
86 virtual void GetSelection( long* from
, long* to
) const ;
87 virtual void SetSelection( long from
, long to
) ;
88 virtual void WriteText(const wxString
& str
) ;
91 virtual void CreateControl( wxTextCtrl
* peer
, const Rect
* bounds
, CFStringRef cfr
);
93 // contains the tag for the content (is different for password and non-password controls)
96 ControlEditTextSelectionRec m_selection
;
99 #endif // _WX_MAC_PRIVATE_MACTEXT_H_