Merge "Remove unnecessarily exported signals and action names" into tizen
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 18 Feb 2015 17:39:28 +0000 (09:39 -0800)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 18 Feb 2015 17:39:29 +0000 (09:39 -0800)
1  2 
dali-toolkit/internal/controls/text-input/text-input-impl.cpp
dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp
dali-toolkit/internal/focus-manager/focus-manager-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp

@@@ -198,19 -198,28 +198,28 @@@ namespace Interna
  namespace
  {
  
+ // Signals
+ const char* const SIGNAL_START_INPUT =                  "start-input";
+ const char* const SIGNAL_END_INPUT =                    "end-input";
+ const char* const SIGNAL_STYLE_CHANGED =                "style-changed";
+ const char* const SIGNAL_MAX_INPUT_CHARACTERS_REACHED = "max-input-characters-reached";
+ const char* const SIGNAL_TOOLBAR_DISPLAYED =            "toolbar-displayed";
+ const char* const SIGNAL_TEXT_EXCEED_BOUNDARIES =       "text-exceed-boundaries";
  BaseHandle Create()
  {
    return Toolkit::TextInput::New();
  }
  
- TypeRegistration typeRegistration( typeid(Toolkit::TextInput), typeid(Toolkit::Control), Create );
+ TypeRegistration typeRegistration( typeid( Toolkit::TextInput ), typeid( Toolkit::Control ), Create );
  
- SignalConnectorType signalConnector1( typeRegistration, Toolkit::TextInput::SIGNAL_START_INPUT,                  &TextInput::DoConnectSignal );
- SignalConnectorType signalConnector2( typeRegistration, Toolkit::TextInput::SIGNAL_END_INPUT,                    &TextInput::DoConnectSignal );
- SignalConnectorType signalConnector3( typeRegistration, Toolkit::TextInput::SIGNAL_STYLE_CHANGED,                &TextInput::DoConnectSignal );
- SignalConnectorType signalConnector4( typeRegistration, Toolkit::TextInput::SIGNAL_MAX_INPUT_CHARACTERS_REACHED, &TextInput::DoConnectSignal );
- SignalConnectorType signalConnector5( typeRegistration, Toolkit::TextInput::SIGNAL_TOOLBAR_DISPLAYED,            &TextInput::DoConnectSignal );
- SignalConnectorType signalConnector6( typeRegistration, Toolkit::TextInput::SIGNAL_TEXT_EXCEED_BOUNDARIES,       &TextInput::DoConnectSignal );
+ SignalConnectorType signalConnector1( typeRegistration, SIGNAL_START_INPUT,                  &TextInput::DoConnectSignal );
+ SignalConnectorType signalConnector2( typeRegistration, SIGNAL_END_INPUT,                    &TextInput::DoConnectSignal );
+ SignalConnectorType signalConnector3( typeRegistration, SIGNAL_STYLE_CHANGED,                &TextInput::DoConnectSignal );
+ SignalConnectorType signalConnector4( typeRegistration, SIGNAL_MAX_INPUT_CHARACTERS_REACHED, &TextInput::DoConnectSignal );
+ SignalConnectorType signalConnector5( typeRegistration, SIGNAL_TOOLBAR_DISPLAYED,            &TextInput::DoConnectSignal );
+ SignalConnectorType signalConnector6( typeRegistration, SIGNAL_TEXT_EXCEED_BOUNDARIES,       &TextInput::DoConnectSignal );
  
  }
  
