src/hbplugins/inputmethods/common/hbinputpredictionhandler.cpp
changeset 23 e6ad4ef83b23
parent 21 4633027730f5
child 28 b7da29130b0e
--- a/src/hbplugins/inputmethods/common/hbinputpredictionhandler.cpp	Wed Aug 18 10:05:37 2010 +0300
+++ b/src/hbplugins/inputmethods/common/hbinputpredictionhandler.cpp	Thu Sep 02 20:44:51 2010 +0300
@@ -81,14 +81,14 @@
         //To prevent showing autocompletion part while deleting the characters using backspace key
         mShowTail = false;
         mShowTooltip = false;
-		bool unused = false;
+        bool unused = false;
         mEngine->updateCandidates(mBestGuessLocation, unused);
-		//If Input length greater or equal to one then Append the current word to candidate 
-		if (!mCandidates->count() && mEngine->inputLength() >= 1) {
-			mCandidates->append(mEngine->currentWord());
+        //If Input length greater or equal to one then Append the current word to candidate 
+        if (!mCandidates->count() && mEngine->inputLength() >= 1) {
+            mCandidates->append(mEngine->currentWord());
         }
-		mCanContinuePrediction = true;
-		// update the editor with the new preedit text.
+        mCanContinuePrediction = true;
+        // update the editor with the new preedit text.
         updateEditor();
         return;
     } else {
@@ -96,7 +96,7 @@
         // once the word is committed, we can not bring it back to inline edit.
         // so if the engine does not have any data, we just send backspace event to the editor.
         Q_Q(HbInputPredictionHandler);
-        QKeyEvent event = QKeyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier);		
+        QKeyEvent event = QKeyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier);       
         q->sendAndUpdate(event);
         event = QKeyEvent(QEvent::KeyRelease, Qt::Key_Backspace, Qt::NoModifier);
         q->sendAndUpdate(event);
@@ -208,7 +208,7 @@
             int taillength = mCandidates->at(mBestGuessLocation).length() - mEngine->inputLength();
             if (taillength > 0 && mShowTail) {
                 // TODO: Color from skin should be used
-				QColor col = HbColorScheme::color("qtc_input_hint_normal");
+                QColor col = HbColorScheme::color("qtc_input_hint_normal");
                 QBrush brush(col);
                 QTextCharFormat gray;
                 gray.setForeground(brush);
@@ -220,11 +220,11 @@
                 } else {
                     list.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, mEngine->inputLength(), taillength, gray));
                 }
-				list.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, mEngine->inputLength(), 0, 0));
+                list.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, mEngine->inputLength(), 0, 0));
                 QInputMethodEvent event(mCandidates->at(mBestGuessLocation), list);
                 focusedObject->sendEvent(event);
             } else {
-				list.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, mCandidates->at(mBestGuessLocation).length(), 0, 0));
+                list.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, mCandidates->at(mBestGuessLocation).length(), 0, 0));
                 QInputMethodEvent event(mCandidates->at(mBestGuessLocation).left(mEngine->inputLength()), list);
                 focusedObject->sendEvent(event);
             }
@@ -266,14 +266,14 @@
         {
             QString currentSelection = focusObject->inputMethodQuery(Qt::ImCurrentSelection).toString();
             if(currentSelection.length()) {
-                QKeyEvent event = QKeyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier);		
+                QKeyEvent event = QKeyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier);       
                 q->sendAndUpdate(event);
                 event = QKeyEvent(QEvent::KeyRelease, Qt::Key_Backspace, Qt::NoModifier);
                 q->sendAndUpdate(event);
             } else {
                 deleteOneCharacter();
             }
-		}
+        }
         ret = true;
         break;
     
@@ -381,7 +381,7 @@
 
         //The mouse has been clicked on the pre-editing word, launch candidate list
         mInputMethod->launchCandidatePopup(*mCandidates);
-        }	
+        }   
     }
 }
 
@@ -408,12 +408,12 @@
 void HbInputPredictionHandlerPrivate::commit()
 {
     if (mEngine && mEngine->inputLength() > 0 && mCandidates->count() > 0) {
-		
-		// Close exact word pop up in qwerty when the word is committed
-		if(HbInputUtils::isQwertyKeyboard(mInputMethod->inputState().keyboard())) {
-			mInputMethod->closeExactWordPopup();
-		}
-		
+        
+        // Close exact word pop up in qwerty when the word is committed
+        if(HbInputUtils::isQwertyKeyboard(mInputMethod->inputState().keyboard())) {
+            mInputMethod->closeExactWordPopup();
+        }
+        
         QString commitString = getCommitString();
 
         // need to update the freq information
@@ -450,9 +450,9 @@
     Q_Q(HbInputPredictionHandler);
 
     // Close exact word pop up in qwerty when the word is committed
-	if(HbInputUtils::isQwertyKeyboard(mInputMethod->inputState().keyboard())) {
-		mInputMethod->closeExactWordPopup();
-	}
+    if(HbInputUtils::isQwertyKeyboard(mInputMethod->inputState().keyboard())) {
+        mInputMethod->closeExactWordPopup();
+    }
 
     q->commitAndUpdate(string, 0, 0, isAsync);
 
@@ -482,10 +482,10 @@
 {
     Q_Q(HbInputPredictionHandler);
 
-	// Close exact word pop up in qwerty when the word is committed
-	if(HbInputUtils::isQwertyKeyboard(mInputMethod->inputState().keyboard())) {
-		mInputMethod->closeExactWordPopup();
-	}
+    // Close exact word pop up in qwerty when the word is committed
+    if(HbInputUtils::isQwertyKeyboard(mInputMethod->inputState().keyboard())) {
+        mInputMethod->closeExactWordPopup();
+    }
 
     q->sendAndUpdate(event);
 
@@ -531,7 +531,7 @@
         mEngine->deleteKeyPress();
         mEngine->updateCandidates(mBestGuessLocation, isCustomWord);
         if (mCandidates->count()){
-			(*mCandidates)[mBestGuessLocation] = (*mCandidates)[mBestGuessLocation].left(mEngine->inputLength());
+            (*mCandidates)[mBestGuessLocation] = (*mCandidates)[mBestGuessLocation].left(mEngine->inputLength());
             (*mCandidates)[mBestGuessLocation].append("?");
         } else {
             //Should the mBestGuessLocation not be zero. 
@@ -555,7 +555,7 @@
 {
     //update the editor with pre-edit text
     mEngine->setWord(string);
-    bool used = false;	 
+    bool used = false;   
     mEngine->updateCandidates(mBestGuessLocation, used);
     if(showAutocompletionPart && mShowTail) {
         mShowTail = true;
@@ -731,7 +731,7 @@
 void HbInputPredictionHandler::sctCharacterSelected(QString character)
 {
     Q_D(HbInputPredictionHandler);
-	//d->mShowTail = false;
+    //d->mShowTail = false;
     d->commit();
     HbInputModeHandler::sctCharacterSelected(character);
 }
@@ -841,7 +841,7 @@
     if(abstractEdit) {
         abstractEdit->setCursorPosition(abstractEdit->cursorPosition());
     }
-	HbInputMethod::activeInputMethod()->setFocusObject(newFocusObject);
+    HbInputMethod::activeInputMethod()->setFocusObject(newFocusObject);
 
     if (closeReason == HbInputSpellQuery::HbOkPressed) {
         d->commit(string,true);