83
|
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 "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 |
#ifndef MMICONHOLDER_H
|
|
20 |
#define MMICONHOLDER_H
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
|
|
24 |
class CGulIcon;
|
|
25 |
|
|
26 |
/**
|
|
27 |
* A ref-counted icon holder that can be useful if you want to store
|
|
28 |
* an icon from the model for an unspecified period of time.
|
|
29 |
* By getting the icon holder instead of the icon you can share ownership
|
|
30 |
* over the icon by calling Open() on the icon holder. Then Close() must
|
|
31 |
* be called when the icon is no longer needed, otherwise a memory leak
|
|
32 |
* will occur.
|
|
33 |
*/
|
|
34 |
NONSHARABLE_CLASS( CHnIconHolder ): public CObject
|
|
35 |
{
|
|
36 |
public:
|
|
37 |
/**
|
|
38 |
* Sets the icon to be stored in this icon holder.
|
|
39 |
* This method should be called only once. If you want to store another icon
|
|
40 |
* simply call Close() on this icon holder and then create a new icon holder
|
|
41 |
* to store the new icon.
|
|
42 |
*
|
|
43 |
* @param aGulIcon Icon to store in this icon holder.
|
|
44 |
*/
|
|
45 |
IMPORT_C void SetGulIcon( CGulIcon* aGulIcon );
|
|
46 |
|
|
47 |
/**
|
|
48 |
* Returns the icon held by this icon holder.
|
|
49 |
*
|
|
50 |
* @return Icon held by this object (NULL value possible).
|
|
51 |
*/
|
|
52 |
IMPORT_C CGulIcon* GetGulIcon() const;
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Standard C++ destructor.
|
|
56 |
*/
|
|
57 |
~CHnIconHolder();
|
|
58 |
|
|
59 |
private: // data
|
|
60 |
|
|
61 |
/**
|
|
62 |
* A CGulIcon object owned by this icon holder.
|
|
63 |
* Can possibly be NULL.
|
|
64 |
* Own.
|
|
65 |
*/
|
|
66 |
CGulIcon* iGulIcon;
|
|
67 |
};
|
|
68 |
|
|
69 |
#endif // MMICONHOLDER_H
|