]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/carbon/private/mactext.h
OSX reshuffling
[wxWidgets.git] / include / wx / osx / 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/osx/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 bool CanFocus() const { return true; }
25
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 ;
31
32 virtual void SetStyle( long start, long end, const wxTextAttr& style ) ;
33 virtual void Copy() ;
34 virtual void Cut() ;
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 ) ;
41
42
43 virtual bool HasOwnContextMenu() const
44 { return false ; }
45
46 virtual bool SetupCursor( const wxPoint& WXUNUSED(pt) )
47 { return false ; }
48
49 virtual void Clear() ;
50 virtual bool CanUndo() const;
51 virtual void Undo() ;
52 virtual bool CanRedo() const;
53 virtual void Redo() ;
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 );
62 } ;
63
64 class wxMacUnicodeTextControl : public wxMacTextControl
65 {
66 public :
67 wxMacUnicodeTextControl( wxTextCtrl *wxPeer ) ;
68 wxMacUnicodeTextControl( wxTextCtrl *wxPeer,
69 const wxString& str,
70 const wxPoint& pos,
71 const wxSize& size, long style ) ;
72 virtual ~wxMacUnicodeTextControl();
73
74 virtual bool Create( wxTextCtrl *wxPeer,
75 const wxString& str,
76 const wxPoint& pos,
77 const wxSize& size, long style ) ;
78 virtual void VisibilityChanged(bool shown);
79 virtual wxString GetStringValue() const ;
80 virtual void SetStringValue( const wxString &str) ;
81 virtual void Copy();
82 virtual void Cut();
83 virtual void Paste();
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) ;
89
90 protected :
91 virtual void CreateControl( wxTextCtrl* peer, const Rect* bounds, CFStringRef cfr );
92
93 // contains the tag for the content (is different for password and non-password controls)
94 OSType m_valueTag ;
95 public :
96 ControlEditTextSelectionRec m_selection ;
97 };
98
99 #endif // _WX_MAC_PRIVATE_MACTEXT_H_