onlinesearchproviders/isproviderdbmanager/inc/isproviderdbmanager.h
changeset 12 993ab30e92fc
equal deleted inserted replaced
11:773be20e0a25 12:993ab30e92fc
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef ISPROVIDERDBMANAGER_H
       
    19 #define ISPROVIDERDBMANAGER_H
       
    20 
       
    21 #include <qglobal.h>
       
    22 #include <QObject>
       
    23 #include <QtCore/QStringList.h>
       
    24 #include <QSqlDatabase>
       
    25 #include "serviceprovider.h"
       
    26 
       
    27 #if defined(ISPROVIDERDBSERVICES_LIB)
       
    28 #define ISPROVIDERDBLIB_EXPORT Q_DECL_EXPORT
       
    29 #else
       
    30 #define ISPROVIDERDBLIB_EXPORT Q_DECL_IMPORT
       
    31 #endif
       
    32 
       
    33 
       
    34 
       
    35 class QSqlDatabase;
       
    36 
       
    37 /*!
       
    38  *
       
    39  *
       
    40  */
       
    41 class ISPROVIDERDBLIB_EXPORT IsProviderDBManager : public QObject
       
    42 {
       
    43     Q_OBJECT
       
    44     
       
    45 public:
       
    46     IsProviderDBManager( QObject *parent = 0 );
       
    47 	~IsProviderDBManager();
       
    48 
       
    49 	bool GetProviders(QList<ServiceProvider>& providers);
       
    50 	bool GetCountryList(QStringList& countryList);
       
    51 	ServiceProvider* SelectedProvider();
       
    52 	bool SetSelectedProvider(int providerId);
       
    53 	
       
    54 private:
       
    55 	bool OpenDatabase();
       
    56 	void CloseDatabase();
       
    57 	QString GetCountryCode();
       
    58 	
       
    59 private:
       
    60 	QSqlDatabase  m_db;
       
    61 };
       
    62 
       
    63 #endif // ISPROVIDERDBMANAGER_H