src/hbcore/inputfw/hbinputmodecache.cpp
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
child 3 11d3954df52a
equal deleted inserted replaced
0:16d8024aca5e 1:f7ac710697a9
   246     }
   246     }
   247 }
   247 }
   248 /// @endcond
   248 /// @endcond
   249 
   249 
   250 /*!
   250 /*!
       
   251 \internal
   251 Returns the singleton instance.
   252 Returns the singleton instance.
   252 */
   253 */
   253 HbInputModeCache* HbInputModeCache::instance()
   254 HbInputModeCache* HbInputModeCache::instance()
   254 {
   255 {
   255     static HbInputModeCache theCache;
   256     static HbInputModeCache theCache;
   256     return &theCache;
   257     return &theCache;
   257 }
   258 }
   258 
   259 
   259 /*!
   260 /*!
       
   261 \internal
   260 Construct the object.
   262 Construct the object.
   261 */
   263 */
   262 HbInputModeCache::HbInputModeCache() : d_ptr(new HbInputModeCachePrivate())
   264 HbInputModeCache::HbInputModeCache() : d_ptr(new HbInputModeCachePrivate())
   263 {
   265 {
   264     Q_D(HbInputModeCache);
   266     Q_D(HbInputModeCache);
   269 
   271 
   270     d->refresh();
   272     d->refresh();
   271 }
   273 }
   272 
   274 
   273 /*!
   275 /*!
       
   276 \internal
   274 Destruct the object.
   277 Destruct the object.
   275 */
   278 */
   276 HbInputModeCache::~HbInputModeCache()
   279 HbInputModeCache::~HbInputModeCache()
   277 {
   280 {
   278     delete d_ptr;
   281     delete d_ptr;
   279 }
   282 }
   280 
   283 
   281 /*!
   284 /*!
       
   285 \internal
   282 This slot is called whenever a change in input method plugin file system is detected and
   286 This slot is called whenever a change in input method plugin file system is detected and
   283 the list needs to be refreshed.
   287 the list needs to be refreshed.
   284 */
   288 */
   285 void HbInputModeCache::directoryChanged(const QString &directory)
   289 void HbInputModeCache::directoryChanged(const QString &directory)
   286 {
   290 {
   292         d->refresh(directory);
   296         d->refresh(directory);
   293     }
   297     }
   294 }
   298 }
   295 
   299 
   296 /*!
   300 /*!
       
   301 \internal
   297 Shuts down the object safely. This is needed mainly for singleton object. There has been a lot
   302 Shuts down the object safely. This is needed mainly for singleton object. There has been a lot
   298 of problems related to randown singleton desctruction order and additional shutdown step is
   303 of problems related to randown singleton desctruction order and additional shutdown step is
   299 needed to guarantee that it will be done safely. The slot is connected to
   304 needed to guarantee that it will be done safely. The slot is connected to
   300 QCoreApplication::aboutToQuit when the framework is initialized.
   305 QCoreApplication::aboutToQuit when the framework is initialized.
   301 */
   306 */
   312     delete d->mWatcher;
   317     delete d->mWatcher;
   313     d->mWatcher = 0;
   318     d->mWatcher = 0;
   314 }
   319 }
   315 
   320 
   316 /*!
   321 /*!
       
   322 \internal
   317 Loads given input method and caches it.
   323 Loads given input method and caches it.
   318 */
   324 */
   319 HbInputMethod* HbInputModeCache::loadInputMethod(const HbInputMethodDescriptor &inputMethod)
   325 HbInputMethod* HbInputModeCache::loadInputMethod(const HbInputMethodDescriptor &inputMethod)
   320 {
   326 {
   321     Q_D(HbInputModeCache);
   327     Q_D(HbInputModeCache);
   333 
   339 
   334     return 0;
   340     return 0;
   335 }
   341 }
   336 
   342 
   337 /*!
   343 /*!
       
   344 \internal
   338 Lists custom input methods.
   345 Lists custom input methods.
   339 */
   346 */
   340 QList<HbInputMethodDescriptor> HbInputModeCache::listCustomInputMethods()
   347 QList<HbInputMethodDescriptor> HbInputModeCache::listCustomInputMethods()
   341 {
   348 {
   342     Q_D(HbInputModeCache);
   349     Q_D(HbInputModeCache);
   355 
   362 
   356     return result;
   363     return result;
   357 }
   364 }
   358 
   365 
   359 /*!
   366 /*!
   360  Find correct handler for given input state.
   367 \internal
   361  */
   368 Find correct handler for given input state.
       
   369 */
   362 HbInputMethod* HbInputModeCache::findStateHandler(const HbInputState& state)
   370 HbInputMethod* HbInputModeCache::findStateHandler(const HbInputState& state)
   363 {
   371 {
   364     Q_D(HbInputModeCache);
   372     Q_D(HbInputModeCache);
   365 
   373 
   366     HbInputModeProperties stateProperties = d->propertiesFromState(state);
   374     HbInputModeProperties stateProperties = d->propertiesFromState(state);
   407 
   415 
   408     return 0;
   416     return 0;
   409 }
   417 }
   410 
   418 
   411 /*!
   419 /*!
   412  Returns the active input method.
   420 \internal
   413 
   421 Returns the active input method.
   414  \sa HbInputMethod
   422 
   415  */
   423 \sa HbInputMethod
       
   424 */
   416 HbInputMethod* HbInputModeCache::activeMethod() const
   425 HbInputMethod* HbInputModeCache::activeMethod() const
   417 {
   426 {
   418     Q_D(const HbInputModeCache);
   427     Q_D(const HbInputModeCache);
   419 
   428 
   420     foreach (HbInputMethodListItem item, d->mMethods) {
   429     foreach (HbInputMethodListItem item, d->mMethods) {
   425 
   434 
   426     return 0;
   435     return 0;
   427 }
   436 }
   428 
   437 
   429 /*!
   438 /*!
       
   439 \internal
   430 Lists available input languages.
   440 Lists available input languages.
   431 */
   441 */
   432 QList<HbInputLanguage> HbInputModeCache::listInputLanguages() const
   442 QList<HbInputLanguage> HbInputModeCache::listInputLanguages() const
   433 {
   443 {
   434     Q_D(const HbInputModeCache);
   444     Q_D(const HbInputModeCache);