123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- #ifndef __CC_IME_DELEGATE_H__
- #define __CC_IME_DELEGATE_H__
- #include <string>
- #include "math/CCGeometry.h"
- #include "base/CCEventKeyboard.h"
- NS_CC_BEGIN
- extern const std::string CC_DLL STD_STRING_EMPTY;
- typedef struct
- {
- Rect begin;
- Rect end;
- float duration;
- } IMEKeyboardNotificationInfo;
- class CC_DLL IMEDelegate
- {
- public:
-
- virtual ~IMEDelegate();
-
-
- virtual bool attachWithIME();
-
-
- virtual bool detachWithIME();
- protected:
- friend class IMEDispatcher;
-
- virtual bool canAttachWithIME() { return false; }
-
- virtual void didAttachWithIME() {}
-
- virtual bool canDetachWithIME() { return false; }
-
- virtual void didDetachWithIME() {}
-
- virtual void insertText(const char* , size_t ) {}
-
- virtual void deleteBackward() {}
-
- virtual void controlKey(EventKeyboard::KeyCode ) {}
-
- virtual const std::string& getContentText() { return STD_STRING_EMPTY; }
-
-
-
-
- virtual void keyboardWillShow(IMEKeyboardNotificationInfo& ) {}
-
- virtual void keyboardDidShow(IMEKeyboardNotificationInfo& ) {}
-
- virtual void keyboardWillHide(IMEKeyboardNotificationInfo& ) {}
-
- virtual void keyboardDidHide(IMEKeyboardNotificationInfo& ) {}
- protected:
-
- IMEDelegate();
- };
- NS_CC_END
- #endif
|