X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Finput-method-context.h;h=04a8e72b22a3b2e0d9cdcd6a0fe9f71d55702627;hb=6241b9f64a393a38613842dcf085855daa68fc03;hp=6775ef2ee608287a3b1f52b15ea555084c79d190;hpb=7772a4e2974a2c69dabb2220ca01143a5c8cd274;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/input-method-context.h b/dali/devel-api/adaptor-framework/input-method-context.h index 6775ef2..04a8e72 100755 --- a/dali/devel-api/adaptor-framework/input-method-context.h +++ b/dali/devel-api/adaptor-framework/input-method-context.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INPUT_METHOD_CONTEXT_H__ -#define __DALI_INPUT_METHOD_CONTEXT_H__ +#ifndef DALI_INPUT_METHOD_CONTEXT_H +#define DALI_INPUT_METHOD_CONTEXT_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include // EXTERNAL INCLUDES #include @@ -37,19 +38,20 @@ class InputMethodContext; } } +class Actor; + /** * @brief The InputMethodContext class * * Specifically manages the ecore input method framework which enables the virtual or hardware keyboards. */ - class DALI_ADAPTOR_API InputMethodContext : public BaseHandle { public: /** - * @brief The direction of text. - */ + * @brief The direction of text. + */ enum TextDirection { LeftToRight, @@ -90,6 +92,47 @@ public: }; /** + * @brief Enumeration for the language mode of the input panel. + */ + enum class InputPanelLanguage + { + AUTOMATIC, ///< IME Language automatically set depending on the system display + ALPHABET ///< Latin alphabet at all times + }; + + /** + * @brief Enumeration for the preedit style types. + */ + enum class PreeditStyle + { + NONE, ///< None style + UNDERLINE, ///< Underline substring style + REVERSE, ///< Reverse substring style + HIGHLIGHT, ///< Highlight substring style + CUSTOM_PLATFORM_STYLE_1, ///< Custom style for platform + CUSTOM_PLATFORM_STYLE_2, ///< Custom style for platform + CUSTOM_PLATFORM_STYLE_3, ///< Custom style for platform + CUSTOM_PLATFORM_STYLE_4 ///< Custom style for platform + }; + + /** + * @brief This structure is for the preedit style types and indices. + */ + struct PreeditAttributeData + { + PreeditAttributeData() + : preeditType( PreeditStyle::NONE ), + startIndex( 0 ), + endIndex( 0 ) + { + } + + PreeditStyle preeditType; /// The preedit style type + unsigned int startIndex; /// The start index of preedit + unsigned int endIndex; /// The end index of preedit + }; + + /** * @brief This structure is used to pass on data from the InputMethodContext regarding predictive text. */ struct EventData @@ -172,6 +215,9 @@ public: typedef Signal< void ( KeyboardType ) > KeyboardTypeSignalType; ///< keyboard type typedef Signal< void ( int ) > KeyboardResizedSignalType; ///< Keyboard resized signal typedef Signal< void ( int ) > LanguageChangedSignalType; ///< Language changed signal + typedef Signal< void ( const std::string&, const std::string&, const std::string& ) > ContentReceivedSignalType; ///< Content received signal + + using PreEditAttributeDataContainer = Vector< Dali::InputMethodContext::PreeditAttributeData >; public: @@ -195,6 +241,13 @@ public: static InputMethodContext New(); /** + * @brief Create a new instance of an InputMethodContext. + * + * @param[in] actor The actor that uses the new InputMethodContext instance. + */ + static InputMethodContext New( Actor actor ); + + /** * @brief Copy constructor. * * @param[in] inputMethodContext InputMethodContext to copy. The copied inputMethodContext will point at the same implementation. @@ -392,6 +445,16 @@ public: std::string GetInputPanelLocale(); /** + * @brief Sets the allowed MIME Types to deliver to the input panel. + * + * ex) std::string mimeTypes = "text/plain,image/png,image/gif,application/pdf"; + * + * You can receive a media content URI and its MIME type from ContentReceivedSignal(). @see ContentReceivedSignal + * @param[in] mimeTypes The allowed MIME types + */ + void SetContentMIMETypes( const std::string& mimeTypes ); + + /** * @brief Process event key down or up, whether filter a key to isf. * * @param[in] keyEvent The event key to be handled. @@ -412,6 +475,37 @@ public: * @return Whether the IM allow text prediction or not. */ bool IsTextPredictionAllowed() const; + + /** + * @brief Sets the language of the input panel. + * + * This method can be used when you want to show the English keyboard. + * @param[in] language The language to be set to the input panel + */ + void SetInputPanelLanguage( InputPanelLanguage language ); + + /** + * @brief Gets the language of the input panel. + * + * @return The language of the input panel + */ + InputPanelLanguage GetInputPanelLanguage() const; + + /** + * @brief Sets the x,y coordinates of the input panel. + * + * @param[in] x The top-left x coordinate of the input panel + * @param[in] y The top-left y coordinate of the input panel + */ + void SetInputPanelPosition( unsigned int x, unsigned int y ); + + /** + * @brief Gets the preedit attributes data. + * + * @param[out] attrs The preedit attributes data. + */ + void GetPreeditStyle( PreEditAttributeDataContainer& attrs ) const; + public: // Signals @@ -483,6 +577,18 @@ public: */ KeyboardTypeSignalType& KeyboardTypeChangedSignal(); + /** + * @brief Connect to this signal to be notified when the content, such as images, of input method is received. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName( const std::string& contentUri, const std::string& description, const std::string& contentMIMEType ); + * @endcode + * + * @return The signal to connect to. + */ + ContentReceivedSignalType& ContentReceivedSignal(); + public: /** @@ -498,4 +604,4 @@ public: } // namespace Dali -#endif // __DALI_INPUT_METHOD_CONTEXT_H__ +#endif // DALI_INPUT_METHOD_CONTEXT_H