mediasettings/mediasettingsengine/inc/MPSettingsModelForROP.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     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 the License "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:    MMF ROP plugin specific settings model.*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 // Version : %version: 6 %
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 #ifndef MPSETTINGSMODELFORROP_H
       
    25 #define MPSETTINGSMODELFORROP_H
       
    26 
       
    27 //  INCLUDES
       
    28 #include    <e32base.h> 
       
    29 #include    <centralrepository.h>
       
    30 #include    <mmf/common/mmfcontroller.h>
       
    31 #include    "mpsettingsmodel.h"
       
    32 
       
    33 class CMPRopSettingItem;
       
    34 class CMPSettingsRopConfigParser;
       
    35 class CCommsDatabase;
       
    36 class CApUtils;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  CMPSettingsModelForROP
       
    42 *  MMF ROP plugin specific settings model.
       
    43 *
       
    44 *  @lib MPSettEngine.dll
       
    45 *  @since 2.0
       
    46 */
       
    47 class CMPSettingsModelForROP : public CMPSettingsModel
       
    48     {
       
    49     public:  // Constructors and destructor
       
    50         
       
    51         /**
       
    52         * Two-phased constructor.
       
    53         */
       
    54         static CMPSettingsModelForROP* NewL();
       
    55         
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         virtual ~CMPSettingsModelForROP();
       
    60 
       
    61     public: // Functions from base classes
       
    62 
       
    63         /**
       
    64         * From MMPSettingsModel, provides uid of the MMF controller,
       
    65         * which settings this class handles
       
    66         * @since 2.0
       
    67         * @return MMF controller UID
       
    68         */
       
    69         const TUid MMFControllerID();
       
    70         
       
    71         /**
       
    72         * From MMPSettingsModel,
       
    73         * @since 2.0
       
    74         */
       
    75         void LoadSettingsL(TInt aConfigVersion);
       
    76 
       
    77         /**
       
    78         * From MMPSettingsModel, 
       
    79         * @since 2.0
       
    80         */
       
    81         void StoreSettingsL();
       
    82 
       
    83         /**
       
    84         * From MMPSettingsModel, sets video contrast
       
    85         * @since 2.0
       
    86         * @param aContrast Contrast level
       
    87         * @return Error value.
       
    88         */
       
    89         TInt SetVideoContrast(TInt aContrast);
       
    90 
       
    91         /**
       
    92         * From MMPSettingsModel, returns video contrast level.
       
    93         * @since 2.0
       
    94         * @param aContrast Contrast level:
       
    95         * @return Error value.
       
    96         */
       
    97         TInt GetVideoContrast(TInt& aContrast);
       
    98 
       
    99         /**
       
   100         * From MMPSettingsModel, sets proxy mode..
       
   101         * @since 2.0
       
   102         * @param aMode Proxy mode.
       
   103         * @return Error value.
       
   104         */
       
   105         TInt SetProxyMode(TInt aMode);
       
   106         
       
   107         /**
       
   108         * From MMPSettingsModel, returns proxy mode.
       
   109         * @since 2.0
       
   110         * @param aMode Proxy mode:
       
   111         *         0:    Disabled
       
   112         *         1:    Enabled
       
   113         * @return Error value.
       
   114         */
       
   115         TInt GetProxyMode(TInt& aMode);
       
   116 
       
   117         /**
       
   118         * From MMPSettingsModel, sets Proxy host name.
       
   119         * @since 2.0
       
   120         * @param aHostName Proxy host name.
       
   121         * @return Error value.
       
   122         */
       
   123         TInt SetProxyHostNameL(const TDesC& aHostName);
       
   124         
       
   125         /**
       
   126         * From MMPSettingsModel, returns proxy host name.
       
   127         * @since 2.0
       
   128         * @param aHostName Proxy host name.
       
   129         * @return Error value.
       
   130         */
       
   131         TInt GetProxyHostName(TDes& aHostName);
       
   132 
       
   133         /**
       
   134         * From MMPSettingsModel, sets proxy port number.
       
   135         * @since 2.0
       
   136         * @param aPort Proxy port number.
       
   137         * @return Error value.
       
   138         */
       
   139         TInt SetProxyPort(TInt aPort);
       
   140         
       
   141         /**
       
   142         * From MMPSettingsModel, returns proxy port number..
       
   143         * @since 2.0
       
   144         * @return Integer: Proxy port number.
       
   145         * @return Error value.
       
   146         */
       
   147         TInt GetProxyPort(TInt& aPort);
       
   148         
       
   149         /**
       
   150         * From MMPSettingsModel, sets default access point.
       
   151         * @since 2.0
       
   152         * @param aApId Access point ID.
       
   153         * @return Error value.
       
   154         */
       
   155         TInt SetDefaultAp(TUint32 aApId);
       
   156 
       
   157         /**
       
   158         * From MMPSettingsModel, returns default access point ID.
       
   159         * @since 2.0
       
   160         * @param aApId Access point ID.
       
   161         * @return Error value.
       
   162         */
       
   163         TInt GetDefaultAp(TUint32& aApId);
       
   164 
       
   165         /**
       
   166         * Sets bandwidth control mode.
       
   167         * @since 2.0
       
   168         * @param aMode bandwidth control mode.
       
   169         * @return Error value.
       
   170         */
       
   171         TInt SetBandwidthControlMode(TInt aMode);
       
   172         
       
   173         /**
       
   174         * Returns bandwidth control mode.
       
   175         * @since 2.0
       
   176         * @param aMode bandwidth control mode:
       
   177         *           0: Use dynamic bw control if possible
       
   178         *           1: Use static bw control
       
   179         * @return Error value.
       
   180         */
       
   181         TInt GetBandwidthControlMode(TInt& aMode);
       
   182 
       
   183         /**
       
   184         * From MMPSettingsModel, sets maximum bandwidth.
       
   185         * @since 2.0
       
   186         * @param aMaxBw Maximum bandwidth.
       
   187         * @param aBearer Bearer, which max bw is set.
       
   188         * @return Error value.
       
   189         */
       
   190         TInt SetMaxBandwidth(TInt aMaxBw, TDataBearer aBearer);
       
   191         
       
   192         /**
       
   193         * From MMPSettingsModel, returns maximum bandwidth.
       
   194         * @since 2.0
       
   195         * @param aMaxBw Maximum bandwidth.
       
   196         * @param aBearer Bearer, which max bw is enquired.
       
   197         * @return Error value.
       
   198         */
       
   199         TInt GetMaxBandwidth(TInt& aMaxBw, TDataBearer aBearer);
       
   200 
       
   201         /**
       
   202         * From MMPSettingsModel, sets connection timeout.
       
   203         * @since 2.0
       
   204         * @param aTimeout Timeout in minutes.
       
   205         * @return Error value.
       
   206         */
       
   207         TInt SetConnectionTimeout(TInt aTimeout);
       
   208         
       
   209         /**
       
   210         * From MMPSettingsModel, returns connection timeout.
       
   211         * @since 2.0
       
   212         * @param aTimeout Timeout in minutes.
       
   213         * @return Error value.
       
   214         */
       
   215         TInt GetConnectionTimeout(TInt& aTimeout);
       
   216         
       
   217         /**
       
   218         * From MMPSettingsModel, sets server timout.
       
   219         * @since 2.0
       
   220         * @param aTimeout Timeout in minutes.
       
   221         * @return Error value.
       
   222         */
       
   223         TInt SetServerTimeout(TInt aTimeout);
       
   224         
       
   225         /**
       
   226         * From MMPSettingsModel, returns server timeout.
       
   227         * @since 2.0
       
   228         * @param aTimeout Timeout in minutes.
       
   229         * @return Error value.
       
   230         */
       
   231         TInt GetServerTimeout(TInt& aTimeout);
       
   232 
       
   233         /**
       
   234         * From MMPSettingsModel, sets minimum UDP port number.
       
   235         * @since 2.0
       
   236         * @param aPort minimum port number.
       
   237         * @return Error value.
       
   238         */
       
   239         TInt SetMinUDPPort(TInt aPort);
       
   240 
       
   241         /**
       
   242         * From MMPSettingsModel, returns minimum UDP port number.
       
   243         * @since 2.0
       
   244         * @param aPort minimum UDP port number in minutes.
       
   245         * @return Error value.
       
   246         */
       
   247         TInt GetMinUDPPort(TInt& aPort);
       
   248 
       
   249         /**
       
   250         * From MMPSettingsModel, sets maximum UDP port number.
       
   251         * @since 2.0
       
   252         * @param aPort maximum port number.
       
   253         * @return Error value.
       
   254         */
       
   255         TInt SetMaxUDPPort(TInt aPort);
       
   256 
       
   257         /**
       
   258         * From MMPSettingsModel, returns maximum UDP port number.
       
   259         * @since 2.0
       
   260         * @param aPort maximum UDP port number in minutes.
       
   261         * @return Error value.
       
   262         */
       
   263         TInt GetMaxUDPPort(TInt& aPort);
       
   264 
       
   265         /**
       
   266         * Provides MMF controller version information.
       
   267         * @since 2.0
       
   268         * @param aVersion Controller version number.
       
   269         * @return Error value.
       
   270         */
       
   271         TInt GetControllerVersionInfo(TDes& aVersion);
       
   272             
       
   273         /**
       
   274         * Provides MMF controller's build date.
       
   275         * @since 2.0
       
   276         * @param aBldDate Controller build date.
       
   277         * @return Error value.
       
   278         */
       
   279         TInt GetControllerBuildDate(TDes& aBldDate);
       
   280 
       
   281         /**
       
   282         * Provides additional information about MMF controller.
       
   283         * @since 2.0
       
   284         * @param aAdditionalInfo Additional controller information.
       
   285         * @return Error value.
       
   286         */
       
   287         TInt GetControllerAdditionalInfo(TDes& aAdditionalInfo);
       
   288 
       
   289         /**
       
   290         * Sets demand bandwidth factor.
       
   291         * @since 2.1
       
   292         * @param aFactor Demand bandwidth factor.
       
   293         * @return Error value.
       
   294         */
       
   295         TInt SetDemandBwFactor(TInt aFactor);
       
   296 
       
   297         /**
       
   298         * Returns demand factor bandwidth.
       
   299         * @since 2.1
       
   300         * @param aFactor Demand bandwidth factor.
       
   301         * @return Error value.
       
   302         */
       
   303         TInt GetDemandBwFactor(TInt& aFactor); 
       
   304 
       
   305         /**
       
   306         * Sets sustainable bandwidth.
       
   307         * @since 2.1
       
   308         * @param aSustainBw Sustainable bandwidth.
       
   309         * @param aBearer Bearer, which max bw is set.
       
   310         * @return Error value.
       
   311         */
       
   312         TInt SetSustainBandwidth(TInt aSustainBw, TDataBearer aBearer);
       
   313         
       
   314         /**
       
   315         * Returns sustainable bandwidth.
       
   316         * @since 2.1
       
   317         * @param aSustainBw Sustainable bandwidth.
       
   318         * @param aBearer Bearer, which max bw is enquired.
       
   319         * @return Error value.
       
   320         */
       
   321         TInt GetSustainBandwidth(TInt& aSustainBw, TDataBearer aBearer);
       
   322 
       
   323         /**
       
   324         * Returns an array of the fixed sustainable bandwidth values.
       
   325         * @since 2.1
       
   326         * @param aBwArray Fixed sustain bandwidth values are copied to this array.
       
   327         * @param aBearer Bearer, which fixed sustain bw values is enquired.
       
   328         * @return Error value.
       
   329         */
       
   330         TInt GetSustainBwPresetsL(RArray<TInt>& aBwArray, TDataBearer aBearer);
       
   331 
       
   332         /**
       
   333         * Returns an array of the fixed max bandwidth values.
       
   334         * @since 2.1
       
   335         * @param aBwArray Fixed max bandwidth values are copied to this array.
       
   336         * @param aBearer Bearer, which fixed max bw values is enquired.
       
   337         * @return Error value.
       
   338         */
       
   339         TInt GetMaxBwPresetsL(RArray<TInt>& aBwArray, TDataBearer aBearer);
       
   340 
       
   341      public:  // value to / from MediaPlayer Repository
       
   342 	/**
       
   343         * Returns video repeat mode.
       
   344         * @since 2.0
       
   345         * @return ETrue:    On
       
   346         *         EFalse:   Off
       
   347         */
       
   348         TBool IsVideoRepeatOnL();
       
   349 
       
   350         /**
       
   351         * Sets video repeat mode. Deprecated.
       
   352         * @since 2.0
       
   353         * @param aRepeat Repeat mode.
       
   354         */
       
   355         void SetVideoRepeatL(const TBool aRepeat);
       
   356 
       
   357 		/**
       
   358         * Returns default view mode. Deprecated.
       
   359         * @since 3.2
       
   360         * @return ETrue:    On  (Normal-screen view)
       
   361         *         EFalse:   Off (Full-screen view)
       
   362         */
       
   363         TBool IsDefaultViewOnL();
       
   364 
       
   365         /**
       
   366         * Sets default view mode.
       
   367         * @since 3.2
       
   368         * @param aView Default view mode.
       
   369         */
       
   370         void SetDefaultViewL(const TBool aView);
       
   371 
       
   372 		/**
       
   373         * Returns if Rocker Keys Feature is supported
       
   374         * @since 3.2
       
   375         * @return ETrue:    - Rocker Keys feature is supported
       
   376         *         EFalse:   - Rocker Keys feature is not supported
       
   377         */
       
   378         TBool IsRockerKeysSupportedL();
       
   379 
       
   380         /**
       
   381         * Sets rocker keys mode.
       
   382         * @since 3.2
       
   383         * @param aRockerKeys rocker keys mode.
       
   384         */
       
   385         void SetRockerKeysL(const TBool aRockerKeys);
       
   386 
       
   387 		/**
       
   388         * Returns Rocker Keys mode
       
   389         * @since 3.2
       
   390         * @return ETrue:    Show (Rocker Keys are shown)
       
   391         *         EFalse:   Hide (Rocker Keys are hidden)
       
   392         */
       
   393 		TBool ShowRockerKeysL();
       
   394 
       
   395 	/**
       
   396         * Sets Media Player auto disconnection time.
       
   397         * @since 2.0
       
   398         * @param aTime Auto disconnection time.
       
   399         */
       
   400         void SetAutoDisconTimeL(const TInt aTime);
       
   401 
       
   402         /**
       
   403         * Returns Media Player auto disconnection time.
       
   404         * @since 2.0
       
   405         * @return 0:    Unlimited time
       
   406         *         1-99: Time in minutes
       
   407         */
       
   408         TInt AutoDisconTimeL();
       
   409 
       
   410 
       
   411     private:
       
   412 
       
   413         /**
       
   414         * C++ default constructor.
       
   415         */
       
   416         CMPSettingsModelForROP();
       
   417 
       
   418         /**
       
   419         * By default Symbian 2nd phase constructor is private.
       
   420         */
       
   421         void ConstructL();
       
   422 
       
   423     private:
       
   424 
       
   425         /**
       
   426         * Function for setting an integer value to iItems
       
   427         * array according to item id.
       
   428         */
       
   429         TInt SetIntegerValue(TInt aId, TInt aValue);
       
   430 
       
   431         /**
       
   432         * Function for getting an integer value from iItems
       
   433         * array according to item id.
       
   434         */
       
   435         TInt GetIntegerValue(TInt aId, TInt& aValue);
       
   436 
       
   437         /**
       
   438         * Function for getting an string value from iItems
       
   439         * array according to item id.
       
   440         */
       
   441         TInt GetStringValue(TInt aId, TDes& aString);
       
   442 
       
   443         /**
       
   444         * Resets aArray and populates it with values from iIntArray.
       
   445         * aId is the id of an item from iItems, which iIntArray
       
   446         * is copied.
       
   447         */
       
   448         TInt GetArrayL(TInt aId, RArray<TInt>& aArray);
       
   449 
       
   450         /**
       
   451         * Finds item from iItems according to it's id.
       
   452         */
       
   453         TInt GetItem(TInt aId, CMPRopSettingItem*& aItem);
       
   454 
       
   455         /**
       
   456         * Locates the resource file searching from y: to a: and then z: last.
       
   457         *
       
   458         * @param aFileName Full path to resource file.
       
   459         * @param aFs File server session.
       
   460         */
       
   461         void LocateResourceFileL( TFileName& aFileName, RFs& aFs );
       
   462     
       
   463         /**
       
   464          * Gets WAP id from IAP id. Leaves with KErrNotFound if no record with given 
       
   465          * IAP id is found.
       
   466          * 
       
   467          * @return WAP id matching the given IAP id.
       
   468          */
       
   469         TUint32 WapIdFromIapIdL( TUint32 aIapId );
       
   470 
       
   471         /**
       
   472          * Gets WAP id from IAP id. Leaves with KErrNotFound if no record with given 
       
   473          * IAP id is found.
       
   474          * 
       
   475          * @return WAP id matching the given IAP id.
       
   476          */
       
   477         TUint32 IapIdFromWapIdL( TUint32 aWapId );        
       
   478         
       
   479     private: // new
       
   480            
       
   481 	void InitializeCentralRepositoryL();
       
   482 	void UninitializeCentralRepository();
       
   483 
       
   484 
       
   485     private:    // Data
       
   486 
       
   487         //Central repository objects
       
   488         CRepository* iClient;
       
   489 		CRepository* iMediaPlayerClient;
       
   490 
       
   491         CArrayPtr<CMPRopSettingItem>* iItems;
       
   492         CMPSettingsRopConfigParser* iParser;
       
   493 
       
   494         HBufC8* iROPSettings;
       
   495         HBufC8* iROPHeader;
       
   496 
       
   497         RMMFController iMMFController;      
       
   498         CCommsDatabase* iCommDb;
       
   499         CApUtils* iApUtils;
       
   500     };
       
   501 
       
   502 #endif      // MPSETTINGSMODELFORROP_H   
       
   503             
       
   504 // End of File