else
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p keyString %s\n", this, keyString.c_str() );
+ if (!IsEditable()) return false;
if( !keyString.empty() )
{
return mImpl->GetTextSelectionRange();
}
+void Controller::SelectWholeText()
+{
+ SelectEvent( 0.f, 0.f, SelectionType::ALL );
+}
+
+void Controller::SelectNone()
+{
+ SelectEvent( 0.f, 0.f, SelectionType::NONE );
+}
+
+string Controller::GetSelectedText() const
+{
+ string text;
+ if( EventData::SELECTING == mImpl->mEventData->mState )
+ {
+ mImpl->RetrieveSelection( text, false );
+ }
+ return text;
+}
+
InputMethodContext::CallbackData Controller::OnInputMethodContextEvent( InputMethodContext& inputMethodContext, const InputMethodContext::EventData& inputMethodContextEvent )
{
// Whether the text needs to be relaid-out.
}
}
+bool Controller::IsEditable() const
+{
+ return mImpl->IsEditable();
+}
+
+void Controller::SetEditable( bool editable )
+{
+ mImpl->SetEditable( editable );
+ if(mImpl->mEventData && mImpl->mEventData->mDecorator)
+ {
+ mImpl->mEventData->mDecorator->SetEditable( editable );
+ }
+}
+
void Controller::DecorationEvent( HandleType handleType, HandleState state, float x, float y )
{
DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected DecorationEvent" );
{
case Toolkit::TextSelectionPopup::CUT:
{
+ if (!IsEditable()) return;
mImpl->SendSelectionToClipboard( true ); // Synchronous call to modify text
mImpl->mOperationsPending = ALL_OPERATIONS;
return textRemoved;
}
-std::string Controller::GetSelectedText()
-{
- std::string text;
- if( EventData::SELECTING == mImpl->mEventData->mState )
- {
- mImpl->RetrieveSelection( text, false );
- }
- return text;
-}
-
// private : Relayout.
bool Controller::DoRelayout( const Size& size,
return;
}
+ if (!IsEditable()) return;
+
mImpl->mEventData->mCheckScrollAmount = true;
// The natural size needs to be re-calculated.
return removed;
}
+ if (!IsEditable()) return false;
+
// InputMethodContext is no longer handling key-events
mImpl->ClearPreEditFlag();