@@@ -579,25 -588,29 +588,29 @@@ bool TextInput::DoConnectSignal( BaseOb
    Dali::BaseHandle handle( object );
  
    bool connected( true );
-   Toolkit::TextInput textInput = Toolkit::TextInput::DownCast(handle);
+   Toolkit::TextInput textInput = Toolkit::TextInput::DownCast( handle );
  
-   if( Toolkit::TextInput::SIGNAL_START_INPUT == signalName )
+   if( 0 == strcmp( signalName.c_str(), SIGNAL_START_INPUT ) )
    {
      textInput.InputStartedSignal().Connect( tracker, functor );
    }
-   else if( Toolkit::TextInput::SIGNAL_END_INPUT == signalName )
+   else if( 0 == strcmp( signalName.c_str(), SIGNAL_END_INPUT ) )
    {
      textInput.InputFinishedSignal().Connect( tracker, functor );
    }
-   else if( Toolkit::TextInput::SIGNAL_STYLE_CHANGED == signalName )
+   else if( 0 == strcmp( signalName.c_str(), SIGNAL_STYLE_CHANGED ) )
    {
      textInput.StyleChangedSignal().Connect( tracker, functor );
    }
-   else if( Toolkit::TextInput::SIGNAL_MAX_INPUT_CHARACTERS_REACHED == signalName )
+   else if( 0 == strcmp( signalName.c_str(), SIGNAL_MAX_INPUT_CHARACTERS_REACHED ) )
    {
      textInput.MaxInputCharactersReachedSignal().Connect( tracker, functor );
    }
-   else if( Toolkit::TextInput::SIGNAL_TEXT_EXCEED_BOUNDARIES == signalName )
+   else if( 0 == strcmp( signalName.c_str(), SIGNAL_TOOLBAR_DISPLAYED ) )
+   {
+     textInput.CutAndPasteToolBarDisplayedSignal().Connect( tracker, functor );
+   }
+   else if( 0 == strcmp( signalName.c_str(), SIGNAL_TEXT_EXCEED_BOUNDARIES ) )
    {
      textInput.InputTextExceedBoundariesSignal().Connect( tracker, functor );
    }
@@@ -3048,8 -3061,7 +3061,8 @@@ void TextInput::CreateGrabArea( Actor& 
    mGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
    mGrabArea.SetName( "GrabArea" );
    mGrabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
 -  mGrabArea.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), RelativeToConstraint( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE ) ) );  // grab area to be larger than text actor
 +  mGrabArea.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
 +  mGrabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
    mGrabArea.TouchedSignal().Connect(this,&TextInput::OnPressDown);
    mTapDetector.Attach( mGrabArea );
    mPanGestureDetector.Attach( mGrabArea );
@@@ -3285,8 -3297,7 +3298,8 @@@ void TextInput::CreateSelectionHandles
      mHandleOneGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
      mHandleOneGrabArea.SetName("SelectionHandleOneGrabArea");
  
 -    mHandleOneGrabArea.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), RelativeToConstraint( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE ) ) );  // grab area to be larger than text actor
 +    mHandleOneGrabArea.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
 +    mHandleOneGrabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
      mHandleOneGrabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
  
      mTapDetector.Attach( mHandleOneGrabArea );
  
      mHandleTwoGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
      mHandleTwoGrabArea.SetName("SelectionHandleTwoGrabArea");
 -    mHandleTwoGrabArea.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), RelativeToConstraint( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE ) ) );  // grab area to be larger than text actor
 +    mHandleTwoGrabArea.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
 +    mHandleTwoGrabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
      mHandleTwoGrabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
  
      mTapDetector.Attach( mHandleTwoGrabArea );
@@@ -18,8 -18,8 +18,8 @@@
  // EXTERNAL INCLUDES
  #include <libintl.h>
  #include <dali/public-api/animation/constraints.h>
- #include <dali/integration-api/debug.h>
  #include <dali/public-api/images/resource-image.h>
+ #include <dali/integration-api/debug.h>
  
  // INTERNAL INCLUDES
  #include <dali-toolkit/internal/controls/text-input/text-input-popup-impl.h>
