cocococococococos 2 d-Xノード(CCIMEDelegate.h)API


本論文はhttp://blog.csdn.net/runaying ,引用は出典を明記しなければならない!
cocococococococos 2 d-Xノード(CCIMEDelegate.h)API
みなさんがよりよく勉強できるように、私のブログを見ることを強くおすすめします。 Cocos 2 d-X権威ガイドノート
///cocos2d-x-3.0alpha0/cocos2dx/text_input_node


#ifndef __CC_IME_DELEGATE_H__
#define __CC_IME_DELEGATE_H__

#include "cocoa/CCGeometry.h"

NS_CC_BEGIN

/**
 * @addtogroup input
 * @{
 */

typedef struct
{
    Rect  begin;              //             
    Rect  end;                //             
    float     duration;           //           
} IMEKeyboardNotificationInfo;

/**
@brief            。
*/
class CC_DLL IMEDelegate
{
public:
    /**
     * @js NA
     * @lua NA
     */
    virtual ~IMEDelegate();
    /**
     * @js NA
     * @lua NA
     */
    virtual bool attachWithIME();
    /**
     * @js NA
     * @lua NA
     */
    virtual bool detachWithIME();

protected:
    friend class IMEDispatcher;

    /**
    @brief                IME  。
     IMEDispatcher     .
    * @js NA
    * @lua NA
    */
    virtual bool canAttachWithIME() { return false; }
    /**
    @brief        IME  ,    IMEDispatcher       .
    * @js NA
    * @lua NA
    */
    virtual void didAttachWithIME() {}

    /**
    @brief                IME  .
    * @js NA
    * @lua NA
    */
    virtual bool canDetachWithIME() { return false; }

    /**
    @brief        IME  ,    IMEDispatcher       .
    * @js NA
    * @lua NA
    */
    virtual void didDetachWithIME() {}

    /**
    @brief       IME          ,  IMEDispatcher       .
    * @js NA
    * @lua NA
    */
    virtual void insertText(const char * text, int len) {CC_UNUSED_PARAM(text);CC_UNUSED_PARAM(len);}

    /**
    @brief            ,  IMEDispatcher       .
    * @js NA
    * @lua NA
    */
    virtual void deleteBackward() {}

    /**
    @brief          ,  IMEDispatcher     
    * @js NA
    * @lua NA
    */
    virtual const char * getContentText() { return 0; }

    //////////////////////////////////////////////////////////////////////////
    // keyboard show/hide notification
    //////////////////////////////////////////////////////////////////////////
    /**
     * @js NA
     * @lua NA
     */
    virtual void keyboardWillShow(IMEKeyboardNotificationInfo& info)   {CC_UNUSED_PARAM(info);}
    /**
     * @js NA
     * @lua NA
     */
    virtual void keyboardDidShow(IMEKeyboardNotificationInfo& info)    {CC_UNUSED_PARAM(info);}
    /**
     * @js NA
     * @lua NA
     */
    virtual void keyboardWillHide(IMEKeyboardNotificationInfo& info)   {CC_UNUSED_PARAM(info);}
    /**
     * @js NA
     * @lua NA
     */
    virtual void keyboardDidHide(IMEKeyboardNotificationInfo& info)    {CC_UNUSED_PARAM(info);}

protected:
    /**
     * @js NA
     * @lua NA
     */
    IMEDelegate();
};

// end of input group
/// @}

NS_CC_END

#endif    // __CC_IME_DELEGATE_H__