epoc32/include/mw/akniconsrvclient.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2002 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 
    19 
    20 
    21 #ifndef AKN_ICON_SRV_CLIENT_H
    22 #define AKN_ICON_SRV_CLIENT_H
    23 
    24 #include <e32base.h>
    25 #include <AknIconUtils.h>
    26 
    27 struct TAknIconParams;
    28 struct TAknIconInitData;
    29 class CAknBitmap;
    30 class CAknIconManager;
    31 
    32 
    33 /**
    34  * A client-side handle to a session with an icon server which allows handling
    35  * icons (bitmaps).
    36  * 
    37  * @since 3.0
    38  */
    39 class RAknIconSrvClient : public RSessionBase
    40     {
    41     
    42     public: // New functions
    43 
    44         /**
    45          * C++ default constructor.
    46          */      
    47         RAknIconSrvClient();
    48 
    49         /**
    50          * Connects AknIconSrv session. It is stored in TLS.
    51          * Application framework calls this in application startup.
    52          *
    53          * @since 3.0
    54          * @return Symbian OS standard error code.
    55          */      
    56         IMPORT_C static TInt Connect();
    57 
    58         /**
    59          * Disconnects the session.
    60          * @since 3.0
    61          */
    62         IMPORT_C static void Disconnect();
    63 
    64         /**
    65          * Returns the connected server client from TLS.
    66          *
    67          * @return The connected server client from TLS.
    68          * @panic EClientSessionNotConnected @c Connect() has not been called
    69          *        successfully earlier.
    70          */
    71         static RAknIconSrvClient* GetSession();
    72 
    73     public: // But not exported.
    74 
    75         /**
    76          * Initializes the given bitmap and mask according to the member data 
    77          * stored in them and the given pixel size.
    78          *
    79          * @param[in] aBitmap Bitmap.
    80          * @param[in] aMask Mask of the bitmap.
    81          * @param[out] aContentDimensions The content dimensions if it is 
    82          *             a SVG icon.
    83          * @param aInfo parameters of the icon.
    84          */
    85         void InitializeIconL( 
    86                 CAknBitmap& aBitmap,
    87                 CAknBitmap& aMask,
    88                 TAknContentDimensions& aContentDimensions, 
    89                 const TAknIconParams& aInfo ) const;
    90 
    91         /**
    92          * Frees the shared bitmap.
    93          *
    94          * @param aBitmap Bitmap.
    95          */
    96         void FreeBitmap( CAknBitmap& aBitmap ) const;
    97 
    98         /**
    99          * Gets content dimensions of the icon.
   100          *
   101          * @param[in] aBitmap Bitmap.
   102          * @param[out] aContentDimensions The content dimensions of an icon.
   103          * @return Symbian OS standard error code .
   104          */
   105         TInt GetContentDimensions( 
   106                 CAknBitmap& aBitmap, 
   107                 TAknContentDimensions& aContentDimensions ) const;
   108 
   109         /**
   110          * Preserves icon data (e.g. SVG-T DOM tree) in memory.
   111          *
   112          * @param aBitmap Bitmap.
   113          * @return Symbian OS standard error code .
   114          */
   115         TInt PreserveIconData( CAknIconManager& aBitmap ) const;
   116 
   117         /**
   118          * Removes icon data (e.g. SVG-T DOM tree) from the memory.
   119          *
   120          * @param aBitmap Bitmap.
   121          */
   122         void DestroyIconData( CAknIconManager& aBitmap ) const;
   123 
   124         /**
   125          * Retrieves initialization data from server side.
   126          *
   127          * @param[out] aData Initialization data.
   128          */
   129         void GetInitData( TAknIconInitData& aData ) const;
   130 
   131         /**
   132          * Test functions (debug only).
   133          */
   134         void __SERVER_HEAP_MARK() const;
   135         void __SERVER_HEAP_MARKEND() const;
   136         void __SERVER_HEAP_FAILNEXT( TInt aCount ) const;
   137         void __SERVER_HEAP_FAILNEXT_INCREASING( TInt aCount ) const;
   138         void __SERVER_HEAP_RESET() const;
   139         void __SERVER_RESET_DYNAMICALLY_CHANGING_ALLOCATIONS() const;
   140         TInt __SERVER_HEAP_USED() const;
   141         void __SERVER_SET_PREFERRED_ICON_DISPLAY_MODE(
   142                                                     TDisplayMode aMode ) const;
   143 
   144         /**
   145          * Connects to server.
   146          *
   147          * @return Symbian OS standard error code .
   148          */
   149         TInt ConnectToServer();
   150         
   151 		/**
   152 		 * Enable or disable the AknIcon cache.
   153 		 *
   154 		 * @return Symbian OS standard error code .
   155   		 */
   156         TInt EnableCache(TBool aEnable);
   157 
   158     private: // Data
   159         TInt iConnections;
   160     };
   161 
   162 #endif // AKN_ICON_SRV_CLIENT_H
   163 
   164 // End of File