]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/private/mactext.h
changing to wxDC, so that wxGCDC can be used as well
[wxWidgets.git] / include / wx / mac / carbon / private / mactext.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: mactext.h
3 // Purpose: private wxMacTextControl base class
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 03/02/99
7 // RCS-ID: $Id:
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_MAC_PRIVATE_MACTEXT_H_
13 #define _WX_MAC_PRIVATE_MACTEXT_H_
14
15 #include "wx/mac/private.h"
16
17 // common interface for all implementations
18 class wxMacTextControl : public wxMacControl
19 {
20 public :
21 wxMacTextControl( wxTextCtrl *peer ) ;
22 virtual ~wxMacTextControl() ;
23
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 ;
29
30 virtual void SetStyle( long start, long end, const wxTextAttr& style ) ;
31 virtual void Copy() ;
32 virtual void Cut() ;
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 ) ;
39
40
41 virtual bool HasOwnContextMenu() const
42 { return false ; }
43
44 virtual bool SetupCursor( const wxPoint& WXUNUSED(pt) )
45 { return false ; }
46
47 virtual void Clear() ;
48 virtual bool CanUndo() const;
49 virtual void Undo() ;
50 virtual bool CanRedo() const;
51 virtual void Redo() ;
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
60 } ;
61
62 class wxMacUnicodeTextControl : public wxMacTextControl
63 {
64 public :
65 wxMacUnicodeTextControl( wxTextCtrl *wxPeer ) ;
66 wxMacUnicodeTextControl( wxTextCtrl *wxPeer,
67 const wxString& str,
68 const wxPoint& pos,
69 const wxSize& size, long style ) ;
70 virtual ~wxMacUnicodeTextControl();
71
72 virtual bool Create( wxTextCtrl *wxPeer,
73 const wxString& str,
74 const wxPoint& pos,
75 const wxSize& size, long style ) ;
76 virtual void VisibilityChanged(bool shown);
77 virtual wxString GetStringValue() const ;
78 virtual void SetStringValue( const wxString &str) ;
79 virtual void Copy();
80 virtual void Cut();
81 virtual void Paste();
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) ;
87
88 protected :
89 virtual void CreateControl( wxTextCtrl* peer, const Rect* bounds, CFStringRef cfr );
90
91 // contains the tag for the content (is different for password and non-password controls)
92 OSType m_valueTag ;
93 public :
94 ControlEditTextSelectionRec m_selection ;
95 };
96
97 #endif // _WX_MAC_PRIVATE_MACTEXT_H_