]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/osx/iphone/private/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 wxUITextFieldControl : public wxWidgetIPhoneImpl, public wxTextWidgetImpl | |
21 | { | |
22 | public : | |
23 | wxUITextFieldControl( wxTextCtrl *wxPeer, UITextField* w ); | |
24 | virtual ~wxUITextFieldControl(); | |
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 | virtual bool HasOwnContextMenu() const { return true; } | |
37 | ||
38 | virtual wxSize GetBestSize() const; | |
39 | ||
40 | virtual bool SetHint(const wxString& hint); | |
41 | ||
42 | virtual void controlAction(WXWidget slf, void* _cmd, void *sender); | |
43 | protected : | |
44 | UITextField* m_textField; | |
45 | NSObject<UITextFieldDelegate>* m_delegate; | |
46 | long m_selStart; | |
47 | long m_selEnd; | |
48 | }; | |
49 | ||
50 | class wxUITextViewControl : public wxWidgetIPhoneImpl, public wxTextWidgetImpl | |
51 | { | |
52 | public: | |
53 | wxUITextViewControl( wxTextCtrl *wxPeer, UITextView* w ); | |
54 | virtual ~wxUITextViewControl(); | |
55 | ||
56 | virtual wxString GetStringValue() const ; | |
57 | virtual void SetStringValue( const wxString &str) ; | |
58 | virtual void Copy() ; | |
59 | virtual void Cut() ; | |
60 | virtual void Paste() ; | |
61 | virtual bool CanPaste() const ; | |
62 | virtual void SetEditable(bool editable) ; | |
63 | virtual void GetSelection( long* from, long* to) const ; | |
64 | virtual void SetSelection( long from , long to ); | |
65 | virtual void WriteText(const wxString& str) ; | |
66 | virtual void SetFont( const wxFont & font , const wxColour& foreground , long windowStyle, bool ignoreBlack = true ); | |
67 | ||
68 | virtual bool GetStyle(long position, wxTextAttr& style); | |
69 | virtual void SetStyle(long start, long end, const wxTextAttr& style); | |
70 | ||
71 | virtual bool CanFocus() const; | |
72 | ||
73 | virtual bool HasOwnContextMenu() const { return true; } | |
74 | ||
75 | virtual void CheckSpelling(bool check); | |
76 | virtual wxSize GetBestSize() const; | |
77 | ||
78 | protected: | |
79 | NSObject<UITextViewDelegate>* m_delegate; | |
80 | UITextView* m_textView; | |
81 | }; | |
82 | ||
83 | #if 0 | |
84 | class wxNSComboBoxControl : public wxUITextFieldControl, public wxComboWidgetImpl | |
85 | { | |
86 | public : | |
87 | wxNSComboBoxControl( wxWindow *wxPeer, WXWidget w ); | |
88 | virtual ~wxNSComboBoxControl(); | |
89 | ||
90 | virtual int GetSelectedItem() const; | |
91 | virtual void SetSelectedItem(int item); | |
92 | ||
93 | virtual int GetNumberOfItems() const; | |
94 | ||
95 | virtual void InsertItem(int pos, const wxString& item); | |
96 | virtual void RemoveItem(int pos); | |
97 | ||
98 | virtual void Clear(); | |
99 | ||
100 | virtual wxString GetStringAtIndex(int pos) const; | |
101 | ||
102 | virtual int FindString(const wxString& text) const; | |
103 | private: | |
104 | NSComboBox* m_comboBox; | |
105 | }; | |
106 | #endif | |
107 | ||
108 | #endif // _WX_OSX_COCOA_PRIVATE_TEXTIMPL_H_ |