@@@ -101,9 -101,16 +101,16 @@@ namespace Toolki
  namespace Internal
  {
  
- const char* const TextInputPopup::SIGNAL_PRESSED = "pressed";
- const char* const TextInputPopup::SIGNAL_HIDE_FINISHED = "hide-finished";
- const char* const TextInputPopup::SIGNAL_SHOW_FINISHED = "show-finished";
+ namespace
+ {
+ // Signals
+ const char* const SIGNAL_PRESSED =       "pressed";
+ const char* const SIGNAL_HIDE_FINISHED = "hide-finished";
+ const char* const SIGNAL_SHOW_FINISHED = "show-finished";
+ }
  
  const char* const TextInputPopup::OPTION_SELECT_WORD = "option-select_word";                       // "Select Word" popup option.
  const char* const TextInputPopup::OPTION_SELECT_ALL("option-select_all");                          // "Select All" popup option.
@@@ -287,7 -294,7 +294,7 @@@ void TextInputPopup::CreateBackground(
      mBackgroundEffect.SetAnchorPoint( AnchorPoint::CENTER );
      mBackgroundEffect.SetParentOrigin( ParentOrigin::CENTER );
      mBackgroundEffect.SetName( "text-input-popup-background-effect" );
 -    mBackgroundEffect.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
 +    mBackgroundEffect.SetSizeMode( SIZE_EQUAL_TO_PARENT );
      mBackgroundEffect.SetZ( 1.0f );
      mBackground.Add( mBackgroundEffect );
  
      mBackgroundLine.SetAnchorPoint( AnchorPoint::CENTER);
      mBackgroundLine.SetParentOrigin( ParentOrigin::CENTER );
      mBackgroundLine.SetName( "text-input-popup-background-effect" );
 -    mBackgroundLine.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
 +    mBackgroundLine.SetSizeMode( SIZE_EQUAL_TO_PARENT );
      mBackgroundLine.SetColor( mLineColor );
      mBackgroundLine.SetZ( 0.1f );
      mBackgroundEffect.Add( mBackgroundLine );
@@@ -322,7 -329,7 +329,7 @@@ void TextInputPopup::CreateTail(
      mTailEffect.SetParentOrigin( ParentOrigin::CENTER );
      mTailEffect.SetAnchorPoint( AnchorPoint::CENTER );
      mTailEffect.SetName( "text-input-popup-tail-effect" );
 -    mTailEffect.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
 +    mTailEffect.SetSizeMode( SIZE_EQUAL_TO_PARENT );
      mTailEffect.SetZ( 0.1f );
      mTail.Add( mTailEffect );
  
      mTailLine = ImageActor::New( tailLine );
      mTailLine.SetParentOrigin( ParentOrigin::CENTER );
      mTailLine.SetAnchorPoint( AnchorPoint::CENTER );
 -    mTailLine.ApplyConstraint( Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() ) );
 +    mTailLine.SetSizeMode( SIZE_EQUAL_TO_PARENT );
      mTailLine.SetName( "text-input-popup-tail-line" );
      mTailLine.SetColor( mLineColor );
      mTailLine.SetZ( 0.1f );
@@@ -895,12 -902,12 +902,12 @@@ TextInputPopup::PressedSignalType& Text
    return mPressedSignal;
  }
  
- TextInputPopup::HideFinishedSignalType& TextInputPopup::HideFinishedSignal()
+ TextInputPopup::VisibilityChangeFinishedSignalType& TextInputPopup::HideFinishedSignal()
  {
    return mHideFinishedSignal;
  }
  
- TextInputPopup::ShowFinishedSignalType& TextInputPopup::ShowFinishedSignal()
+ TextInputPopup::VisibilityChangeFinishedSignalType& TextInputPopup::ShowFinishedSignal()
  {
    return mShowFinishedSignal;
  }
@@@ -44,12 -44,18 +44,18 @@@ namespace Interna
  namespace // unnamed namespace
  {
  
+ // Signals
+ const char* const SIGNAL_FOCUS_CHANGED =           "focus-changed";
+ const char* const SIGNAL_FOCUS_OVERSHOT =          "focus-overshot";
+ const char* const SIGNAL_FOCUSED_ACTOR_ACTIVATED = "focused-actor-activated";
  #if defined(DEBUG_ENABLED)
  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_FOCUS_MANAGER");
  #endif
  
- const char * const ACTOR_FOCUSABLE("focusable");
- const char * const IS_FOCUS_GROUP("is-focus-group");
+ const char* const ACTOR_FOCUSABLE("focusable");
+ const char* const IS_FOCUS_GROUP("is-focus-group");
  
  const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.png";
  const Vector4 FOCUS_BORDER_IMAGE_BORDER = Vector4(7.0f, 7.0f, 7.0f, 7.0f);
@@@ -668,7 -674,10 +674,7 @@@ void FocusManager::CreateDefaultFocusIn
    focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f));
  
    // Apply size constraint to the focus indicator
 -  Constraint constraint = Constraint::New<Vector3>(Actor::SIZE,
 -                                                   ParentSource(Actor::SIZE),
 -                                                   EqualToConstraint());
 -  focusIndicator.ApplyConstraint(constraint);
 +  focusIndicator.SetSizeMode( SIZE_EQUAL_TO_PARENT );
  
    SetFocusIndicatorActor(focusIndicator);
  }
@@@ -969,17 -978,17 +975,17 @@@ bool FocusManager::DoConnectSignal( Bas
    Dali::BaseHandle handle( object );
  
    bool connected( true );
-   FocusManager* manager = dynamic_cast<FocusManager*>(object);
+   FocusManager* manager = dynamic_cast<FocusManager*>( object );
  
-   if( Dali::Toolkit::FocusManager::SIGNAL_FOCUS_CHANGED == signalName )
+   if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) )
    {
      manager->FocusChangedSignal().Connect( tracker, functor );
    }
