homescreenapp/hsutils/inc/hsapptranslator.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 16 Apr 2010 14:54:01 +0300
changeset 36 cdae8c6c3876
parent 35 f9ce957a272c
permissions -rw-r--r--
Revision: 201011 Kit: 201015

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Homescreen application translator class.
*
*/

#ifndef HSAPPTRANSLATOR_H
#define HSAPPTRANSLATOR_H

#include <QObject>
#include <QList>
#include "hsutils_global.h"
#include "hstest_global.h"

HOMESCREEN_TEST_CLASS(t_hsUtils)

class QEvent;
class QTranslator;

class HSUTILS_EXPORT HsAppTranslator : public QObject
{
    Q_OBJECT

public:
    ~HsAppTranslator();
    static HsAppTranslator *instance();

protected:
    bool eventFilter(QObject *watched, QEvent *event);

public:
    void setLanguage();

private:
    void loadTranslators(const QString &locale);
    void removeTranslators();

signals:

    void languageChanged();

private:
    HsAppTranslator(QObject* aParent = 0);
    Q_DISABLE_COPY(HsAppTranslator)
    static HsAppTranslator *mInstance;
    QList<QTranslator *> mTranslatorList;

    HOMESCREEN_TEST_FRIEND_CLASS(t_hsUtils)
};

#endif