locationsystemui/locationsysui/possettings/poslocationservices/inc/poslocationservices.h
branchRCL_3
changeset 44 2b4ea9893b66
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
       
     1 /*
       
     2  * Copyright (c) 2010 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: This is for Location Based Servies Settings plugin 
       
    15  *							for Advanced View
       
    16  *
       
    17  */
       
    18 
       
    19 #ifndef POSLOCATIONSERVICES_PLUGIN_H
       
    20 #define POSLOCATIONSERVICES_PLUGIN_H
       
    21 
       
    22 #include "poslocationservicesengine.h"
       
    23 
       
    24 #include <QObject>
       
    25 #include <hbdataformmodelitem.h>
       
    26 #include <possettingsadvinterface.h>
       
    27 #include <hbdataformviewitem.h>
       
    28 #include <qsignalmapper.h>
       
    29 
       
    30 
       
    31 //Forward Declaration
       
    32 class PosSettingsAdvOp;
       
    33 class PosSettingsSignalMapper;
       
    34 class HbMessageBox;
       
    35 class HbAction;
       
    36 
       
    37 class PosLocationServices : public QObject, public PosSettingsAdvInterface
       
    38     {
       
    39 Q_OBJECT
       
    40     Q_INTERFACES( PosSettingsAdvInterface)
       
    41 public:
       
    42     /**
       
    43      * Constructor
       
    44      */
       
    45     PosLocationServices();
       
    46 
       
    47     /**
       
    48      * Destructor
       
    49      */
       
    50     ~PosLocationServices();
       
    51 public:
       
    52     /*
       
    53      * Derived from PosSettingsAdvInterface   
       
    54      */
       
    55     virtual int initialise(PosSettingsAdvOp* operation);
       
    56 
       
    57 private:
       
    58     /**
       
    59      * This method is used to list all the location services that are running
       
    60      */
       
    61     void listServices();
       
    62     
       
    63     /**
       
    64      * This method constructs the string for update interval to be displayed in
       
    65      * the second line of the widget.
       
    66      * @param [in]- updateInterval, update interval is seconds, gets from the engine
       
    67      * @param [out]- updateIntervalString, string to be displayed, depending on the update
       
    68      * interval is in day, hour, minute or second
       
    69      */
       
    70     void getUpdateIntervalString(int updateInterval, QString& updateIntervalString);
       
    71 
       
    72 private slots:
       
    73     /**
       
    74      * This is slot, which is called when the user selects the   
       
    75      * service to be deleted
       
    76      */
       
    77     void stopService(int serviceId);
       
    78 
       
    79     /**
       
    80      * This is slot, which is called whenever there is a new location service added or 
       
    81      * a server in the list is stopped. This refreshes the view.
       
    82      */
       
    83     void updateList();
       
    84     
       
    85  	/**
       
    86      * This slot is used to stop sessions.
       
    87      * @param[in] action - Button which is pressed on messagebox dialog
       
    88      */
       
    89     void stopSession(HbAction* action);
       
    90 
       
    91 private:
       
    92 
       
    93     /**
       
    94      * an object if the location services setting engine class
       
    95      */
       
    96     PosLocationServicesEngine* mLocationServiceEngine;
       
    97 
       
    98     /**
       
    99      * an object of data form model item class
       
   100      */
       
   101     HbDataFormModelItem * mGroup;
       
   102 
       
   103     /**
       
   104      * Holds the params of the list of location services
       
   105      */
       
   106     QList<PosLocationServiceInfo> mServiceList;
       
   107 
       
   108     /**
       
   109      * Handle to PosSettingsAdvOp object
       
   110      */
       
   111     PosSettingsAdvOp * mOperation;
       
   112     
       
   113     /**
       
   114      * an object of QSignalMapper 
       
   115      */
       
   116     QSignalMapper * mSignalMapper;
       
   117     
       
   118     /**
       
   119      * hold the signal mapper objects of PosPsySettingsSignalMapper
       
   120      */
       
   121     QList<PosSettingsSignalMapper*> mSignalMapperList;
       
   122     
       
   123 
       
   124     
       
   125     /**
       
   126      * holds the stop service query dialog
       
   127 	 * Owns
       
   128      */
       
   129     HbMessageBox * mStopQuery;
       
   130     
       
   131     /**
       
   132      * holds service id to be stop
       
   133      */
       
   134     int mServiceId;
       
   135     };
       
   136 #endif // POSLOCATIONSERVICES_PLUGIN_H