-   else if( Dali::Toolkit::FocusManager::SIGNAL_FOCUS_OVERSHOT == signalName )
+   else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_OVERSHOT ) )
    {
      manager->FocusOvershotSignal().Connect( tracker, functor );
    }
-   else if( Dali::Toolkit::FocusManager::SIGNAL_FOCUSED_ACTOR_ACTIVATED== signalName )
+   else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUSED_ACTOR_ACTIVATED ) )
    {
      manager->FocusedActorActivatedSignal().Connect( tracker, functor );
    }
@@@ -47,6 -47,13 +47,13 @@@ namespace Interna
  namespace // unnamed namespace
  {
  
+ // Signals
+ const char* const SIGNAL_PRE_FOCUS_CHANGE =        "keyboard-pre-focus-change";
+ const char* const SIGNAL_FOCUS_CHANGED =           "keyboard-focus-changed";
+ const char* const SIGNAL_FOCUS_GROUP_CHANGED =     "keyboard-focus-group-changed";
+ const char* const SIGNAL_FOCUSED_ACTOR_ACTIVATED = "keyboard-focused-actor-activated";
  #if defined(DEBUG_ENABLED)
  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_KEYBOARD_FOCUS_MANAGER");
  #endif
@@@ -73,8 -80,14 +80,14 @@@ BaseHandle Create(
  
    return handle;
  }
  TypeRegistration KEYBOARD_FOCUS_MANAGER_TYPE( typeid(Dali::Toolkit::KeyboardFocusManager), typeid(Dali::BaseHandle), Create, true /* Create instance at startup */ );
  
+ SignalConnectorType signalConnector1( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_PRE_FOCUS_CHANGE , &KeyboardFocusManager::DoConnectSignal );
+ SignalConnectorType signalConnector2( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_FOCUS_CHANGED , &KeyboardFocusManager::DoConnectSignal );
+ SignalConnectorType signalConnector3( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_FOCUS_GROUP_CHANGED , &KeyboardFocusManager::DoConnectSignal );
+ SignalConnectorType signalConnector4( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_FOCUSED_ACTOR_ACTIVATED , &KeyboardFocusManager::DoConnectSignal );
  } // unnamed namespace
  
  Toolkit::KeyboardFocusManager KeyboardFocusManager::Get()
@@@ -468,7 -481,10 +481,7 @@@ void KeyboardFocusManager::CreateDefaul
    focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f));
  
    // Apply size constraint to the focus indicator
 -  Constraint constraint = Constraint::New<Vector3>(Actor::SIZE,
 -                                                   ParentSource(Actor::SIZE),
 -                                                   EqualToConstraint());
 -  focusIndicator.ApplyConstraint(constraint);
 +  focusIndicator.SetSizeMode( SIZE_EQUAL_TO_PARENT );
  
    SetFocusIndicatorActor(focusIndicator);
  }
@@@ -718,21 -734,21 +731,21 @@@ bool KeyboardFocusManager::DoConnectSig
    Dali::BaseHandle handle( object );
  
    bool connected( true );
-   KeyboardFocusManager* manager = dynamic_cast<KeyboardFocusManager*>(object);
+   KeyboardFocusManager* manager = dynamic_cast<KeyboardFocusManager*>( object );
  
-   if( Dali::Toolkit::KeyboardFocusManager::SIGNAL_PRE_FOCUS_CHANGE == signalName )
+   if( 0 == strcmp( signalName.c_str(), SIGNAL_PRE_FOCUS_CHANGE ) )
    {
      manager->PreFocusChangeSignal().Connect( tracker, functor );
    }
-   if( Dali::Toolkit::KeyboardFocusManager::SIGNAL_FOCUS_CHANGED == signalName )
+   if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_CHANGED ) )
    {
      manager->FocusChangedSignal().Connect( tracker, functor );
    }
-   if( Dali::Toolkit::KeyboardFocusManager::SIGNAL_FOCUS_GROUP_CHANGED == signalName )
+   if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUS_GROUP_CHANGED ) )
    {
      manager->FocusGroupChangedSignal().Connect( tracker, functor );
    }
-   else if( Dali::Toolkit::KeyboardFocusManager::SIGNAL_FOCUSED_ACTOR_ACTIVATED== signalName )
+   else if( 0 == strcmp( signalName.c_str(), SIGNAL_FOCUSED_ACTOR_ACTIVATED ) )
    {
      manager->FocusedActorActivatedSignal().Connect( tracker, functor );
    }