scrsaver/scrsaverplugins/BmpAnimScrPlugin/inc/CBmpAnimIniData.h
branchRCL_3
changeset 26 e8d784ac1a4b
parent 0 040fcad49f44
equal deleted inserted replaced
25:aaeeca1f15af 26:e8d784ac1a4b
       
     1 /*
       
     2 * Copyright (c) 2003 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:   Bitmap animator INI file handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CBMPANIMINIDATA_H
       
    21 #define C_CBMPANIMINIDATA_H
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class CBmpAnimIniData : public CBase 
       
    26 	{
       
    27 public:
       
    28 	// Constructor, pass in name of ini file to open
       
    29 	// Default search path is 'c:\system\data' on target filesystem
       
    30 	// ie. 'NewL(_L("c:\\system\\data\\ttools.ini"))' is equivalent 
       
    31 	// to 'NewL(_L("ttools.ini"))' 
       
    32 	static CBmpAnimIniData* NewL(const TDesC& aName);
       
    33 	virtual ~CBmpAnimIniData();
       
    34 
       
    35     // Read text value regardless of section
       
    36     // Returns: True(Success) or false(Failure)
       
    37     TBool FindVar(const TDesC8& aKeyName, TDes16& aResult);
       
    38     TBool FindVar(const TDesC8& aKeyName, TPtrC8& aResult);
       
    39 
       
    40     // Read integer value regardless of section
       
    41     // Returns: True(Success) or false(Failure)
       
    42     TBool FindVar(const TDesC8& aKeyName, TInt& aResult);
       
    43 
       
    44     // Read text value under section
       
    45     // Returns: True(Success) or false(Failure)
       
    46     TBool FindVar(
       
    47         const TDesC8& aSection, const TDesC8& aKeyName, TDes16& aResult);
       
    48     TBool FindVar(
       
    49         const TDesC8& aSection, const TDesC8& aKeyName, TPtrC8& aResult);
       
    50 
       
    51     // Read integer value under section
       
    52     // Returns: True(Success) or false(Failure)
       
    53     TBool FindVar(
       
    54         const TDesC8& aSection, const TDesC8& aKeyName, TInt& aResult);
       
    55 
       
    56     // Write integer value associated with a token
       
    57     TInt WriteVarL(
       
    58         const TDesC8& aSection, const TDesC8& aKeyName, TInt aValue);
       
    59 
       
    60     // Write string associated with a token
       
    61     TInt WriteVarL(
       
    62         const TDesC8& aSection, const TDesC8& aKeyName, const TDesC8& aValue);
       
    63 
       
    64     // Commits the changes done. NOTE if not called, the changes will NOT
       
    65     // be saved into file
       
    66     void CommitL();
       
    67 
       
    68 
       
    69 protected:
       
    70     CBmpAnimIniData();
       
    71     void ConstructL(const TDesC& aName);
       
    72 
       
    73 private:
       
    74     // Tries to locate the given section. EFalse if not found
       
    75     TBool FindSection(const TDesC8& aSection, TInt& aStart, TInt& aEnd);
       
    76     
       
    77 private:
       
    78     HBufC* iName;
       
    79     HBufC8* iToken;
       
    80     TPtr8 iPtr;         // Holds the file in memory, written back in CommitL()
       
    81     };
       
    82 
       
    83 #endif // C_CBMPANIMINIDATA_H
       
    84