/ime/latinime/src/com/googlecode/eyesfree/inputmethod/latin/tutorial/TutorialController.java

http://eyes-free.googlecode.com/ · Java · 97 lines · 15 code · 13 blank · 69 comment · 0 complexity · 6bf5b797a108db8c1be743578253fbbe MD5 · raw file

  1. /*
  2. * Copyright (C) 2011 Google Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.googlecode.eyesfree.inputmethod.latin.tutorial;
  17. import android.content.Intent;
  18. /**
  19. * @author alanv@google.com (Alan Viverette)
  20. */
  21. public interface TutorialController {
  22. /** Moves to the next tutorial. */
  23. public void next();
  24. /**
  25. * Skips the specified number of tutorials. Calling skip(0) is equivalent to
  26. * calling {@link TutorialController#next()}.
  27. *
  28. * @param count The number of tutorials to skip.
  29. */
  30. public void skip(int count);
  31. /** Moves to the previous tutorial. */
  32. public void previous();
  33. /**
  34. * Shows the tutorial at the specified index.
  35. *
  36. * @param index The index of the tutorial to show.
  37. */
  38. public void show(int index);
  39. /**
  40. * Returns the current keyboard mode.
  41. *
  42. * @return The current keyboard mode.
  43. * @see com.googlecode.eyesfree.inputmethod.latin.KeyboardSwitcher#getKeyboardMode()
  44. */
  45. public int getKeyboardMode();
  46. /**
  47. * Requests a current keyboard mode update.
  48. */
  49. public void requestKeyboardModeUpdate();
  50. /**
  51. * Attempts to set the current keyboard mode.
  52. *
  53. * @param mode The desired mode.
  54. * @see com.googlecode.eyesfree.inputmethod.latin.KeyboardSwitcher#setKeyboardMode(int)
  55. */
  56. public void setKeyboardMode(int mode);
  57. /**
  58. * Queues text for speaking.
  59. *
  60. * @param text The text to speak.
  61. * @param utteranceId The utterance id for completion callbacks.
  62. */
  63. public void speak(String text, int utteranceId);
  64. /**
  65. * Runs the specified runnable on the UI thread.
  66. *
  67. * @param r The runnable to run.
  68. */
  69. public void runOnUiThread(Runnable r);
  70. /**
  71. * Starts an activity with the given intent and returns to the tutorial
  72. * activity's onActivityResult(int, int, Intent) method with the specified
  73. * request code.
  74. *
  75. * @param intent
  76. * @param requestCode
  77. * @see android.app.Activity#startActivityForResult(Intent, int)
  78. */
  79. public void startActivityForResult(Intent intent, int requestCode);
  80. /**
  81. * Closes and exits the tutorial.
  82. */
  83. public void finish();
  84. }