]> git.saurik.com Git - wxWidgets.git/blame - include/wx/osx/carbon/private/mactext.h
implement support for custom button labels in wxMessageBox under MSW; refactor the...
[wxWidgets.git] / include / wx / osx / carbon / private / mactext.h
CommitLineData
5c6eb3a8
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: mactext.h
3// Purpose: private wxMacTextControl base class
4// Author: Stefan Csomor
5// Modified by:
6// Created: 03/02/99
2c6dbc21 7// RCS-ID: $Id:
5c6eb3a8
SC
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
ef0e9220 15#include "wx/osx/private.h"
5c6eb3a8
SC
16
17// common interface for all implementations
524c47aa
SC
18class wxMacTextControl :
19#if wxOSX_USE_CARBON
20 public wxMacControl
21#else
22 public wxWidgetCocoaImpl
23#endif
5c6eb3a8
SC
24{
25public :
524c47aa 26#if wxOSX_USE_CARBON
5c6eb3a8 27 wxMacTextControl( wxTextCtrl *peer ) ;
524c47aa
SC
28#else
29 wxMacTextControl::wxMacTextControl(wxTextCtrl* peer, WXWidget w) ;
30#endif
5c6eb3a8
SC
31 virtual ~wxMacTextControl() ;
32
41e5097c
SC
33 virtual bool CanFocus() const { return true; }
34
5c6eb3a8
SC
35 virtual wxString GetStringValue() const = 0 ;
36 virtual void SetStringValue( const wxString &val ) = 0 ;
37 virtual void SetSelection( long from, long to ) = 0 ;
38 virtual void GetSelection( long* from, long* to ) const = 0 ;
39 virtual void WriteText( const wxString& str ) = 0 ;
40
41 virtual void SetStyle( long start, long end, const wxTextAttr& style ) ;
42 virtual void Copy() ;
43 virtual void Cut() ;
44 virtual void Paste() ;
45 virtual bool CanPaste() const ;
46 virtual void SetEditable( bool editable ) ;
47 virtual wxTextPos GetLastPosition() const ;
48 virtual void Replace( long from, long to, const wxString &str ) ;
49 virtual void Remove( long from, long to ) ;
50
51
52 virtual bool HasOwnContextMenu() const
53 { return false ; }
54
55 virtual bool SetupCursor( const wxPoint& WXUNUSED(pt) )
56 { return false ; }
57
58 virtual void Clear() ;
59 virtual bool CanUndo() const;
60 virtual void Undo() ;
61 virtual bool CanRedo() const;
62 virtual void Redo() ;
63 virtual int GetNumberOfLines() const ;
64 virtual long XYToPosition(long x, long y) const;
65 virtual bool PositionToXY(long pos, long *x, long *y) const ;
66 virtual void ShowPosition(long WXUNUSED(pos)) ;
67 virtual int GetLineLength(long lineNo) const ;
68 virtual wxString GetLineText(long lineNo) const ;
69 virtual void CheckSpelling(bool WXUNUSED(check)) { }
2c6dbc21
VZ
70 virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle );
71};
5c6eb3a8 72
524c47aa 73#if wxOSX_USE_CARBON
5c6eb3a8
SC
74class wxMacUnicodeTextControl : public wxMacTextControl
75{
76public :
77 wxMacUnicodeTextControl( wxTextCtrl *wxPeer ) ;
78 wxMacUnicodeTextControl( wxTextCtrl *wxPeer,
79 const wxString& str,
80 const wxPoint& pos,
81 const wxSize& size, long style ) ;
82 virtual ~wxMacUnicodeTextControl();
83
84 virtual bool Create( wxTextCtrl *wxPeer,
85 const wxString& str,
86 const wxPoint& pos,
87 const wxSize& size, long style ) ;
88 virtual void VisibilityChanged(bool shown);
89 virtual wxString GetStringValue() const ;
90 virtual void SetStringValue( const wxString &str) ;
91 virtual void Copy();
92 virtual void Cut();
93 virtual void Paste();
94 virtual bool CanPaste() const;
95 virtual void SetEditable(bool editable) ;
96 virtual void GetSelection( long* from, long* to) const ;
97 virtual void SetSelection( long from , long to ) ;
98 virtual void WriteText(const wxString& str) ;
99
100protected :
2c6dbc21 101 virtual void CreateControl( wxTextCtrl* peer, const Rect* bounds, CFStringRef cfr );
5c6eb3a8
SC
102
103 // contains the tag for the content (is different for password and non-password controls)
104 OSType m_valueTag ;
105public :
106 ControlEditTextSelectionRec m_selection ;
107};
524c47aa 108#endif
5c6eb3a8
SC
109
110#endif // _WX_MAC_PRIVATE_MACTEXT_H_