]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/cocoa/private/textimpl.h
Compilation fix for wxUniv.
[wxWidgets.git] / include / wx / osx / cocoa / private / textimpl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: textimpl.h
3 // Purpose: textcontrol implementation classes that have to be exposed
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_OSX_COCOA_PRIVATE_TEXTIMPL_H_
13 #define _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_
14
15 #include "wx/combobox.h"
16 #include "wx/osx/private.h"
17
18 // implementation exposed, so that search control can pull it
19
20 class wxNSTextFieldControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl
21 {
22 public :
23 wxNSTextFieldControl( wxWindow *wxPeer, WXWidget w );
24 virtual ~wxNSTextFieldControl();
25
26 virtual wxString GetStringValue() const ;
27 virtual void SetStringValue( const wxString &str) ;
28 virtual void Copy() ;
29 virtual void Cut() ;
30 virtual void Paste() ;
31 virtual bool CanPaste() const ;
32 virtual void SetEditable(bool editable) ;
33 virtual void GetSelection( long* from, long* to) const ;
34 virtual void SetSelection( long from , long to );
35 virtual void WriteText(const wxString& str) ;
36
37 virtual void controlAction(WXWidget slf, void* _cmd, void *sender);
38 protected :
39 NSTextField* m_textField;
40 long m_selStart;
41 long m_selEnd;
42 };
43
44 class wxNSTextViewControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl
45 {
46 public:
47 wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w );
48 virtual ~wxNSTextViewControl();
49
50 virtual wxString GetStringValue() const ;
51 virtual void SetStringValue( const wxString &str) ;
52 virtual void Copy() ;
53 virtual void Cut() ;
54 virtual void Paste() ;
55 virtual bool CanPaste() const ;
56 virtual void SetEditable(bool editable) ;
57 virtual void GetSelection( long* from, long* to) const ;
58 virtual void SetSelection( long from , long to );
59 virtual void WriteText(const wxString& str) ;
60 virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true );
61
62 virtual bool GetStyle(long position, wxTextAttr& style);
63 virtual void SetStyle(long start, long end, const wxTextAttr& style);
64
65 virtual void CheckSpelling(bool check);
66 virtual wxSize GetBestSize() const;
67
68 protected:
69 NSScrollView* m_scrollView;
70 NSTextView* m_textView;
71 };
72
73 class wxNSComboBoxControl : public wxNSTextFieldControl, public wxComboWidgetImpl
74 {
75 public :
76 wxNSComboBoxControl( wxWindow *wxPeer, WXWidget w );
77 virtual ~wxNSComboBoxControl();
78
79 virtual int GetSelectedItem() const;
80 virtual void SetSelectedItem(int item);
81
82 virtual int GetNumberOfItems() const;
83
84 virtual void InsertItem(int pos, const wxString& item);
85 virtual void RemoveItem(int pos);
86
87 virtual void Clear();
88
89 virtual wxString GetStringAtIndex(int pos) const;
90
91 virtual int FindString(const wxString& text) const;
92 private:
93 NSComboBox* m_comboBox;
94 };
95
96 #endif // _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_