messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilParams.h
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 27 e4592d119491
child 37 518b245aa84c
child 79 2981cb3aa489
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
     1 /*
       
     2 * Copyright (c) 2005 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 *  Reads default parameters from resource file for composing MMS SMIL
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef __UNISMILPARAMS_H
       
    22 #define __UNISMILPARAMS_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <e32base.h>
       
    26 #include <barsc.h>
       
    27 #include <f32file.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 *  TUniSmilComposeParam
       
    35 *  Class to hold general SMIL composing parameters
       
    36 *
       
    37 *  @lib     UniDataModel.lib
       
    38 *  @since   3.1
       
    39 */
       
    40 class TUniSmilComposeParam
       
    41     {
       
    42 public:
       
    43     /**
       
    44      *  Default constructor
       
    45      */
       
    46     inline TUniSmilComposeParam();
       
    47 
       
    48     /**
       
    49      *  Copy constructor
       
    50      *  @param   aValues     Source region parameter object.
       
    51      */
       
    52     inline TUniSmilComposeParam(const TUniSmilComposeParam& aValues);
       
    53 
       
    54 public: // data
       
    55     TInt iRootLayoutCompose;    // See r_root_layout_compose
       
    56                                 // explanation in rss file.
       
    57 
       
    58     TInt iDisplayWidth;         // From resources
       
    59     TInt iDisplayHeight;        // From resources
       
    60 
       
    61     TBool iComposeXmlns;        // From resources
       
    62     TInt iSlideDuration;        // From resources
       
    63     TInt iTopPadding;           // From resources
       
    64     TInt iRegionPadding;        // From resources
       
    65     TInt iBottomPadding;        // From resources
       
    66     };
       
    67 
       
    68 
       
    69 /**
       
    70 *  TUniSmilRegionParam
       
    71 *  Class to hold SMIL region attribute values.
       
    72 *  Only supports attributes mentioned in SMIL confomance document.
       
    73 *
       
    74 *  @lib     UniDataModel.lib
       
    75 *  @since   3.1
       
    76 */
       
    77 
       
    78 class TUniSmilRegionParam
       
    79     {
       
    80 public:
       
    81     /**
       
    82      *  Default constructor
       
    83      */
       
    84     inline TUniSmilRegionParam();
       
    85 
       
    86     /**
       
    87      *  Copy constructor
       
    88      *  @param   aValues     Source region parameter object.
       
    89      */
       
    90     inline TUniSmilRegionParam(const TUniSmilRegionParam& aValues);
       
    91 
       
    92     /**
       
    93     *  destructor.
       
    94     */
       
    95     inline ~TUniSmilRegionParam();
       
    96 
       
    97     /**
       
    98     *  Get region width.
       
    99     *  @return  Width of the region.
       
   100     */
       
   101     inline TInt Width();
       
   102 
       
   103     /**
       
   104     *  Get region height.
       
   105     *  @return  Height of the region.
       
   106     */
       
   107     inline TInt Height();
       
   108 
       
   109     /**
       
   110     *  Get region top.
       
   111     *  @return  Top co-ordinate of the region.
       
   112     */
       
   113     inline TInt Top();
       
   114 
       
   115     /**
       
   116     *  Get region left.
       
   117     *  @return  Left co-ordinate of the region.
       
   118     */
       
   119     inline TInt Left();
       
   120 
       
   121     /**
       
   122     *  Set region size.
       
   123     *  @param   aSize
       
   124     */
       
   125     inline void SetSize(const TSize& aSize);
       
   126 
       
   127     /**
       
   128     *  Set top left corner co-ordinates of the region.
       
   129     *  @param   aTl     Top-Left corner co-ordinates of region.
       
   130     */
       
   131     inline void SetTopLeft(const TPoint& aTl);
       
   132 
       
   133 public: // Percent values
       
   134     TInt    iTopPercent;
       
   135     TInt    iLeftPercent;
       
   136     TInt    iWidthPercent;
       
   137     TInt    iHeightPercent;
       
   138     HBufC   *iId;
       
   139     HBufC   *iFit;
       
   140     // Pixel values
       
   141     TSize   iMaxSize;
       
   142     TSize   iMinSize;
       
   143     TSize   iSize;
       
   144     TPoint  iTopLeft;
       
   145 
       
   146 private:
       
   147 
       
   148     };
       
   149 
       
   150 
       
   151 /**
       
   152 *  CUniSmilParams
       
   153 *  Reads MMS SMIL composing default parameters from resources.
       
   154 *
       
   155 *  @lib     UniDataModel.lib
       
   156 *  @since   3.1
       
   157 */
       
   158 class CUniSmilParams : public CBase
       
   159     {
       
   160 public:  // Constructors and destructor
       
   161 
       
   162     /**
       
   163     *  Two-phased constructor.
       
   164     *  @param   aSession     File system session handle to be used.
       
   165     */
       
   166     static CUniSmilParams* NewL( const RFs& aSession );
       
   167 
       
   168     /**
       
   169     *  Two-phased constructor with cleanup stack.
       
   170     *  @param   aSession     File system session handle to be used.
       
   171     */
       
   172     static CUniSmilParams* NewLC( const RFs& aSession );
       
   173 
       
   174     /**
       
   175     *  Destructor.
       
   176     */
       
   177     virtual ~CUniSmilParams();
       
   178 
       
   179 public: // New functions
       
   180 
       
   181 protected:  // Functions from base classes
       
   182 
       
   183 
       
   184 private:
       
   185 
       
   186     /**
       
   187     *  By default Symbian OS constructor is private.
       
   188     */
       
   189     void ConstructL();
       
   190 
       
   191     /**
       
   192     *  C++ default constructor is private.
       
   193     *  @param   aSession     File system session handle to be used.
       
   194     */
       
   195     CUniSmilParams( const RFs& aSession );
       
   196 
       
   197     /**
       
   198     *  Reads the region string and integer constants
       
   199     *  from the resource file.
       
   200     */
       
   201     void ReadResourcesL();
       
   202 
       
   203     /**
       
   204     *  Opens the resource file for reading
       
   205     *  @param   aResFile     Resource file handle to be used.
       
   206     */
       
   207     void OpenResourceFileL( RResourceFile& aResFile );
       
   208 
       
   209     /**
       
   210     *  Reads general composing params from the reousrce file.
       
   211     *  @param   aResFile     Resource file handle to be used.
       
   212     */
       
   213     void ReadComposeParamResourcesL(
       
   214             const RResourceFile& aResFile );
       
   215 
       
   216     /**
       
   217     *  Reads image region defaults from the resource file.
       
   218     */
       
   219     void ReadImageRegionResourcesL(
       
   220             const RResourceFile& resourceFile );
       
   221 
       
   222     /**
       
   223     *  Reads text region defaults from the resource file.
       
   224     *  @param   aResFile     Resource file handle to be used.
       
   225     */
       
   226     void ReadTextRegionResourcesL(
       
   227             const RResourceFile& resourceFile );
       
   228 
       
   229 
       
   230 private:    // Data
       
   231     const RFs&              iSession;
       
   232 
       
   233 public:    // Data
       
   234     // General compose parameters
       
   235     TUniSmilComposeParam    *iComposeParams;
       
   236     TUniSmilRegionParam     *iImageRegionParams;
       
   237     TUniSmilRegionParam     *iTextRegionParams;
       
   238 
       
   239     };
       
   240 
       
   241 #include <UniSmilParams.inl>
       
   242 
       
   243 #endif // __UNISMILPARAMS_H
       
   244 
       
   245 // End of File