2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
21 #ifndef AKN_ICON_SRV_CLIENT_H
22 #define AKN_ICON_SRV_CLIENT_H
25 #include <AknIconUtils.h>
27 struct TAknIconParams;
28 struct TAknIconInitData;
30 class CAknIconManager;
34 * A client-side handle to a session with an icon server which allows handling
39 class RAknIconSrvClient : public RSessionBase
42 public: // New functions
45 * C++ default constructor.
50 * Connects AknIconSrv session. It is stored in TLS.
51 * Application framework calls this in application startup.
54 * @return Symbian OS standard error code.
56 IMPORT_C static TInt Connect();
59 * Disconnects the session.
62 IMPORT_C static void Disconnect();
65 * Returns the connected server client from TLS.
67 * @return The connected server client from TLS.
68 * @panic EClientSessionNotConnected @c Connect() has not been called
69 * successfully earlier.
71 static RAknIconSrvClient* GetSession();
73 public: // But not exported.
76 * Initializes the given bitmap and mask according to the member data
77 * stored in them and the given pixel size.
79 * @param[in] aBitmap Bitmap.
80 * @param[in] aMask Mask of the bitmap.
81 * @param[out] aContentDimensions The content dimensions if it is
83 * @param aInfo parameters of the icon.
88 TAknContentDimensions& aContentDimensions,
89 const TAknIconParams& aInfo ) const;
92 * Frees the shared bitmap.
94 * @param aBitmap Bitmap.
96 void FreeBitmap( CAknBitmap& aBitmap ) const;
99 * Gets content dimensions of the icon.
101 * @param[in] aBitmap Bitmap.
102 * @param[out] aContentDimensions The content dimensions of an icon.
103 * @return Symbian OS standard error code .
105 TInt GetContentDimensions(
107 TAknContentDimensions& aContentDimensions ) const;
110 * Preserves icon data (e.g. SVG-T DOM tree) in memory.
112 * @param aBitmap Bitmap.
113 * @return Symbian OS standard error code .
115 TInt PreserveIconData( CAknIconManager& aBitmap ) const;
118 * Removes icon data (e.g. SVG-T DOM tree) from the memory.
120 * @param aBitmap Bitmap.
122 void DestroyIconData( CAknIconManager& aBitmap ) const;
125 * Retrieves initialization data from server side.
127 * @param[out] aData Initialization data.
129 void GetInitData( TAknIconInitData& aData ) const;
132 * Test functions (debug only).
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;
145 * Connects to server.
147 * @return Symbian OS standard error code .
149 TInt ConnectToServer();
152 * Enable or disable the AknIcon cache.
154 * @return Symbian OS standard error code .
156 TInt EnableCache(TBool aEnable);
162 #endif // AKN_ICON_SRV_CLIENT_H